1 # This test checks that the geometry shader can perform a bulk
2 # assignment of an entire float[8] component of gl_ClipDistanceIn to
8 GL_ARB_geometry_shader4
15 out float offset_to_gs;
16 out float gl_ClipDistance[8];
21 offset_to_gs = offset;
22 for (int i = 0; i < 8; 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][8];
33 out float offset_to_fs;
34 out float gl_ClipDistance[8];
39 for (int i = 0; i < 3; i++) {
40 gl_Position = gl_PositionIn[i];
41 gl_ClipDistance = gl_ClipDistanceIn[i];
42 offset_to_fs = offset_to_gs[i];
48 input type GL_TRIANGLES
49 output type GL_TRIANGLE_STRIP
55 in float gl_ClipDistance[8];
56 in float offset_to_fs;
61 for (int i = 0; i < 8; i++) {
62 if (distance(gl_ClipDistance[i], offset_to_fs + float(i)) > 1e-6)
66 gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
68 gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
72 vertex/float/2 offset/float/1
79 # Since the fragment shader's gl_ClipDistance array is only defined
80 # for elements that have clipping enabled, we need to enable all 8
81 # clip planes. Fortunately the values we use for gl_ClipDistance are
82 # always positive, so no pixels are actually clipped.
91 draw arrays GL_TRIANGLE_FAN 0 4
92 probe all rgba 0.0 1.0 0.0 1.0