1#version 420 core 2 3layout(binding = 0) uniform atomic_uint counter; 4layout(binding = 0, offset = 9) uniform atomic_uint counter; 5 6uint func(atomic_uint c) 7{ 8 return atomicCounterIncrement(c); 9} 10 11uint func2(out atomic_uint c) // ERROR 12{ 13 return counter; // ERROR, type mismatch 14 return atomicCounter(counter); 15} 16 17void main() 18{ 19 atomic_uint non_uniform_counter; // ERROR 20 uint val = atomicCounter(counter); 21 atomicCounterDecrement(counter); 22} 23 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 40uniform 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 45layout(binding=0) uniform atomic_uint ac[2]; // offset = 8 46layout(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 50