yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f02b08490
master
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector 2//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -output-using-type -profile cs_6_9 -Xslang... -Xdxc -Vd -X. 3//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type 4 5// CHECK: 1 6// CHECK-NEXT: 2 7// CHECK-NEXT: 3 8// CHECK-NEXT: 4 9// CHECK-NEXT: 5 10 11//TEST_INPUT:ubuffer(data=[1 2 3 4 5]):name=input 12RWByteAddressBuffer input; 13 14//TEST_INPUT:ubuffer(data=[0 0 0 0 0]):out,name=outputBuffer 15RWStructuredBuffer<uint32_t> outputBuffer; 16 17groupshared uint32_t[5] temp; 18 19[numthreads(1, 1, 1)] 20void computeMain() 21{ 22 let vec = coopVecLoad<5, uint32_t>(input); 23 vec.store(temp); 24 let result = coopVecLoadGroupshared<5>(temp); 25 for(int i = 0; i < result.getCount(); ++i) 26 outputBuffer[i] = result[i]; 27}