Merge pull request #2891 from dneto0/hlsl-namespace
[platform/upstream/glslang.git] / Test / atomic_uint.frag
1 #version 420 core
2
3 layout(binding = 0) uniform atomic_uint counter;
4 layout(binding = 0, offset = 9) uniform atomic_uint counter;
5
6 uint func(atomic_uint c)
7 {
8     return atomicCounterIncrement(c);
9 }
10
11 uint func2(out atomic_uint c) // ERROR
12 {
13     return counter;           // ERROR, type mismatch
14     return atomicCounter(counter);
15 }
16
17 void main()
18 {
19      atomic_uint non_uniform_counter; // ERROR
20      uint val = atomicCounter(counter);
21      atomicCounterDecrement(counter);
22 }
23 \r
24 layout(binding = 1, offset = 3) uniform atomic_uint countArr[4];\r
25 uniform int i;\r
26 \r
27 void opac()\r
28 {\r
29     counter + counter;  // ERROR\r
30     -counter;           // ERROR\r
31     int a[3];\r
32     a[counter];         // ERROR\r
33     countArr[2];\r
34     countArr[i];\r
35     counter = 4;        // ERROR\r
36 }\r
37 \r
38 in atomic_uint acin;    // ERROR\r
39 atomic_uint acg;        // ERROR\r
40 uniform atomic_uint;\r
41 uniform atomic_uint aNoBind;                          // ERROR, no binding\r
42 layout(binding=0, offset=32) uniform atomic_uint aOffset;\r
43 layout(binding=0, offset=4) uniform atomic_uint;\r
44 layout(binding=0) uniform atomic_uint bar3;           // offset is 4\r
45 layout(binding=0) uniform atomic_uint ac[2];          // offset = 8\r
46 layout(binding=0) uniform atomic_uint ad;             // offset = 20\r
47 layout(offset=8) uniform atomic_uint bar4;            // ERROR, no binding\r
48 layout(binding = 0, offset = 12) uniform atomic_uint overlap;  // ERROR, overlapping offsets\r
49 layout(binding = 20) uniform atomic_uint bigBind;     // ERROR, binding too big\r