[Piglit] [PATCH] arb_tessellation_shader: add simple data passing tests

Ilia Mirkin imirkin at alum.mit.edu
Fri Aug 22 21:59:55 PDT 2014


---

not sure whether these duplicate other tests, but they're simple.

 .../execution/tcs-tes-patch.shader_test            | 65 ++++++++++++++++++++
 .../execution/tcs-tes-vertex.shader_test           | 67 +++++++++++++++++++++
 .../execution/tes-fs.shader_test                   | 61 +++++++++++++++++++
 .../execution/vs-tcs-tes-vertex.shader_test        | 70 ++++++++++++++++++++++
 4 files changed, 263 insertions(+)
 create mode 100644 tests/spec/arb_tessellation_shader/execution/tcs-tes-patch.shader_test
 create mode 100644 tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex.shader_test
 create mode 100644 tests/spec/arb_tessellation_shader/execution/tes-fs.shader_test
 create mode 100644 tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-vertex.shader_test

diff --git a/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch.shader_test b/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch.shader_test
new file mode 100644
index 0000000..a62799d
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/tcs-tes-patch.shader_test
@@ -0,0 +1,65 @@
+[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;
+
+patch out vec4 color;
+
+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 = vec4(0, 1, 0, 1);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(triangles) in;
+
+patch in vec4 color;
+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;
+}
+
+
+[fragment shader]
+in vec4 color_fs;
+
+void main()
+{
+	gl_FragColor = color_fs;
+}
+
+[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
diff --git a/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex.shader_test b/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex.shader_test
new file mode 100644
index 0000000..e082109
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/tcs-tes-vertex.shader_test
@@ -0,0 +1,67 @@
+[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;
+
+out vec4 color[];
+
+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[gl_InvocationID] = vec4(0, 1, 0, 1);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(triangles) in;
+
+in vec4 color[];
+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] * gl_TessCoord[0]
+	           + color[1] * gl_TessCoord[1]
+	           + color[2] * gl_TessCoord[2];
+}
+
+
+[fragment shader]
+in vec4 color_fs;
+
+void main()
+{
+	gl_FragColor = color_fs;
+}
+
+[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
diff --git a/tests/spec/arb_tessellation_shader/execution/tes-fs.shader_test b/tests/spec/arb_tessellation_shader/execution/tes-fs.shader_test
new file mode 100644
index 0000000..e50af28
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/tes-fs.shader_test
@@ -0,0 +1,61 @@
+[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;
+
+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 = vec4(0, 1, 0, 1);
+}
+
+
+[fragment shader]
+in vec4 color_fs;
+
+void main()
+{
+	gl_FragColor = color_fs;
+}
+
+[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
diff --git a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-vertex.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-vertex.shader_test
new file mode 100644
index 0000000..550ff25
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-vertex.shader_test
@@ -0,0 +1,70 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[vertex shader]
+in vec4 vertex;
+out vec4 color;
+
+void main()
+{
+	gl_Position = vertex;
+	color = vec4(0, 1, 0, 1);
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+layout(vertices = 3) out;
+
+in vec4 color[];
+out vec4 color_tes[];
+
+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_tes[gl_InvocationID] = color[gl_InvocationID];
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(triangles) in;
+
+in vec4 color_tes[];
+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_tes[0] * gl_TessCoord[0]
+	           + color_tes[1] * gl_TessCoord[1]
+	           + color_tes[2] * gl_TessCoord[2];
+}
+
+
+[fragment shader]
+in vec4 color_fs;
+
+void main()
+{
+	gl_FragColor = color_fs;
+}
+
+[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
-- 
1.8.5.5



More information about the Piglit mailing list