1 # This test checks that the geometry shader can read an entire
2 # float[gl_MaxClipDistances] component of gl_ClipDistanceIn using a
3 # single bulk assignment.
8 GL_ARB_geometry_shader4
15 out float offset_to_gs;
16 out float gl_ClipDistance[gl_MaxClipDistances];
21 offset_to_gs = offset;
22 for (int i = 0; i < gl_MaxClipDistances; i++) {
23 gl_ClipDistance[i] = offset + float(i);
29 #extension GL_ARB_geometry_shader4: enable
31 in float offset_to_gs[3];
32 in float gl_ClipDistanceIn[3][gl_MaxClipDistances];
33 flat out int ok_to_fs;
39 for (int i = 0; i < 3; i++) {
40 float clip_distance_copy[gl_MaxClipDistances] = gl_ClipDistanceIn[i];
42 /* Make sure the copy doesn't get optimized out */
43 clip_distance_copy[0] += foo;
45 for (int j = 0; j < gl_MaxClipDistances; j++) {
46 if (clip_distance_copy[j] != offset_to_gs[i] + float(j))
50 for (int i = 0; i < 3; i++) {
51 gl_Position = gl_PositionIn[i];
58 input type GL_TRIANGLES
59 output type GL_TRIANGLE_STRIP
70 gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
72 gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
76 vertex/float/2 offset/float/1
84 draw arrays GL_TRIANGLE_FAN 0 4
85 probe all rgba 0.0 1.0 0.0 1.0