yum-mirror/slang

Making it easier to work with shaders

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

Yong HeImplement explciit binding for metal and wgsl. (#5778)7dabfa76c

master
450 B22 linesraw
1// gh-775-ext.slang
2//TEST(compute):COMPARE_COMPUTE: -shaderobj
3
4int test(int inVal)
5{
6    static int kVal = 16;
7    return inVal + kVal;
8}
9
10//TEST_INPUT:ubuffer(data=[9 9 9 9], stride=4):out,name outputBuffer
11RWStructuredBuffer<int> outputBuffer;
12
13[numthreads(4, 1, 1)]
14void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
15{
16	uint tid = dispatchThreadID.x;
17
18	int inVal = int(tid);
19	int outVal = test(inVal);
20
21	outputBuffer[tid] = outVal;
22}