<div dir="ltr"><div>Tested-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>></div><div>Acked-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>></div><div><br></div><div>Marek</div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 21, 2018 at 10:29 PM, Timothy Arceri <span dir="ltr"><<a href="mailto:tarceri@itsqueeze.com" target="_blank">tarceri@itsqueeze.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">These tests have been adapted from the glsl-1.20 clipping tests.<br>
<br>
This tests both setting gl_ClipVertex in the geometry shader and<br>
using the gs to passthrough the gl_ClipVertex value from the<br>
vertex shader.<br>
<br>
I tested these on NVIDIA 384.111 binary driver but some of these<br>
get a cryptic error message:<br>
<br>
variable "gl_ClipVertex" domain conflicts with semantics "CLPV"<br>
<br>
However I believe the tests are correct and this is a driver bug.<br>
---<br>
 .../gs-clip-vertex-const-<wbr>accept.shader_test   |  68 +++++++<br>
 .../gs-clip-vertex-const-<wbr>reject.shader_test   |  58 ++++++<br>
 ...vertex-different-from-<wbr>position.shader_test |  79 ++++++++<br>
 .../gs-clip-vertex-enables.<wbr>shader_test        | 163 ++++++++++++++++<br>
 ...-clip-vertex-equal-to-<wbr>position.shader_test |  73 ++++++++<br>
 .../gs-clip-vertex-<wbr>homogeneity.shader_test    |  86 +++++++++<br>
 ...s-clip-vertex-primitives-<wbr>lines.shader_test |  72 +++++++<br>
 ...-clip-vertex-primitives-<wbr>points.shader_test |  72 +++++++<br>
 ...rtex-primitives-triangle-<wbr>strip.shader_test |  72 +++++++<br>
 ...vs-gs-clip-vertex-const-<wbr>accept.shader_test |  70 +++++++<br>
 ...vs-gs-clip-vertex-const-<wbr>reject.shader_test |  70 +++++++<br>
 ...vertex-different-from-<wbr>position.shader_test |  90 +++++++++<br>
 .../vs-gs-clip-vertex-enables.<wbr>shader_test     | 175 ++++++++++++++++++<br>
 ...-clip-vertex-equal-to-<wbr>position.shader_test |  85 +++++++++<br>
 .../vs-gs-clip-vertex-<wbr>homogeneity.shader_test |  97 ++++++++++<br>
 ...rtex-primitives-triangle-<wbr>strip.shader_test |  83 +++++++++<br>
 16 files changed, 1413 insertions(+)<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-const-<wbr>accept.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-const-<wbr>reject.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>different-from-position.<wbr>shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>enables.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-equal-<wbr>to-position.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>homogeneity.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-lines.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-points.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-triangle-strip.<wbr>shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>const-accept.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>const-reject.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>different-from-position.<wbr>shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>enables.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>equal-to-position.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>homogeneity.shader_test<br>
 create mode 100644 tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>primitives-triangle-strip.<wbr>shader_test<br>
