yum-mirror/slang

Making it easier to work with shaders

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

Yong HeBe lenient on same-size unsigend->signed conversion. (#2913)16cd361dd

master
841 B40 linesraw
1//TEST_IGNORE_FILE:
2
3#pragma pack_matrix(column_major)
4
5RWStructuredBuffer<int >  g_aoa_0[] : register(u0, space1);
6
7RWStructuredBuffer<int > outputBuffer_0 : register(u0);
8
9[numthreads(8, 1, 1)]
10void computeMain(vector<uint,3> dispatchThreadID_0 : SV_DISPATCHTHREADID)
11{
12    int innerIndex_0;
13
14    int index_0 = (int) dispatchThreadID_0.x;
15
16    int innerIndex_1 = index_0 & 3;
17
18    RWStructuredBuffer<int > buffer_0 = g_aoa_0[NonUniformResourceIndex(index_0 >> 2)];
19
20    uint _S1;
21    uint _S2;
22
23    buffer_0.GetDimensions(_S1, _S2);
24
25    uint bufferCount_0 = _S1;
26
27    if(innerIndex_1 >= (int)bufferCount_0)
28    {
29        innerIndex_0 = (int) (bufferCount_0 - (uint) 1);
30    }
31    else
32    {
33        innerIndex_0 = innerIndex_1;
34    }
35
36    uint _S3 = (uint) innerIndex_0;
37    outputBuffer_0[(uint) index_0] = buffer_0[_S3];
38    return;
39}
40