1#version 450 2 3 4 5layout(binding = 0) uniform atomic_uint counter; 6 7layout(binding = 0, offset = 4) uniform atomic_uint countArr[4]; 8shared uint value; 9 10int arrX[gl_WorkGroupSize.x]; 11int arrY[gl_WorkGroupSize.y]; 12int arrZ[gl_WorkGroupSize.z]; 13 14uint func(atomic_uint c) 15{ 16 return atomicCounterIncrement(c); 17} 18 19void main() 20{ 21 memoryBarrierAtomicCounter(); 22 func(counter); 23 uint val = atomicCounter(countArr[2]); 24 atomicCounterDecrement(counter); 25 atomicCounterIncrement(counter); 26} 27 28shared int atomi; 29shared uint atomu; 30 31layout (std140, binding = 0) restrict buffer dataSSB 32{ 33 float f; 34 ivec4 n_frames_rendered; 35} result; 36 37void atoms() 38{ 39 int origi = atomicAdd(atomi, 3); 40 uint origu = atomicAnd(atomu, value); 41 origu = atomicOr(atomu, 7u); 42 origu = atomicXor(atomu, 7u); 43 origu = atomicMin(atomu, value); 44 origi = atomicMax(atomi, 7); 45 origi = atomicExchange(atomi, origi); 46 origu = atomicCompSwap(atomu, 10u, value); 47 atomicAdd(result.n_frames_rendered.z, 1); 48} 49