<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-const-<wbr>accept.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-const-<wbr>accept.shader_test<br>
new file mode 100644<br>
index 000000000..a59fbd98a<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-const-<wbr>accept.shader_test<br>
@@ -0,0 +1,68 @@<br>
+# From the GL 2.1 spec, section 2.17 (Clipping):<br>
+#<br>
+#   All points with eye coordinates (x_e y_e z_e w_e)^T that satisfy<br>
+#<br>
+#                          (x_e)<br>
+#     (p_1' p_2' p_3' p_4')(y_e) >= 0<br>
+#                          (z_e)<br>
+#                          (w_e)<br>
+#<br>
+#   lie in the half-space defined by the plane; points that do not<br>
+#   satisfy this condition do not lie in the half-space.<br>
+#<br>
+# This test checks that gl_ClipVertex works properly for the trivial<br>
+# case where gl_ClipVertex is a constant value satisfying the above<br>
+# inequality.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 150 compatibility<br>
+<br>
+out gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+};<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+in gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+} gl_in[];<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = vec4(1.0, 0.0, 0.0, 0.0);<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1.0);<br>
+}<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+clip plane 0 1.0 0.0 0.0 0.0 # accept points where gl_ClipVertex.x >= 0<br>
+enable GL_CLIP_PLANE0<br>
+draw rect -1 -1 2 2<br>
+probe all rgba 1.0 1.0 1.0 1.0<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-const-<wbr>reject.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-const-<wbr>reject.shader_test<br>
new file mode 100644<br>
index 000000000..3e4930494<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-const-<wbr>reject.shader_test<br>
@@ -0,0 +1,58 @@<br>
+# From the GL 2.1 spec, section 2.17 (Clipping):<br>
+#<br>
+#   All points with eye coordinates (x_e y_e z_e w_e)^T that satisfy<br>
+#<br>
+#                          (x_e)<br>
+#     (p_1' p_2' p_3' p_4')(y_e) >= 0<br>
+#                          (z_e)<br>
+#                          (w_e)<br>
+#<br>
+#   lie in the half-space defined by the plane; points that do not<br>
+#   satisfy this condition do not lie in the half-space.<br>
+#<br>
+# This test checks that gl_ClipVertex works properly for the trivial<br>
+# case where gl_ClipVertex is a constant value not satisfying the<br>
+# above inequality.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 120<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = vec4(-1.0, 0.0, 0.0, 0.0);<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1.0);<br>
+}<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+clip plane 0 1.0 0.0 0.0 0.0 # accept points where gl_ClipVertex.x >= 0<br>
+enable GL_CLIP_PLANE0<br>
+draw rect -1 -1 2 2<br>
+probe all rgba 0.0 0.0 0.0 0.0<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>different-from-position.<wbr>shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>different-from-position.<wbr>shader_test<br>
new file mode 100644<br>
index 000000000..5568c9782<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>different-from-position.<wbr>shader_test<br>
@@ -0,0 +1,79 @@<br>
+# [description]<br>
+# Use all 6 clip planes to clip a rectangle to a hexagon shape.<br>
+#<br>
+# In this test, gl_Position and gl_ClipVertex are different to verify<br>
+# that gl_Position determines screen position and gl_ClipVertex<br>
+# determines clipping.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 120<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_Vertex;<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_ModelViewProjectionMatrix * gl_in[i].gl_Position;<br>
+<br>
+               // Transform gl_ClipVertex in an arbitrary way so that<br>
+               // we can verify it is being used for clipping instead of<br>
+               // gl_Position.<br>
+               gl_ClipVertex = gl_in[i].gl_Position * vec4(10.0, 10.0, 1.0, 1.0);<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1, 1, 1, 1);<br>
+}<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+ortho 0 1 0 1<br>
+clip plane 0 0 1 0 -2.5<br>
+clip plane 1 -1 1 0 4<br>
+clip plane 2 -1 -1 0 14<br>
+clip plane 3 0 -1 0 7.5<br>
+clip plane 4 1 -1 0 4<br>
+clip plane 5 1 1 0 -6<br>
+enable GL_CLIP_PLANE0<br>
+enable GL_CLIP_PLANE1<br>
+enable GL_CLIP_PLANE2<br>
+enable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+enable GL_CLIP_PLANE5<br>
+draw rect 0.1 0.1 0.8 0.8<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>enables.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>enables.shader_test<br>
new file mode 100644<br>
index 000000000..d5ef9cd98<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>enables.shader_test<br>
@@ -0,0 +1,163 @@<br>
+# This test sets up 6 clipping planes using gl_ClipVertex, which clip<br>
+# a rectangle to a hexagon shape.  Then it tests various combinations<br>
+# of enables for the 6 clipping planes, and verifies that they all<br>
+# create the correct shape.<br>
+#<br>
+# To verify that each enable works, the combinations of enables were<br>
+# chosen such that:<br>
+# - Every plane is enabled at least once and disbled at least once.<br>
+# - Every plane is enabled and disabled in a different pattern.<br>
+#<br>
+# Note: Some implementations have bugs related to improper coordinate<br>
+# transformations of clip planes (which are already adequately tested<br>
+# by the clip-plane-transformation test), so to avoid those bugs<br>
+# contaminating the results of this test, we don't do any coordinate<br>
+# transformation in this test.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 120<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_Vertex;<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex =  gl_in[i].gl_Position;<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1, 1, 1, 1);<br>
+}<br>
+<br>
+[test]<br>
+clip plane 0 0 1 0 0.5<br>
+clip plane 1 -1 1 0 0.8<br>
+clip plane 2 -1 -1 0 0.8<br>
+clip plane 3 0 -1 0 0.5<br>
+clip plane 4 1 -1 0 0.8<br>
+clip plane 5 1 1 0 0.8<br>
+clear color 0.0 0.0 0.0 0.0<br>
+<br>
+# Test with planes 0, 2, and 4 enabled.<br>
+enable GL_CLIP_PLANE0<br>
+disable GL_CLIP_PLANE1<br>
+enable GL_CLIP_PLANE2<br>
+disable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+disable GL_CLIP_PLANE5<br>
+clear<br>
+draw rect -1 -1 2 2<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0<br>
+relative probe rgba (0.8, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 1<br>
+relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 2<br>
+relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4<br>
+relative probe rgba (0.2, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 5<br>
+<br>
+# Test with planes 0, 1, 4, and 5 enabled.<br>
+enable GL_CLIP_PLANE0<br>
+enable GL_CLIP_PLANE1<br>
+disable GL_CLIP_PLANE2<br>
+disable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+enable GL_CLIP_PLANE5<br>
+clear<br>
+draw rect -1 -1 2 2<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0<br>
+relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 1<br>
+relative probe rgba (0.8, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 2<br>
+relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4<br>
+relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 5<br>
+<br>
+# Test with planes 0, 1, 2, and 3 enabled.<br>
+enable GL_CLIP_PLANE0<br>
+enable GL_CLIP_PLANE1<br>
+enable GL_CLIP_PLANE2<br>
+enable GL_CLIP_PLANE3<br>
+disable GL_CLIP_PLANE4<br>
+disable GL_CLIP_PLANE5<br>
+clear<br>
+draw rect -1 -1 2 2<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0<br>
+relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 1<br>
+relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 2<br>
+relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0) # clipped by plane 3<br>
+relative probe rgba (0.2, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 4<br>
+relative probe rgba (0.2, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 5<br>
+<br>
+# Test with planes 4 and 5 enabled.<br>
+disable GL_CLIP_PLANE0<br>
+disable GL_CLIP_PLANE1<br>
+disable GL_CLIP_PLANE2<br>
+disable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+enable GL_CLIP_PLANE5<br>
+clear<br>
+draw rect -1 -1 2 2<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.5, 0.2) (1.0, 1.0, 1.0, 1.0) # clipped by plane 0<br>
+relative probe rgba (0.8, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 1<br>
+relative probe rgba (0.8, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 2<br>
+relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4<br>
+relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 5<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-equal-<wbr>to-position.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-equal-<wbr>to-position.shader_test<br>
new file mode 100644<br>
index 000000000..8fee276b3<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-equal-<wbr>to-position.shader_test<br>
@@ -0,0 +1,73 @@<br>
+# [description]<br>
+# Use all 6 clip planes to clip a rectangle to a hexagon shape.<br>
+#<br>
+# In this test, gl_Position and gl_ClipVertex are the same.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 120<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_Vertex;<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_ModelViewProjectionMatrix * gl_in[i].gl_Position;<br>
+               gl_ClipVertex = gl_Position;<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1, 1, 1, 1);<br>
+}<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+ortho 0 1 0 1<br>
+clip plane 0 0 1 0 0.5<br>
+clip plane 1 -1 1 0 0.8<br>
+clip plane 2 -1 -1 0 0.8<br>
+clip plane 3 0 -1 0 0.5<br>
+clip plane 4 1 -1 0 0.8<br>
+clip plane 5 1 1 0 0.8<br>
+enable GL_CLIP_PLANE0<br>
+enable GL_CLIP_PLANE1<br>
+enable GL_CLIP_PLANE2<br>
+enable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+enable GL_CLIP_PLANE5<br>
+draw rect 0.1 0.1 0.8 0.8<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>homogeneity.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>homogeneity.shader_test<br>
new file mode 100644<br>
index 000000000..d432b6b03<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>homogeneity.shader_test<br>
@@ -0,0 +1,86 @@<br>
+# This test verifies that the homogeneous coordinate of gl_ClipVertex<br>
+# is properly respected, by doubling all the coordinates of<br>
+# gl_ClipVertex (including the homogeneous coordinate) and verifying<br>
+# that the clipped shape is still correct.<br>
+#<br>
+# In addition, this test:<br>
+# - uses all 6 clip planes to clip a rectangle to a hexagon shape.<br>
+# - sets gl_Position and gl_ClipVertex to different values, to verify<br>
+#   that gl_Position determines screen position and gl_ClipVertex<br>
+#   determines clipping.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 120<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_Vertex;<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_ModelViewProjectionMatrix * gl_in[i].gl_Position;<br>
+<br>
+               // Transform gl_ClipVertex in an arbitrary way so that<br>
+               // we can verify it is being used for clipping instead of<br>
+               // gl_Position.  The x and y coordinates are multiplied by 5,<br>
+               // and the homogeneous coordinate is multiplied by 0.5, so the<br>
+               // net result should be that x and y are scaled by a factor of<br>
+               // 10.<br>
+               gl_ClipVertex = gl_in[i].gl_Position * vec4(5.0, 5.0, 1.0, 0.5);<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1, 1, 1, 1);<br>
+}<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+ortho 0 1 0 1<br>
+clip plane 0 0 1 0 -2.5<br>
+clip plane 1 -1 1 0 4<br>
+clip plane 2 -1 -1 0 14<br>
+clip plane 3 0 -1 0 7.5<br>
+clip plane 4 1 -1 0 4<br>
+clip plane 5 1 1 0 -6<br>
+enable GL_CLIP_PLANE0<br>
+enable GL_CLIP_PLANE1<br>
+enable GL_CLIP_PLANE2<br>
+enable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+enable GL_CLIP_PLANE5<br>
+draw rect 0.1 0.1 0.8 0.8<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-lines.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-lines.shader_test<br>
new file mode 100644<br>
index 000000000..278d968ca<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-lines.shader_test<br>
@@ -0,0 +1,72 @@<br>
+# Verify that gl_ClipVertex affects different primitive types correctly.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 120<br>
+<br>
+attribute vec2 in_pos;<br>
+<br>
+uniform vec2 u_offset;<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_ModelViewProjectionMatrix * vec4(u_offset + in_pos, 0, 1);<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(lines) in;<br>
+layout(line_strip, max_vertices = 2) out;<br>
+<br>
+uniform float u_clipdist;<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = vec4(u_clipdist, 0.0, 0.0, 0.0);<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);<br>
+}<br>
+<br>
+[vertex data]<br>
+in_pos/float/2<br>
+ 0  0<br>
+10  0<br>
+ 0 10<br>
+10 10<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+<br>
+clip plane 0 1.0 0.0 0.0 0.0 # accept points where gl_ClipVertex.x >= 0<br>
+enable GL_CLIP_PLANE0<br>
+<br>
+ortho<br>
+<br>
+# Test that primitives are clipped with a negative distance<br>
+uniform float u_clipdist -1<br>
+<br>
+uniform vec2 u_offset 20 0.5<br>
+draw arrays GL_LINES 0 2<br>
+probe rect rgba (20, 0, 20, 20) (0, 0, 0, 0)<br>
+<br>
+# Test that primitives are not clipped with zero distance<br>
+uniform float u_clipdist 0<br>
+<br>
+uniform vec2 u_offset 20 20.5<br>
+draw arrays GL_LINES 0 2<br>
+probe rect rgba (20, 20, 10, 1) (1, 0, 0, 1)<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-points.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-points.shader_test<br>
new file mode 100644<br>
index 000000000..a4f202ec4<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-points.shader_test<br>
@@ -0,0 +1,72 @@<br>
+# Verify that gl_ClipVertex affects different primitive types correctly.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 120<br>
+<br>
+attribute vec2 in_pos;<br>
+<br>
+uniform vec2 u_offset;<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_ModelViewProjectionMatrix * vec4(u_offset + in_pos, 0, 1);<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(points) in;<br>
+layout(points, max_vertices = 1) out;<br>
+<br>
+uniform float u_clipdist;<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = vec4(u_clipdist, 0.0, 0.0, 0.0);<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);<br>
+}<br>
+<br>
+[vertex data]<br>
+in_pos/float/2<br>
+ 0  0<br>
+10  0<br>
+ 0 10<br>
+10 10<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+<br>
+clip plane 0 1.0 0.0 0.0 0.0 # accept points where gl_ClipVertex.x >= 0<br>
+enable GL_CLIP_PLANE0<br>
+<br>
+ortho<br>
+<br>
+# Test that primitives are clipped with a negative distance<br>
+uniform float u_clipdist -1<br>
+<br>
+uniform vec2 u_offset 0.5 0.5<br>
+draw arrays GL_POINTS 0 1<br>
+probe rect rgba ( 0, 0, 20, 20) (0, 0, 0, 0)<br>
+<br>
+# Test that primitives are not clipped with zero distance<br>
+uniform float u_clipdist 0<br>
+<br>
+uniform vec2 u_offset 0.5 20.5<br>
+draw arrays GL_POINTS 0 1<br>
+probe rect rgba ( 0, 20, 1, 1) (1, 0, 0, 1)<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-triangle-strip.<wbr>shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-triangle-strip.<wbr>shader_test<br>
new file mode 100644<br>
index 000000000..c844f64af<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/gs-clip-vertex-<wbr>primitives-triangle-strip.<wbr>shader_test<br>
@@ -0,0 +1,72 @@<br>
+# Verify that gl_ClipVertex affects different primitive types correctly.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 120<br>
+<br>
+attribute vec2 in_pos;<br>
+<br>
+uniform vec2 u_offset;<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_ModelViewProjectionMatrix * vec4(u_offset + in_pos, 0, 1);<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+uniform float u_clipdist;<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = vec4(u_clipdist, 0.0, 0.0, 0.0);<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);<br>
+}<br>
+<br>
+[vertex data]<br>
+in_pos/float/2<br>
+ 0  0<br>
+10  0<br>
+ 0 10<br>
+10 10<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+<br>
+clip plane 0 1.0 0.0 0.0 0.0 # accept points where gl_ClipVertex.x >= 0<br>
+enable GL_CLIP_PLANE0<br>
+<br>
+ortho<br>
+<br>
+# Test that primitives are clipped with a negative distance<br>
+uniform float u_clipdist -1<br>
+<br>
+uniform vec2 u_offset 40 0<br>
+draw arrays GL_TRIANGLE_STRIP 0 4<br>
+probe rect rgba (40, 0, 20, 20) (0, 0, 0, 0)<br>
+<br>
+# Test that primitives are not clipped with zero distance<br>
+uniform float u_clipdist 0<br>
+<br>
+uniform vec2 u_offset 40 20<br>
+draw arrays GL_TRIANGLE_STRIP 0 4<br>
+probe rect rgba (40, 20, 10, 10) (1, 0, 0, 1)<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>const-accept.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>const-accept.shader_test<br>
new file mode 100644<br>
index 000000000..93782dbba<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>const-accept.shader_test<br>
@@ -0,0 +1,70 @@<br>
+# From the GL 2.1 spec, section 2.17 (Clipping):<br>
+#<br>
+#   All points with eye coordinates (x_e y_e z_e w_e)^T that satisfy<br>
+#<br>
+#                          (x_e)<br>
+#     (p_1' p_2' p_3' p_4')(y_e) >= 0<br>
+#                          (z_e)<br>
+#                          (w_e)<br>
+#<br>
+#   lie in the half-space defined by the plane; points that do not<br>
+#   satisfy this condition do not lie in the half-space.<br>
+#<br>
+# This test checks that gl_ClipVertex works properly for the trivial<br>
+# case where gl_ClipVertex is a constant value satisfying the above<br>
+# inequality.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 150 compatibility<br>
+<br>
+out gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+};<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;<br>
+<br>
+       gl_ClipVertex = vec4(1.0, 0.0, 0.0, 0.0);<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+in gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+} gl_in[];<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = gl_in[i].gl_ClipVertex;<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1.0);<br>
+}<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+clip plane 0 1.0 0.0 0.0 0.0 # accept points where gl_ClipVertex.x >= 0<br>
+enable GL_CLIP_PLANE0<br>
+draw rect -1 -1 2 2<br>
+probe all rgba 1.0 1.0 1.0 1.0<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>const-reject.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>const-reject.shader_test<br>
new file mode 100644<br>
index 000000000..d244a288b<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>const-reject.shader_test<br>
@@ -0,0 +1,70 @@<br>
+# From the GL 2.1 spec, section 2.17 (Clipping):<br>
+#<br>
+#   All points with eye coordinates (x_e y_e z_e w_e)^T that satisfy<br>
+#<br>
+#                          (x_e)<br>
+#     (p_1' p_2' p_3' p_4')(y_e) >= 0<br>
+#                          (z_e)<br>
+#                          (w_e)<br>
+#<br>
+#   lie in the half-space defined by the plane; points that do not<br>
+#   satisfy this condition do not lie in the half-space.<br>
+#<br>
+# This test checks that gl_ClipVertex works properly for the trivial<br>
+# case where gl_ClipVertex is a constant value not satisfying the<br>
+# above inequality.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 150 compatibility<br>
+<br>
+out gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+};<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;<br>
+<br>
+       gl_ClipVertex = vec4(-1.0, 0.0, 0.0, 0.0);<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+in gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+} gl_in[];<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = gl_in[i].gl_ClipVertex;<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1.0);<br>
+}<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+clip plane 0 1.0 0.0 0.0 0.0 # accept points where gl_ClipVertex.x >= 0<br>
+enable GL_CLIP_PLANE0<br>
+draw rect -1 -1 2 2<br>
+probe all rgba 0.0 0.0 0.0 0.0<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>different-from-position.<wbr>shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>different-from-position.<wbr>shader_test<br>
new file mode 100644<br>
index 000000000..4a5b225b3<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>different-from-position.<wbr>shader_test<br>
@@ -0,0 +1,90 @@<br>
+# [description]<br>
+# Use all 6 clip planes to clip a rectangle to a hexagon shape.<br>
+#<br>
+# In this test, gl_Position and gl_ClipVertex are different to verify<br>
+# that gl_Position determines screen position and gl_ClipVertex<br>
+# determines clipping.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 150 compatibility<br>
+<br>
+out gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+};<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;<br>
+<br>
+       // Transform gl_ClipVertex in an arbitrary way so that<br>
+       // we can verify it is being used for clipping instead of<br>
+       // gl_Position.<br>
+       gl_ClipVertex = gl_Vertex * vec4(10.0, 10.0, 1.0, 1.0);<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+in gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+} gl_in[];<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = gl_in[i].gl_ClipVertex;<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1, 1, 1, 1);<br>
+}<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+ortho 0 1 0 1<br>
+clip plane 0 0 1 0 -2.5<br>
+clip plane 1 -1 1 0 4<br>
+clip plane 2 -1 -1 0 14<br>
+clip plane 3 0 -1 0 7.5<br>
+clip plane 4 1 -1 0 4<br>
+clip plane 5 1 1 0 -6<br>
+enable GL_CLIP_PLANE0<br>
+enable GL_CLIP_PLANE1<br>
+enable GL_CLIP_PLANE2<br>
+enable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+enable GL_CLIP_PLANE5<br>
+draw rect 0.1 0.1 0.8 0.8<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>enables.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>enables.shader_test<br>
new file mode 100644<br>
index 000000000..4231e8b26<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>enables.shader_test<br>
@@ -0,0 +1,175 @@<br>
+# This test sets up 6 clipping planes using gl_ClipVertex, which clip<br>
+# a rectangle to a hexagon shape.  Then it tests various combinations<br>
+# of enables for the 6 clipping planes, and verifies that they all<br>
+# create the correct shape.<br>
+#<br>
+# To verify that each enable works, the combinations of enables were<br>
+# chosen such that:<br>
+# - Every plane is enabled at least once and disbled at least once.<br>
+# - Every plane is enabled and disabled in a different pattern.<br>
+#<br>
+# Note: Some implementations have bugs related to improper coordinate<br>
+# transformations of clip planes (which are already adequately tested<br>
+# by the clip-plane-transformation test), so to avoid those bugs<br>
+# contaminating the results of this test, we don't do any coordinate<br>
+# transformation in this test.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 150 compatibility<br>
+<br>
+out gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+};<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_Vertex;<br>
+<br>
+       gl_ClipVertex = gl_Position;<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+in gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+} gl_in[];<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = gl_in[i].gl_ClipVertex;<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1, 1, 1, 1);<br>
+}<br>
+<br>
+[test]<br>
+clip plane 0 0 1 0 0.5<br>
+clip plane 1 -1 1 0 0.8<br>
+clip plane 2 -1 -1 0 0.8<br>
+clip plane 3 0 -1 0 0.5<br>
+clip plane 4 1 -1 0 0.8<br>
+clip plane 5 1 1 0 0.8<br>
+clear color 0.0 0.0 0.0 0.0<br>
+<br>
+# Test with planes 0, 2, and 4 enabled.<br>
+enable GL_CLIP_PLANE0<br>
+disable GL_CLIP_PLANE1<br>
+enable GL_CLIP_PLANE2<br>
+disable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+disable GL_CLIP_PLANE5<br>
+clear<br>
+draw rect -1 -1 2 2<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0<br>
+relative probe rgba (0.8, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 1<br>
+relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 2<br>
+relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4<br>
+relative probe rgba (0.2, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 5<br>
+<br>
+# Test with planes 0, 1, 4, and 5 enabled.<br>
+enable GL_CLIP_PLANE0<br>
+enable GL_CLIP_PLANE1<br>
+disable GL_CLIP_PLANE2<br>
+disable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+enable GL_CLIP_PLANE5<br>
+clear<br>
+draw rect -1 -1 2 2<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0<br>
+relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 1<br>
+relative probe rgba (0.8, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 2<br>
+relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4<br>
+relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 5<br>
+<br>
+# Test with planes 0, 1, 2, and 3 enabled.<br>
+enable GL_CLIP_PLANE0<br>
+enable GL_CLIP_PLANE1<br>
+enable GL_CLIP_PLANE2<br>
+enable GL_CLIP_PLANE3<br>
+disable GL_CLIP_PLANE4<br>
+disable GL_CLIP_PLANE5<br>
+clear<br>
+draw rect -1 -1 2 2<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0) # clipped by plane 0<br>
+relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 1<br>
+relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 2<br>
+relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0) # clipped by plane 3<br>
+relative probe rgba (0.2, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 4<br>
+relative probe rgba (0.2, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 5<br>
+<br>
+# Test with planes 4 and 5 enabled.<br>
+disable GL_CLIP_PLANE0<br>
+disable GL_CLIP_PLANE1<br>
+disable GL_CLIP_PLANE2<br>
+disable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+enable GL_CLIP_PLANE5<br>
+clear<br>
+draw rect -1 -1 2 2<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.5, 0.2) (1.0, 1.0, 1.0, 1.0) # clipped by plane 0<br>
+relative probe rgba (0.8, 0.3) (1.0, 1.0, 1.0, 1.0) # clipped by plane 1<br>
+relative probe rgba (0.8, 0.7) (1.0, 1.0, 1.0, 1.0) # clipped by plane 2<br>
+relative probe rgba (0.5, 0.8) (1.0, 1.0, 1.0, 1.0) # clipped by plane 3<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0) # clipped by plane 4<br>
+relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0) # clipped by plane 5<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>equal-to-position.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>equal-to-position.shader_test<br>
new file mode 100644<br>
index 000000000..7e05c7e72<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>equal-to-position.shader_test<br>
@@ -0,0 +1,85 @@<br>
+# [description]<br>
+# Use all 6 clip planes to clip a rectangle to a hexagon shape.<br>
+#<br>
+# In this test, gl_Position and gl_ClipVertex are the same.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 150 compatibility<br>
+<br>
+out gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+};<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;<br>
+<br>
+       gl_ClipVertex = gl_Position;<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+in gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+} gl_in[];<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = gl_in[i].gl_ClipVertex;<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1, 1, 1, 1);<br>
+}<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+ortho 0 1 0 1<br>
+clip plane 0 0 1 0 0.5<br>
+clip plane 1 -1 1 0 0.8<br>
+clip plane 2 -1 -1 0 0.8<br>
+clip plane 3 0 -1 0 0.5<br>
+clip plane 4 1 -1 0 0.8<br>
+clip plane 5 1 1 0 0.8<br>
+enable GL_CLIP_PLANE0<br>
+enable GL_CLIP_PLANE1<br>
+enable GL_CLIP_PLANE2<br>
+enable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+enable GL_CLIP_PLANE5<br>
+draw rect 0.1 0.1 0.8 0.8<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>homogeneity.shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>homogeneity.shader_test<br>
new file mode 100644<br>
index 000000000..a9ef08100<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>homogeneity.shader_test<br>
@@ -0,0 +1,97 @@<br>
+# This test verifies that the homogeneous coordinate of gl_ClipVertex<br>
+# is properly respected, by doubling all the coordinates of<br>
+# gl_ClipVertex (including the homogeneous coordinate) and verifying<br>
+# that the clipped shape is still correct.<br>
+#<br>
+# In addition, this test:<br>
+# - uses all 6 clip planes to clip a rectangle to a hexagon shape.<br>
+# - sets gl_Position and gl_ClipVertex to different values, to verify<br>
+#   that gl_Position determines screen position and gl_ClipVertex<br>
+#   determines clipping.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 150 compatibility<br>
+<br>
+out gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+};<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;<br>
+<br>
+       // Transform gl_ClipVertex in an arbitrary way so that<br>
+       // we can verify it is being used for clipping instead of<br>
+       // gl_Position.  The x and y coordinates are multiplied by 5,<br>
+       // and the homogeneous coordinate is multiplied by 0.5, so the<br>
+       // net result should be that x and y are scaled by a factor of<br>
+       // 10.<br>
+       gl_ClipVertex = gl_Vertex * vec4(5.0, 5.0, 1.0, 0.5);<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+in gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+} gl_in[];<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = gl_in[i].gl_ClipVertex;<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1, 1, 1, 1);<br>
+}<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+ortho 0 1 0 1<br>
+clip plane 0 0 1 0 -2.5<br>
+clip plane 1 -1 1 0 4<br>
+clip plane 2 -1 -1 0 14<br>
+clip plane 3 0 -1 0 7.5<br>
+clip plane 4 1 -1 0 4<br>
+clip plane 5 1 1 0 -6<br>
+enable GL_CLIP_PLANE0<br>
+enable GL_CLIP_PLANE1<br>
+enable GL_CLIP_PLANE2<br>
+enable GL_CLIP_PLANE3<br>
+enable GL_CLIP_PLANE4<br>
+enable GL_CLIP_PLANE5<br>
+draw rect 0.1 0.1 0.8 0.8<br>
+<br>
+# Test points inside each hexagon edge<br>
+relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.3) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.4) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.7, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.5, 0.7) (1.0, 1.0, 1.0, 1.0)<br>
+relative probe rgba (0.3, 0.6) (1.0, 1.0, 1.0, 1.0)<br>
+<br>
+# Test points outside each hexagon edge<br>
+relative probe rgba (0.2, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.2) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.3) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.8, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.5, 0.8) (0.0, 0.0, 0.0, 0.0)<br>
+relative probe rgba (0.2, 0.7) (0.0, 0.0, 0.0, 0.0)<br>
diff --git a/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>primitives-triangle-strip.<wbr>shader_test b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>primitives-triangle-strip.<wbr>shader_test<br>
new file mode 100644<br>
index 000000000..e57387018<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/<wbr>execution/compatibility/<wbr>clipping/vs-gs-clip-vertex-<wbr>primitives-triangle-strip.<wbr>shader_test<br>
@@ -0,0 +1,83 @@<br>
+# Verify that gl_ClipVertex affects different primitive types correctly.<br>
+<br>
+[require]<br>
+GL COMPAT >= 3.2<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 150 compatibility<br>
+<br>
+out gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+};<br>
+<br>
+attribute vec2 in_pos;<br>
+<br>
+uniform vec2 u_offset;<br>
+uniform float u_clipdist;<br>
+<br>
+void main(void)<br>
+{<br>
+       gl_Position = gl_ModelViewProjectionMatrix * vec4(u_offset + in_pos, 0, 1);<br>
+<br>
+       gl_ClipVertex = vec4(u_clipdist, 0.0, 0.0, 0.0);<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150 compatibility<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+in gl_PerVertex {<br>
+       vec4 gl_Position;<br>
+       vec4 gl_ClipVertex;<br>
+} gl_in[];<br>
+<br>
+void main()<br>
+{<br>
+       for (int i = 0; i < 3; i++) {<br>
+               gl_Position = gl_in[i].gl_Position;<br>
+               gl_ClipVertex = gl_in[i].gl_ClipVertex;<br>
+<br>
+               EmitVertex();<br>
+       }<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 120<br>
+void main(void)<br>
+{<br>
+       gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);<br>
+}<br>
+<br>
+[vertex data]<br>
+in_pos/float/2<br>
+ 0  0<br>
+10  0<br>
+ 0 10<br>
+10 10<br>
+<br>
+[test]<br>
+clear color 0.0 0.0 0.0 0.0<br>
+clear<br>
+<br>
+clip plane 0 1.0 0.0 0.0 0.0 # accept points where gl_ClipVertex.x >= 0<br>
+enable GL_CLIP_PLANE0<br>
+<br>
+ortho<br>
+<br>
+# Test that primitives are clipped with a negative distance<br>
+uniform float u_clipdist -1<br>
+<br>
+uniform vec2 u_offset 40 0<br>
+draw arrays GL_TRIANGLE_STRIP 0 4<br>
+probe rect rgba (40, 0, 20, 20) (0, 0, 0, 0)<br>
+<br>
+# Test that primitives are not clipped with zero distance<br>
+uniform float u_clipdist 0<br>
+<br>
+uniform vec2 u_offset 40 20<br>
+draw arrays GL_TRIANGLE_STRIP 0 4<br>
+probe rect rgba (40, 20, 10, 10) (1, 0, 0, 1)<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.17.0<br>
<br>
______________________________<wbr>_________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/piglit" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div>