3 GL_ARB_fragment_layer_viewport
4 GL_ARB_shader_atomic_counters
7 # Ensure that the fragment stage reads the same value for gl_Layer as was
8 # written by the geometry stage.
10 # This test covers the case where the value written is in range.
15 in vec4 piglit_vertex;
19 gl_Position = piglit_vertex;
26 layout(triangle_strip, max_vertices=12) out;
28 flat out int layer_written;
32 for (int layer = 0; layer < 4; layer++) {
34 for (int i = 0; i < 3; i++) {
35 gl_Position = gl_in[i].gl_Position;
36 layer_written = layer;
47 #extension GL_ARB_fragment_layer_viewport: require
48 #extension GL_ARB_shader_atomic_counters: require
50 flat in int layer_written;
52 layout(binding = 0) uniform atomic_uint matches;
53 layout(binding = 0) uniform atomic_uint mismatches;
57 if (layer_written == gl_Layer)
58 atomicCounterIncrement(matches);
60 atomicCounterIncrement(mismatches);
62 gl_FragColor = vec4(0);
66 texture junk 2DArray 0 ( 64 , 64 , 4 )
74 probe atomic counter 0 != 0
75 probe atomic counter 1 == 0