summaryrefslogtreecommitdiffstats
path: root/tests/bugs/gl-33.slang
blob: 255d47636201110abce8dbf5bb05dd755840493c (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
// gl-33.slang
//TEST(compute):COMPARE_COMPUTE: -shaderobj

// Test for GitLab issue # 33

import gl_33_ext;

typedef A B;

int test(int val)
{
    B b = { val };
    return b.next();
}

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name gBuffer
RWStructuredBuffer<int> gBuffer;

[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
    uint tid = dispatchThreadID.x;

    int val = int(tid);
    val = test(val);

    gBuffer[tid] = val;
}