summaryrefslogtreecommitdiff
path: root/tests/compute/initializer-list.slang
blob: 7d0af700e1e2494ffa890a6cd0897a1f56f7d74d (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:
//TEST(compute):COMPARE_COMPUTE:-cpu

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):dxbinding(0),glbinding(0),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;
}