blob: b9780e97d9e2cf79f7625b12b0cc772c20e2aa05 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
//TEST:COMPARE_HLSL:-no-mangle -profile cs_5_0
//TEST:COMPARE_HLSL:-no-mangle -profile cs_5_0 -verify-debug-serial-ir
// Check output for `[allow_uav_conditional]`
#ifndef __SLANG__
#define gBuffer gBuffer_0
#endif
RWStructuredBuffer<uint> gBuffer : register(u0);
[numthreads(16,1,1)]
void main(
uint tid : SV_DispatchThreadID)
{
uint index = tid;
[allow_uav_condition]
for(;;)
{
if(gBuffer[index] == 0)
break;
index = gBuffer[index];
gBuffer[index]--;
}
}
|