1 # This test checks that the geometry shader can pass an entire
2 # float[gl_MaxClipDistances] component of gl_ClipDistanceIn to a
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;
35 bool test(float clip_distance_copy[gl_MaxClipDistances], float offset)
39 for (int j = 0; j < gl_MaxClipDistances; j++) {
40 if (clip_distance_copy[j] != offset + float(j))
50 for (int i = 0; i < 3; i++) {
51 if (!test(gl_ClipDistanceIn[i], offset_to_gs[i]))
54 for (int i = 0; i < 3; i++) {
55 gl_Position = gl_PositionIn[i];
62 input type GL_TRIANGLES
63 output type GL_TRIANGLE_STRIP
74 gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
76 gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
80 vertex/float/2 offset/float/1
87 draw arrays GL_TRIANGLE_FAN 0 4
88 probe all rgba 0.0 1.0 0.0 1.0