framework/replay: disable AA accounting when comparing with no tolerance
[piglit.git] / tests / spec / glsl-es-3.10 / execution / vs-simple-atomic-counter-inc-dec-read.shader_test
blob2c552de3d8630e2a340c93400bf2e806763d97a5
1 # Simple test of atomicCounterIncrement, atomicCounterDecrement and
2 # atomicCounter being used in the VS.
4 [require]
5 GL ES >= 3.1
6 GLSL ES >= 3.10
7 INT GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS >= 2
9 [vertex shader]
10 #version 310 es
12 layout(binding = 0) uniform atomic_uint a0;
13 layout(binding = 0) uniform atomic_uint a1;
15 in vec4 piglit_vertex;
16 out vec4 vcolor;
18 void main()
20         bool passed = true;
21         uint v0, v1;
23         /* Test that incrementing, followed by a read of an atomic
24          * counter results in a larger value.
25          *
26          * Note: atomicCounterIncrement return the old value
27          */
28         v0 = atomicCounterIncrement(a0);
29         v1 = atomicCounter(a0);
30         if (v1 <= v0)
31                 passed = false;
33         /* Skip one decrement since it may be the 0 => 0xffffffff
34          * transition.
35          */
36         atomicCounterDecrement(a1);
38         /* Test that a read, followed by a decrement of an atomic
39          * counter results in a smaller value.
40          *
41          * Note: atomicCounterDecrement return the new value
42          */
43         v0 = atomicCounter(a1);
44         v1 = atomicCounterDecrement(a1);
45         if (v1 >= v0)
46                 passed = false;
48         if (passed)
49                 vcolor = vec4(0.0, 1.0, 0.0, 1.0);
50         else
51                 vcolor = vec4(1.0, 0.0, 0.0, 1.0);
53         gl_Position = piglit_vertex;
56 [fragment shader]
57 #version 310 es
58 precision highp float;
60 in vec4 vcolor;
61 out vec4 fcolor;
63 void main()
65         fcolor = vcolor;
68 [test]
69 atomic counters 2
71 draw rect -1 -1 2 2
72 probe all rgba 0.0 1.0 0.0 1.0