8 # Ensure that the fragment stage reads the same value for gl_ViewportIndex as was
9 # written by the geometry stage.
11 # This test covers the case where the value written is in range.
14 [vertex shader passthrough]
18 #extension GL_OES_geometry_shader: require
19 #extension GL_OES_viewport_array: require
22 layout(triangle_strip, max_vertices=48) out;
24 flat out int vp_written;
28 for (int vp = 0; vp < 16; vp++) {
30 for (int i = 0; i < 3; i++) {
31 gl_Position = gl_in[i].gl_Position;
33 gl_ViewportIndex = vp;
43 #extension GL_OES_viewport_array: require
45 precision highp float;
47 flat in int vp_written;
49 layout(binding = 0) uniform atomic_uint matches;
50 layout(binding = 0) uniform atomic_uint mismatches;
56 if (vp_written == gl_ViewportIndex)
57 atomicCounterIncrement(matches);
59 atomicCounterIncrement(mismatches);
65 texture junk 2DArray 0 ( 64 , 64 , 1 )
73 probe atomic counter 0 != 0
74 probe atomic counter 1 == 0