2015-07-23 16:22:48 +00:00
|
|
|
#version 310 es
|
|
|
|
|
2016-06-17 02:59:42 +00:00
|
|
|
|
2016-02-16 03:58:50 +00:00
|
|
|
|
2015-07-23 16:22:48 +00:00
|
|
|
layout(binding = 0) uniform atomic_uint counter;
|
|
|
|
|
|
|
|
layout(binding = 0, offset = 4) uniform atomic_uint countArr[4];
|
2016-02-16 03:58:50 +00:00
|
|
|
shared uint value;
|
2015-07-23 16:22:48 +00:00
|
|
|
|
|
|
|
int arrX[gl_WorkGroupSize.x];
|
|
|
|
int arrY[gl_WorkGroupSize.y];
|
|
|
|
int arrZ[gl_WorkGroupSize.z];
|
|
|
|
|
|
|
|
uint func(atomic_uint c)
|
|
|
|
{
|
|
|
|
return atomicCounterIncrement(c);
|
|
|
|
}
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
memoryBarrierAtomicCounter();
|
|
|
|
func(counter);
|
|
|
|
uint val = atomicCounter(countArr[2]);
|
|
|
|
atomicCounterDecrement(counter);
|
|
|
|
}
|
|
|
|
|
|
|
|
shared int atomi;
|
|
|
|
shared uint atomu;
|
|
|
|
|
2015-11-16 04:33:39 +00:00
|
|
|
layout (std140, binding = 0) restrict buffer dataSSB
|
|
|
|
{
|
|
|
|
float f;
|
|
|
|
ivec4 n_frames_rendered;
|
|
|
|
} result;
|
|
|
|
|
2015-07-23 16:22:48 +00:00
|
|
|
void atoms()
|
|
|
|
{
|
|
|
|
int origi = atomicAdd(atomi, 3);
|
|
|
|
uint origu = atomicAnd(atomu, value);
|
|
|
|
origu = atomicOr(atomu, 7u);
|
|
|
|
origu = atomicXor(atomu, 7u);
|
|
|
|
origu = atomicMin(atomu, value);
|
|
|
|
origi = atomicMax(atomi, 7);
|
|
|
|
origi = atomicExchange(atomi, origi);
|
|
|
|
origu = atomicCompSwap(atomu, 10u, value);
|
2015-11-16 04:33:39 +00:00
|
|
|
atomicAdd(result.n_frames_rendered.z, 1);
|
2015-07-23 16:22:48 +00:00
|
|
|
}
|