blob: 8ab846e4ff9575400f6272580cae32987081cdc0 [file] [log] [blame]
John Kessenich2d0cc782016-07-07 13:20:00 -06001#version 450
John Kessenich426394d2015-07-23 10:22:48 -06002
John Kessenichb901ade2016-06-16 20:59:42 -06003
John Kessenich6c292d32016-02-15 20:58:50 -07004
John Kessenich426394d2015-07-23 10:22:48 -06005layout(binding = 0) uniform atomic_uint counter;
6
7layout(binding = 0, offset = 4) uniform atomic_uint countArr[4];
John Kessenich6c292d32016-02-15 20:58:50 -07008shared uint value;
John Kessenich426394d2015-07-23 10:22:48 -06009
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);
John Kessenich2d0cc782016-07-07 13:20:00 -060025 atomicCounterIncrement(counter);
John Kessenich426394d2015-07-23 10:22:48 -060026}
27
28shared int atomi;
29shared uint atomu;
30
John Kessenich55e7d112015-11-15 21:33:39 -070031layout (std140, binding = 0) restrict buffer dataSSB
32{
33 float f;
34 ivec4 n_frames_rendered;
35} result;
36
John Kessenich426394d2015-07-23 10:22:48 -060037void 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);
John Kessenich55e7d112015-11-15 21:33:39 -070047 atomicAdd(result.n_frames_rendered.z, 1);
John Kessenich426394d2015-07-23 10:22:48 -060048}