summaryrefslogtreecommitdiff
path: root/tests/compute/initializer-list.slang
blob: de94d6c25a93c6cd291f820401167f1d9c12935c (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_INPUT: ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out

struct Test
{
	float4 	a;
	uint 	b;
	float 	c;	
};


uint test(uint val)
{
	Test t = { float4(1.0f), 16, 99.0f };
	return val + t.b;
}

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;
}