[Piglit] [PATCH 13/18] arb_geometry_shader4: Test geometry shader that doesn't generate any primitives.

Fabian Bieler fabianbieler at fastmail.fm
Mon Jun 10 15:26:50 PDT 2013


---
 .../execution/generate-zero-primitives.shader_test | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 tests/spec/arb_geometry_shader4/execution/generate-zero-primitives.shader_test

diff --git a/tests/spec/arb_geometry_shader4/execution/generate-zero-primitives.shader_test b/tests/spec/arb_geometry_shader4/execution/generate-zero-primitives.shader_test
new file mode 100644
index 0000000..d6d5b5b
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/execution/generate-zero-primitives.shader_test
@@ -0,0 +1,55 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+GL_ARB_geometry_shader4
+
+[vertex shader]
+#version 110
+
+attribute vec4 vertex;
+
+void main()
+{
+	gl_Position = vertex;
+}
+
+[geometry shader]
+#version 110
+#extension GL_ARB_geometry_shader4: enable
+
+void main()
+{
+	int minus_one = -1;
+	for (int i = 0; i < 3; i++) {
+		minus_one += int(gl_PositionIn[i].x + gl_PositionIn[i].y);
+	}
+	/* minus_one should still be -1. */
+	for (int i = 0; i < minus_one; i++) {
+		gl_Position = gl_PositionIn[i];
+		EmitVertex();
+	}
+}
+
+[geometry layout]
+input type GL_TRIANGLES
+output type GL_TRIANGLE_STRIP
+vertices out 3
+
+[fragment shader]
+#version 110
+
+void main()
+{
+	gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+ 1.0  1.0
+-1.0  1.0
+
+[test]
+draw arrays GL_TRIANGLE_FAN 0 4
+probe all rgb 0.0 0.0 0.0
-- 
1.8.1.2



More information about the Piglit mailing list