yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
7dabfa76c
master
1//TEST(compute):COMPARE_COMPUTE: -shaderobj 2//TEST(compute):COMPARE_COMPUTE:-cpu -shaderobj 3 4// Test that `break` from a loop works. 5 6int test(int inVal) 7{ 8 int ii = 0; 9 do 10 { 11 if(ii < inVal) 12 { 13 ii++; 14 continue; 15 } 16 break; 17 } 18 while(true); 19 20 return -ii; 21} 22 23//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):out,name=outputBuffer 24RWStructuredBuffer<int> outputBuffer; 25 26[numthreads(4, 1, 1)] 27void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 28{ 29 uint tid = dispatchThreadID.x; 30 int inVal = outputBuffer[tid]; 31 int outVal = test(inVal); 32 outputBuffer[tid] = outVal; 33}