1 # Test accessing glTexCoordIn without redeclaration but with constant indices.
3 # From the ARB_geometry_shader4 spec (section ):
4 # "Indices used to subscript gl_TexCoord must either be an integral constant
5 # expressions, or this array must be re-declared by the shader with a size."
9 GL_ARB_geometry_shader4
14 attribute vec4 vertex;
15 attribute float offset;
17 varying float gs_offset;
21 gl_TexCoord[0] = vec4(offset + float(0));
22 gl_TexCoord[1] = vec4(offset + float(1));
23 gl_TexCoord[2] = vec4(offset + float(2));
30 #extension GL_ARB_geometry_shader4: enable
32 varying in float gs_offset[];
34 varying out float fs_ok;
40 if (gl_TexCoordIn[0][0] != vec4(gs_offset[0] + float(0)))
42 if (gl_TexCoordIn[0][1] != vec4(gs_offset[0] + float(1)))
44 if (gl_TexCoordIn[1][0] != vec4(gs_offset[1] + float(0)))
46 if (gl_TexCoordIn[1][1] != vec4(gs_offset[1] + float(1)))
48 if (gl_TexCoordIn[2][0] != vec4(gs_offset[2] + float(0)))
50 if (gl_TexCoordIn[2][1] != vec4(gs_offset[2] + float(1)))
53 for (int i = 0; i < 3; ++i) {
55 gl_Position = gl_PositionIn[i];
61 input type GL_TRIANGLES
62 output type GL_TRIANGLE_STRIP
72 if (distance(fs_ok, 1.0) < 1e-6)
73 gl_FragColor = vec4(0, 1, 0, 1);
75 gl_FragColor = vec4(1, 0, 0, 1);
79 vertex/float/2 offset/float/1
86 draw arrays GL_TRIANGLE_FAN 0 4