Revision 26e25f6e73a9808ad93c98ad34907e3a27b6726c authored by Yong He on 19 March 2024, 00:21:48 UTC, committed by GitHub on 19 March 2024, 00:21:48 UTC
1 parent f96a3fe
break-stmt.slang
//TEST(compute):COMPARE_COMPUTE:-cpu -shaderobj
//TEST(compute):COMPARE_COMPUTE: -shaderobj
// Test that `break` from a loop works.
int test(int inVal)
{
int ii = 0;
for(;;)
{
if(ii >= inVal)
break;
ii++;
}
return -ii;
}
//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):out,name=outputBuffer
RWStructuredBuffer<int> outputBuffer : register(u0);
[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
uint tid = dispatchThreadID.x;
int inVal = outputBuffer[tid];
int outVal = test(inVal);
outputBuffer[tid] = outVal;
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...