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
632 B19 linesraw
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -output-using-type -emit-spirv-directly
2
3// CHECK: type: int32_t
4// CHECK-COUNT-256: 4
5
6//TEST_INPUT:ubuffer(stride=4, count = 256):out,name=outputBuffer
7RWStructuredBuffer<int32_t> outputBuffer;
8
9using namespace linalg;
10
11[numthreads(32, 1, 1)]
12void computeMain()
13{
14    let mat = CoopMat<float, MemoryScope.Subgroup, 16, 16, CoopMatMatrixUse::MatrixAccumulator>(4.0);
15    var result = CoopMat<int32_t, MemoryScope.Subgroup, 16, 16, CoopMatMatrixUse::MatrixAccumulator>(0);
16    result.copyFrom(mat);
17    result.Store<CoopMatMatrixLayout::RowMajor>(outputBuffer, 0, 16);
18}
19