yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Tim FoleyConvert more tests to use shader objects (#1659)2a5d5b323

master
537 B30 linesraw
1//TEST(compute):COMPARE_COMPUTE: -shaderobj
2//TEST(compute):COMPARE_COMPUTE:-cpu -shaderobj
3
4struct Test
5{
6	float4 	a;
7	uint 	b;
8	float 	c;	
9};
10
11
12uint test(uint val)
13{
14	Test t = { float4(1.0f), 16, 99.0f };
15	return val + t.b;
16}
17
18//TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
19RWStructuredBuffer<uint> outputBuffer;
20
21[numthreads(4, 1, 1)]
22void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
23{
24	uint tid = dispatchThreadID.x;
25
26	uint inVal = tid;
27	uint outVal = test(inVal);
28
29	outputBuffer[tid] = outVal;
30}