yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Jay KwakSupport Vulkan memory model (#7057)d58243d90

master
652 B25 linesraw
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type  -emit-spirv-directly
2
3// CHECK: type: int32_t
4// CHECK-NEXT: 2
5// CHECK-NEXT: 4
6// CHECK: 7
7// CHECK-NEXT: 11
8
9//TEST_INPUT:ubuffer(stride=4, count=256):out,name=outputBuffer
10RWStructuredBuffer<int32_t> outputBuffer;
11
12using namespace linalg;
13
14typealias CoopMatType = CoopMat<int32_t, MemoryScope.Subgroup, 16, 16, CoopMatMatrixUse::MatrixAccumulator>;
15
16[numthreads(32, 1, 1)]
17void computeMain()
18{
19    CoopMatType mat;
20    mat[0] = 2;
21    mat[1] = mat[0]+2;
22    mat[2] = mat[1]+3;
23    mat[3] = mat[2]+4;
24    mat.Store<CoopMatMatrixLayout::RowMajor>(outputBuffer, 0, 16);
25}