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