summaryrefslogtreecommitdiffstats
path: root/tests/spirv/pointer-bug-2.slang
blob: e7729151bcf974e6fa637a22a216f959dc545ea7 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
//TEST:SIMPLE(filecheck=CHECK): -target spirv -emit-spirv-directly -O0

struct Tester0
{
    uint i;
};

struct Tester1
{
    Tester0 * tester0;
};

struct Tester2
{
    Tester1* tester1;
};

struct Tester3
{
    uint* i_ptr;
};

struct Push
{
    Tester2 * tester2;
    Tester3 * tester3;
};

[[vk::push_constant]] Push push;
[shader("compute")]
[numthreads(1, 1, 1)]
void main(uint3 dtid : SV_DispatchThreadID)
{    
    Tester3 tester3 = push.tester3[0];
    if (uint64_t(tester3.i_ptr) != 0)
    {
        return;
    }
}

// CHECK: OpEntryPoint