[Piglit] [PATCH 01/12] arb_tessellation_shader: Add sanity shader_runner test.

Chris Forbes chrisf at ijw.co.nz
Wed Sep 17 00:42:14 PDT 2014


From: Fabian Bieler <fabianbieler at fastmail.fm>

Add test that should tessellate two 3-vertex-patches into one triangle each
to fill the screen.

The test should effectively bahave as if the vertex data was used to draw
GL_TRIANGLES without the tessellation stage.

Note [Chris]: This is partially redundant with nop.shader_test, but the
approach in the tessellation evaluation shader is more normal (weighted
sum of vertices) so both are useful.

Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>
---
 .../execution/sanity.shader_test                   | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 tests/spec/arb_tessellation_shader/execution/sanity.shader_test

diff --git a/tests/spec/arb_tessellation_shader/execution/sanity.shader_test b/tests/spec/arb_tessellation_shader/execution/sanity.shader_test
new file mode 100644
index 0000000..2f7bd5c
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/sanity.shader_test
@@ -0,0 +1,55 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+	gl_Position = vertex;
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+layout(vertices = 3) out;
+
+void main() {
+	gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
+	gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0);
+	gl_TessLevelInner = float[2](0.0, 0.0);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(triangles) in;
+
+void main() {
+	gl_Position = gl_in[0].gl_Position * gl_TessCoord[0]
+	            + gl_in[1].gl_Position * gl_TessCoord[1]
+	            + gl_in[2].gl_Position * gl_TessCoord[2];
+}
+
+
+[fragment shader]
+void main()
+{
+	gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+-1.0  1.0
+-1.0  1.0
+ 1.0 -1.0
+ 1.0  1.0
+
+[test]
+patch parameter vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.1.0



More information about the Piglit mailing list