1 # This test checks that values sent to gl_ClipDistance by the vertex
2 # shader are correctly received by the geometry shader.
7 GL_ARB_geometry_shader4
14 out float offset_to_gs;
15 out float gl_ClipDistance[gl_MaxClipDistances];
20 offset_to_gs = offset;
21 for (int i = 0; i < gl_MaxClipDistances; i++) {
22 gl_ClipDistance[i] = offset + float(i);
28 #extension GL_ARB_geometry_shader4: enable
30 in float offset_to_gs[3];
31 in float gl_ClipDistanceIn[3][gl_MaxClipDistances];
32 flat out int ok_to_fs;
37 for (int i = 0; i < 3; i++) {
38 for (int j = 0; j < gl_MaxClipDistances; j++) {
39 if (gl_ClipDistanceIn[i][j] != offset_to_gs[i] + float(j))
43 for (int i = 0; i < 3; i++) {
44 gl_Position = gl_PositionIn[i];
51 input type GL_TRIANGLES
52 output type GL_TRIANGLE_STRIP
63 gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
65 gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
69 vertex/float/2 offset/float/1
76 draw arrays GL_TRIANGLE_FAN 0 4
77 probe all rgba 0.0 1.0 0.0 1.0