blob: 41552144d81b8f34027851eb192231207b796169 [file] [log] [blame]
John Kessenichbedb1bc2014-08-12 03:52:51 +00001#version 420 core
2
3layout(binding = 0) uniform atomic_uint counter;
Chow5db058c2019-12-25 17:27:45 +08004layout(binding = 0, offset = 9) uniform atomic_uint counter;
John Kessenichbedb1bc2014-08-12 03:52:51 +00005
6uint func(atomic_uint c)
7{
8 return atomicCounterIncrement(c);
9}
10
11uint func2(out atomic_uint c) // ERROR
12{
John Kessenich4d570902014-08-12 22:07:22 +000013 return counter; // ERROR, type mismatch
14 return atomicCounter(counter);
John Kessenichbedb1bc2014-08-12 03:52:51 +000015}
16
17void main()
18{
19 atomic_uint non_uniform_counter; // ERROR
20 uint val = atomicCounter(counter);
21 atomicCounterDecrement(counter);
22}
John Kessenich265f5fb2014-08-13 01:04:28 +000023
24layout(binding = 1, offset = 3) uniform atomic_uint countArr[4];
25uniform int i;
26
27void opac()
28{
29 counter + counter; // ERROR
30 -counter; // ERROR
31 int a[3];
32 a[counter]; // ERROR
33 countArr[2];
34 countArr[i];
35 counter = 4; // ERROR
36}
37
38in atomic_uint acin; // ERROR
39atomic_uint acg; // ERROR
John Kessenichd78ca622014-08-19 06:08:38 +000040uniform atomic_uint;
41uniform atomic_uint aNoBind; // ERROR, no binding
42layout(binding=0, offset=32) uniform atomic_uint aOffset;
43layout(binding=0, offset=4) uniform atomic_uint;
44layout(binding=0) uniform atomic_uint bar3; // offset is 4
Chow5db058c2019-12-25 17:27:45 +080045layout(binding=0) uniform atomic_uint ac[2]; // offset = 8
John Kessenichd78ca622014-08-19 06:08:38 +000046layout(binding=0) uniform atomic_uint ad; // offset = 20
47layout(offset=8) uniform atomic_uint bar4; // ERROR, no binding
48layout(binding = 0, offset = 12) uniform atomic_uint overlap; // ERROR, overlapping offsets
49layout(binding = 20) uniform atomic_uint bigBind; // ERROR, binding too big