1 # This test checks that when ARB_arrays_of_arrays is supported, the
2 # geometry shader can read all of gl_ClipDistanceIn using a single
8 GL_ARB_geometry_shader4
9 GL_ARB_arrays_of_arrays
16 out float offset_to_gs;
17 out float gl_ClipDistance[gl_MaxClipDistances];
22 offset_to_gs = offset;
23 for (int i = 0; i < gl_MaxClipDistances; i++) {
24 gl_ClipDistance[i] = offset + float(i);
30 #extension GL_ARB_geometry_shader4: enable
31 #extension GL_ARB_arrays_of_arrays: enable
33 in float offset_to_gs[3];
34 in float gl_ClipDistanceIn[3][gl_MaxClipDistances];
35 flat out int ok_to_fs;
41 float clip_distance_copy[3][gl_MaxClipDistances] = gl_ClipDistanceIn;
43 /* Make sure the copy doesn't get optimized out */
44 clip_distance_copy[0][0] += foo;
46 for (int i = 0; i < 3; i++) {
47 for (int j = 0; j < gl_MaxClipDistances; j++) {
48 if (clip_distance_copy[i][j] != offset_to_gs[i] + float(j))
52 for (int i = 0; i < 3; i++) {
53 gl_Position = gl_PositionIn[i];
60 input type GL_TRIANGLES
61 output type GL_TRIANGLE_STRIP
72 gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
74 gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
78 vertex/float/2 offset/float/1
86 draw arrays GL_TRIANGLE_FAN 0 4
87 probe all rgba 0.0 1.0 0.0 1.0