1 # Test accessing glTexCoordIn with redeclaration (with explicit size) and with
2 # non-constant indices.
4 # From the ARB_geometry_shader4 spec (section ):
5 # "Indices used to subscript gl_TexCoord must either be an integral constant
6 # expressions, or this array must be re-declared by the shader with a size."
8 # And from the GLSL 1.1 spec page 99 (page 105 of the PDF):
9 # "Multiple modules can declare it [gl_TexCoord] with different sizes, the
10 # maximum will be used at link time."
14 GL_ARB_geometry_shader4
23 attribute vec4 vertex;
24 attribute float offset;
26 varying float gs_offset;
27 varying vec4 gl_TexCoord[3];
31 gl_TexCoord[zero] = vec4(offset + float(0));
32 gl_TexCoord[one] = vec4(offset + float(1));
33 gl_TexCoord[two] = vec4(offset + float(2));
41 #extension GL_ARB_geometry_shader4: enable
46 varying in float gs_offset[];
47 varying in vec4 gl_TexCoordIn[][2];
49 varying out float fs_ok;
55 if (gl_TexCoordIn[0][zero] != vec4(gs_offset[0] + float(0)))
57 if (gl_TexCoordIn[0][one] != vec4(gs_offset[0] + float(1)))
59 if (gl_TexCoordIn[1][zero] != vec4(gs_offset[1] + float(0)))
61 if (gl_TexCoordIn[1][one] != vec4(gs_offset[1] + float(1)))
63 if (gl_TexCoordIn[2][zero] != vec4(gs_offset[2] + float(0)))
65 if (gl_TexCoordIn[2][one] != vec4(gs_offset[2] + float(1)))
68 for (int i = 0; i < 3; ++i) {
70 gl_Position = gl_PositionIn[i];
76 input type GL_TRIANGLES
77 output type GL_TRIANGLE_STRIP
87 if (distance(fs_ok, 1.0) < 1e-6)
88 gl_FragColor = vec4(0, 1, 0, 1);
90 gl_FragColor = vec4(1, 0, 0, 1);
94 vertex/float/2 offset/float/1
104 draw arrays GL_TRIANGLE_FAN 0 4