• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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