1 #Test bounds checking of 2d array indexing.
2 #Also test length validation of the inner array of 2d arrays.
6 GL_ARB_geometry_shader4
11 attribute vec4 vertex;
13 varying float gs_input1[1];
14 varying float gs_input4[4];
19 for (int i = 0; i < 4; i++)
26 #extension GL_ARB_geometry_shader4: enable
28 varying in float gs_input1[3][1];
29 varying in float gs_input4[3][4];
31 varying out vec4 gs_out;
35 /* Constant indexing of arrays with known size should do a bounds check.
36 * The bounds check on these to operations would fail if the compiler
37 * checked the index against the wrong array dimension.
39 float s1 = gs_input1[1][0];
40 float s2 = gs_input4[0][3];
42 /* Assignment operations of arrays should fail if the arrays don't have
44 * The assignment operations would fail if the compiler incorrectly
45 * compared the size of the local arrays a* (1 and 4, respectively) to
46 * the size of the outer dimension of the input arrays gs_input* (3).
48 float a1[1] = gs_input1[0];
49 float a4[4] = gs_input4[0];
51 for (int i = 0; i < gl_VerticesIn; i++) {
52 gs_out = vec4(s1, s2, a1[0], a4[0]);
54 gl_Position = gl_PositionIn[i];
60 input type GL_TRIANGLES
61 output type GL_TRIANGLE_STRIP
67 const int gs_VerticesIn = 3;
73 gl_FragColor = gs_out;
84 draw arrays GL_TRIANGLE_FAN 0 4
85 probe all rgba 0.5 0.5 0.5 0.5