[Piglit] [PATCH] arb_arrays_of_arrays: add simple execution test for tessellation

Timothy Arceri t_arceri at yahoo.com.au
Tue Aug 11 18:22:17 PDT 2015


This test is a copy of tcs-tes-patch-array.shader_test extended for
arrays of arrays.
---
 .../tessellation/tcs-tes-patch.shader_test         | 65 ++++++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 tests/spec/arb_arrays_of_arrays/execution/tessellation/tcs-tes-patch.shader_test

diff --git a/tests/spec/arb_arrays_of_arrays/execution/tessellation/tcs-tes-patch.shader_test b/tests/spec/arb_arrays_of_arrays/execution/tessellation/tcs-tes-patch.shader_test
new file mode 100644
index 0000000..57582bb
--- /dev/null
+++ b/tests/spec/arb_arrays_of_arrays/execution/tessellation/tcs-tes-patch.shader_test
@@ -0,0 +1,65 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+GL_ARB_arrays_of_arrays
+
+[vertex shader passthrough]
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_arrays_of_arrays: require
+layout(vertices = 3) out;
+
+patch out vec4 color[3][2];
+
+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][1] = vec4(0, 0.1, 0, 1);
+	color[1][0] = vec4(0, 0.5, 0, 1);
+	color[2][0] = vec4(0, 0.2, 0, 1);
+	color[2][1] = vec4(0, 0.2, 0, 1);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+#extension GL_ARB_arrays_of_arrays: require
+layout(triangles) in;
+
+patch in vec4 color[3][2];
+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][1] + color[2][0] + color[2][1] + color[1][0];
+}
+
+
+[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]
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.4.3



More information about the Piglit mailing list