yum-mirror/slang

Making it easier to work with shaders

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

Yong HeFull address insts elimination for backward autodiff. (#2604)46a4d98ba

master
988 B28 linesraw
1//TEST_IGNORE_FILE:
2RWTexture2D<half > halfTexture_0 : register(u1);
3RWTexture2D<vector<half,2> > halfTexture2_0 : register(u2);
4RWTexture2D<vector<half,4> > halfTexture4_0 : register(u3);
5
6RWStructuredBuffer<int > outputBuffer_0 : register(u0);
7
8[shader("compute")][numthreads(4, 4, 1)]
9void computeMain(uint3 dispatchThreadID_0 : SV_DISPATCHTHREADID)
10{
11    int2 pos_0 = int2(dispatchThreadID_0.xy);
12    float _S1 = 1.00000000000000000000 / 3.00000000000000000000;
13    int _S2 = pos_0.y;
14    int _S3 = pos_0.x;
15    int2 pos2_0 = int2(int(3) - _S2, int(3) - _S3);
16
17    half h_0 = halfTexture_0[uint2(pos2_0)];
18    vector<half, 2> h2_0 = halfTexture2_0[uint2(pos2_0)];
19    vector<half, 4> h4_0 = halfTexture4_0[uint2(pos2_0)];
20
21    halfTexture_0[uint2(pos_0)] = h2_0.x + h2_0.y;
22    halfTexture2_0[uint2(pos_0)] = h4_0.xy;
23    halfTexture4_0[uint2(pos_0)] = vector<half, 4>(h2_0, h_0, h_0);
24
25    int index_0 = _S3 + _S2 * int(4);
26    outputBuffer_0[uint(index_0)] = index_0;
27    return;
28}