blob: 85ad0d8cfbb5e267eb28dfa41e5cb1174e84c3c0 (
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
30
|
//TEST(compute):COMPARE_COMPUTE: -shaderobj
//TEST(compute):COMPARE_COMPUTE:-cpu -shaderobj
struct Test
{
float4 a;
uint b;
float c;
};
uint test(uint val)
{
Test t = { float4(1.0f), 16, 99.0f };
return val + t.b;
}
//TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<uint> outputBuffer;
[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
uint tid = dispatchThreadID.x;
uint inVal = tid;
uint outVal = test(inVal);
outputBuffer[tid] = outVal;
}
|