[Piglit] [PATCH] glsl-1.50: add tests to verify that clip distance in VS doesn't mess up GS

Ilia Mirkin imirkin at alum.mit.edu
Fri Aug 19 20:23:59 UTC 2016


This includes both SSO and non-SSO versions of the same test, as they
can end up hitting slightly different code paths.

Note: this presently fails on all intel generations

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 .../clip-distance-vs-gs-out-sso.shader_test        | 54 ++++++++++++++++++++++
 .../geometry/clip-distance-vs-gs-out.shader_test   | 53 +++++++++++++++++++++
 2 files changed, 107 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/execution/geometry/clip-distance-vs-gs-out-sso.shader_test
 create mode 100644 tests/spec/glsl-1.50/execution/geometry/clip-distance-vs-gs-out.shader_test

diff --git a/tests/spec/glsl-1.50/execution/geometry/clip-distance-vs-gs-out-sso.shader_test b/tests/spec/glsl-1.50/execution/geometry/clip-distance-vs-gs-out-sso.shader_test
new file mode 100644
index 0000000..f59104a
--- /dev/null
+++ b/tests/spec/glsl-1.50/execution/geometry/clip-distance-vs-gs-out-sso.shader_test
@@ -0,0 +1,54 @@
+# Verifies that a clip distance output in VS does not mess things up for GS
+# in the presence of user varyings. In this case, no clip planes are enabled,
+# and GS doesn't output any clip distances either.
+
+[require]
+GLSL >= 1.50
+SSO ENABLED
+
+[vertex shader]
+#version 150
+
+in vec4 piglit_vertex;
+out vec4 color;
+
+void main() {
+  gl_ClipDistance[0] = 1.0;
+  gl_Position = piglit_vertex;
+  color = vec4(0, 1, 0, 1);
+}
+
+[geometry shader]
+#version 150
+
+layout (triangles) in;
+layout (triangle_strip, max_vertices = 3) out;
+
+in vec4 color[];
+out vec4 c;
+
+void main() {
+  int i;
+  for (i = 0; i < 3; i++) {
+    gl_Position = gl_in[i].gl_Position;
+    c = color[i];
+    EmitVertex();
+  }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 c;
+out vec4 color;
+
+void main() {
+  color = c;
+}
+
+[test]
+clear color 0.2 0.2 0.2 0.2
+clear
+
+draw rect -1 -1 2 2
+probe all rgba 0 1 0 1
diff --git a/tests/spec/glsl-1.50/execution/geometry/clip-distance-vs-gs-out.shader_test b/tests/spec/glsl-1.50/execution/geometry/clip-distance-vs-gs-out.shader_test
new file mode 100644
index 0000000..f19b19a
--- /dev/null
+++ b/tests/spec/glsl-1.50/execution/geometry/clip-distance-vs-gs-out.shader_test
@@ -0,0 +1,53 @@
+# Verifies that a clip distance output in VS does not mess things up for GS
+# in the presence of user varyings. In this case, no clip planes are enabled,
+# and GS doesn't output any clip distances either.
+
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 piglit_vertex;
+out vec4 color;
+
+void main() {
+  gl_ClipDistance[0] = 1.0;
+  gl_Position = piglit_vertex;
+  color = vec4(0, 1, 0, 1);
+}
+
+[geometry shader]
+#version 150
+
+layout (triangles) in;
+layout (triangle_strip, max_vertices = 3) out;
+
+in vec4 color[];
+out vec4 c;
+
+void main() {
+  int i;
+  for (i = 0; i < 3; i++) {
+    gl_Position = gl_in[i].gl_Position;
+    c = color[i];
+    EmitVertex();
+  }
+}
+
+[fragment shader]
+#version 150
+
+in vec4 c;
+out vec4 color;
+
+void main() {
+  color = c;
+}
+
+[test]
+clear color 0.2 0.2 0.2 0.2
+clear
+
+draw rect -1 -1 2 2
+probe all rgba 0 1 0 1
-- 
2.7.3



More information about the Piglit mailing list