1 # Simple test of atomicCounterIncrement, atomicCounterDecrement and
2 # atomicCounter being used in the VS.
6 GL_ARB_shader_atomic_counters
7 INT GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS >= 2
11 #extension GL_ARB_shader_atomic_counters: require
13 layout(binding = 0) uniform atomic_uint a0;
14 layout(binding = 0) uniform atomic_uint a1;
16 in vec4 piglit_vertex;
24 /* Test that incrementing, followed by a read of an atomic
25 * counter results in a larger value.
27 * Note: atomicCounterIncrement return the old value
29 v0 = atomicCounterIncrement(a0);
30 v1 = atomicCounter(a0);
34 /* Skip one decrement since it may be the 0 => 0xffffffff
37 atomicCounterDecrement(a1);
39 /* Test that a read, followed by a decrement of an atomic
40 * counter results in a smaller value.
42 * Note: atomicCounterDecrement return the new value
44 v0 = atomicCounter(a1);
45 v1 = atomicCounterDecrement(a1);
50 vcolor = vec4(0.0, 1.0, 0.0, 1.0);
52 vcolor = vec4(1.0, 0.0, 0.0, 1.0);
54 gl_Position = piglit_vertex;
71 probe all rgba 0.0 1.0 0.0 1.0