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 -output-using-type -xslang -skip-spirv-validation 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: type: int32_t 6// CHECK-NEXT: -1 7// CHECK-NEXT: -2 8// CHECK-NEXT: -3 9// CHECK-NEXT: -4 10 11//TEST_INPUT:ubuffer(data=[1 2 3 4], stride=4),name=input1 12ByteAddressBuffer input1; 13 14//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer 15RWStructuredBuffer<int32_t> outputBuffer; 16 17[numthreads(1, 1, 1)] 18void computeMain() 19{ 20 CoopVec<int32_t, 4> vec1 = coopVecLoad<4, int32_t>(input1); 21 CoopVec<int32_t, 4> negVec = -vec1; 22 23 for(int i = 0; i < negVec.getCount(); ++i) 24 outputBuffer[i] = negVec[i]; 25}