blob: 88568d1dd97784d22281df6ff3eb894337183800 (
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
27
28
29
|
//TEST(compute):COMPARE_COMPUTE:
//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):dxbinding(0),glbinding(0),out
//TEST_INPUT:ubuffer(data=[1 2 3 0], stride=4):dxbinding(1),glbinding(1)
// Check that we propagate the `[unroll]` attribute
// through to HLSL output correctly.
//
// If we neglect to generate the attribute in the output,
// it will generate a warning output from fxc, and the
// test will fail to match the expected output.
RWStructuredBuffer<int> buffers[2];
[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
uint tid = dispatchThreadID.x;
int val = buffers[1][tid];
[unroll]
for(int ii = 0; ii < 2; ii++)
{
val = buffers[ii][val];
}
buffers[0][tid] = val;
}
|