[Piglit] [PATCH 5/6] arb_tessellation_shader: add 3 new trivial tess+gs tests

Marek Olšák maraeo at gmail.com
Sun Apr 30 14:58:38 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 .../execution/trivial-tess-gs.shader_test          | 56 ++++++++++++++++++
 .../trivial-tess-gs_no-gs-inputs.shader_test       | 60 +++++++++++++++++++
 .../trivial-tess-gs_no-tes-inputs.shader_test      | 67 ++++++++++++++++++++++
 3 files changed, 183 insertions(+)
 create mode 100644 tests/spec/arb_tessellation_shader/execution/trivial-tess-gs.shader_test
 create mode 100644 tests/spec/arb_tessellation_shader/execution/trivial-tess-gs_no-gs-inputs.shader_test
 create mode 100644 tests/spec/arb_tessellation_shader/execution/trivial-tess-gs_no-tes-inputs.shader_test

diff --git a/tests/spec/arb_tessellation_shader/execution/trivial-tess-gs.shader_test b/tests/spec/arb_tessellation_shader/execution/trivial-tess-gs.shader_test
new file mode 100644
index 0000000..25437d3
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/trivial-tess-gs.shader_test
@@ -0,0 +1,56 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+[vertex shader passthrough]
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader : require
+layout(triangles) in;
+out vec2 pos;
+
+void main() {
+	pos =	gl_in[0].gl_Position.xy * gl_TessCoord[0] +
+		gl_in[1].gl_Position.xy * gl_TessCoord[1] +
+		gl_in[2].gl_Position.xy * gl_TessCoord[2];
+}
+
+[geometry shader]
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+in vec2 pos[3];
+
+void main() {
+	gl_Position = vec4(pos[0], 0, 1);
+	EmitVertex();
+	gl_Position = vec4(pos[1], 0, 1);
+	EmitVertex();
+	gl_Position = vec4(pos[2], 0, 1);
+	EmitVertex();
+}
+
+[fragment shader]
+
+void main()
+{
+	gl_FragColor = vec4(0, 1, 0, 0);
+}
+
+[vertex data]
+piglit_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 default level outer 1 1 1 1
+patch parameter default level inner 1 1
+
+clear color 0.5 0.5 0.5 1.0
+clear
+patch parameter vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0 1 0 0
diff --git a/tests/spec/arb_tessellation_shader/execution/trivial-tess-gs_no-gs-inputs.shader_test b/tests/spec/arb_tessellation_shader/execution/trivial-tess-gs_no-gs-inputs.shader_test
new file mode 100644
index 0000000..2a2a348
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/trivial-tess-gs_no-gs-inputs.shader_test
@@ -0,0 +1,60 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+[vertex shader passthrough]
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader : require
+layout(triangles) in;
+
+void main() {
+}
+
+[geometry shader]
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+void main() {
+	if (gl_PrimitiveIDIn == 0) {
+		gl_Position = vec4(-1, -1, 0, 1);
+		EmitVertex();
+		gl_Position = vec4( 1, -1, 0, 1);
+		EmitVertex();
+		gl_Position = vec4(-1,  1, 0, 1);
+		EmitVertex();
+	} else {
+		gl_Position = vec4(-1,  1, 0, 1);
+		EmitVertex();
+		gl_Position = vec4( 1, -1, 0, 1);
+		EmitVertex();
+		gl_Position = vec4( 1,  1, 0, 1);
+		EmitVertex();
+	}
+}
+
+[fragment shader]
+
+void main()
+{
+	gl_FragColor = vec4(0, 1, 0, 0);
+}
+
+[vertex data]
+piglit_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 default level outer 1 1 1 1
+patch parameter default level inner 1 1
+
+clear color 0.5 0.5 0.5 1.0
+clear
+patch parameter vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0 1 0 0
diff --git a/tests/spec/arb_tessellation_shader/execution/trivial-tess-gs_no-tes-inputs.shader_test b/tests/spec/arb_tessellation_shader/execution/trivial-tess-gs_no-tes-inputs.shader_test
new file mode 100644
index 0000000..60e825b
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/trivial-tess-gs_no-tes-inputs.shader_test
@@ -0,0 +1,67 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+[vertex shader passthrough]
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader : require
+layout(triangles) in;
+out vec2 pos;
+
+void main() {
+	vec2 tpos[3];
+
+	if (gl_PrimitiveID == 0) {
+		tpos[0] = vec2(-1, -1);
+		tpos[1] = vec2( 1, -1);
+		tpos[2] = vec2(-1,  1);
+	} else {
+		tpos[0] = vec2(-1,  1);
+		tpos[1] = vec2( 1, -1);
+		tpos[2] = vec2( 1,  1);
+	}
+	pos =	tpos[0] * gl_TessCoord[0] +
+		tpos[1] * gl_TessCoord[1] +
+		tpos[2] * gl_TessCoord[2];
+}
+
+[geometry shader]
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+in vec2 pos[3];
+
+void main() {
+	gl_Position = vec4(pos[0], 0, 1);
+	EmitVertex();
+	gl_Position = vec4(pos[1], 0, 1);
+	EmitVertex();
+	gl_Position = vec4(pos[2], 0, 1);
+	EmitVertex();
+}
+
+[fragment shader]
+
+void main()
+{
+	gl_FragColor = vec4(0, 1, 0, 0);
+}
+
+[vertex data]
+piglit_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 default level outer 16 16 16 16
+patch parameter default level inner 16 16
+
+clear color 0.5 0.5 0.5 1.0
+clear
+patch parameter vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0 1 0 0
-- 
2.7.4



More information about the Piglit mailing list