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