1 # Verify simple usage of atomics and shared variables
7 GL_ARB_shader_atomic_counters
11 #extension GL_ARB_compute_shader: enable
12 #extension GL_ARB_shader_atomic_counters: enable
14 layout(local_size_x = 2, local_size_y = 3) in;
17 layout(binding = 0) uniform atomic_uint pass;
18 const uint size = gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z;
22 if (gl_LocalInvocationIndex == 0u)
25 atomicAdd(value, gl_LocalInvocationIndex);
27 if (gl_LocalInvocationIndex == 0u) {
28 if (value == size * (size - 1u) / 2u)
29 atomicCounterIncrement(pass);
36 probe atomic counter 0 == 24