[Piglit] [PATCH 1/3] arb_tessellation_shader/execution/tcs-tes-patch-array: new test for patch array

Marek Olšák maraeo at gmail.com
Thu Oct 16 01:41:24 PDT 2014


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

This verifies that assigned locations are correct for arrays.
---

BTW, the second patch depends on chrisf's patches.

 .../execution/tcs-tes-patch-array.shader_test      | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 tests/spec/arb_tessellation_shader/execution/tcs-tes-patch-array.shader_test

diff --git a/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch-array.shader_test b/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch-array.shader_test
new file mode 100644
index 0000000..ffe25aa
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch-array.shader_test
@@ -0,0 +1,59 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[vertex shader passthrough]
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+layout(vertices = 3) out;
+
+patch out vec4 color[3];
+
+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);
+	color[0] = vec4(0, 0.3, 0, 1);
+	color[2] = vec4(0, 0.7, 0, 1);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(triangles) in;
+
+patch in vec4 color[3];
+out vec4 color_fs;
+
+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];
+
+	color_fs = color[0] + color[2];
+}
+
+
+[fragment shader]
+in vec4 color_fs;
+
+void main()
+{
+	gl_FragColor = color_fs;
+}
+
+[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 vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
-- 
1.9.1



More information about the Piglit mailing list