yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
9ed7b5264
master
1//TEST(compute):COMPARE_COMPUTE: -shaderobj -xslang -Wno-41024 2//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):out,name outputBuffer 3 4// Test that "operator comma" works as expected 5 6static int a = 0; 7 8int setA(int val) 9{ 10 a = val; 11 return 0; 12} 13 14int getA() 15{ 16 return a; 17} 18 19int test(int inVal) 20{ 21 int x = (setA(inVal), getA()); 22 return x * 16; 23} 24 25RWStructuredBuffer<int> outputBuffer; 26 27[numthreads(4, 1, 1)] 28void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 29{ 30 uint tid = dispatchThreadID.x; 31 int inVal = outputBuffer[tid]; 32 int outVal = test(inVal); 33 outputBuffer[tid] = outVal; 34}