[Piglit] [PATCH] Replace vs-tcs-tes-tessinner-tessouter-inputs with two new tests.
Kenneth Graunke
kenneth at whitecape.org
Wed Oct 21 00:22:23 PDT 2015
vs-tcs-tes-tessinner-tessouter-inputs tried to verify that all vector
components written by the TCS were present in the TES. However, this
is not guaranteed. According to the ARB_tessellation_shader spec:
"Tessellation Evaluation Shader Inputs
[...]
For triangular tessellation, gl_TessLevelOuter[3] and gl_TessLevelInner[1]
will be undefined. For isoline tessellation, gl_TessLevelOuter[2],
gl_TessLevelOuter[3], and both values in gl_TessLevelInner[] are undefined."
This patch removes the broken test, and replaces it with two new ones.
One uses quads, and probes all 4/2 components. The other uses
triangles, but only probes the 3/1 components that are actually defined.
Testing both types of domains is especially useful for i965, which
stores the data in different layouts depending on the domain.
According to Ilia Mirkin, these both pass on nvc0.
Cc: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: Marek Olšák <maraeo at gmail.com>
---
...es-tessinner-tessouter-inputs-quads.shader_test | 52 +++++++++++++++++
...tes-tessinner-tessouter-inputs-tris.shader_test | 66 ++++++++++++++++++++++
...-tcs-tes-tessinner-tessouter-inputs.shader_test | 64 ---------------------
3 files changed, 118 insertions(+), 64 deletions(-)
create mode 100644 tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads.shader_test
create mode 100644 tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris.shader_test
delete mode 100644 tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs.shader_test
diff --git a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads.shader_test
new file mode 100644
index 0000000..b2c03a6
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads.shader_test
@@ -0,0 +1,52 @@
+[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 = 1) out;
+
+void main() {
+ gl_TessLevelOuter = float[4](3.0, 2.0, 4.0, 5.0);
+ gl_TessLevelInner = float[2](6.0, 7.0);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(quads) in;
+
+out vec4 color;
+
+void main() {
+ gl_Position = vec4(gl_TessCoord.xy * 2 - 1, 0, 1);
+ color = gl_TessLevelOuter == float[4](3.0, 2.0, 4.0, 5.0) &&
+ gl_TessLevelInner == float[2](6.0, 7.0) ?
+ vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+
+[fragment shader]
+in vec4 color;
+
+void main()
+{
+ gl_FragColor = color;
+}
+
+[test]
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 1
+draw arrays GL_PATCHES 0 1
+probe all rgba 0.0 1.0 0.0 1.0
diff --git a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris.shader_test
new file mode 100644
index 0000000..3a75b36
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris.shader_test
@@ -0,0 +1,66 @@
+[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](3.0, 2.0, 4.0, 5.0);
+ gl_TessLevelInner = float[2](6.0, 7.0);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(triangles) in;
+
+out vec4 color;
+
+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 = gl_TessLevelOuter[0] == 3.0 &&
+ gl_TessLevelOuter[1] == 2.0 &&
+ gl_TessLevelOuter[2] == 4.0 &&
+ gl_TessLevelInner[0] == 6.0 ?
+ vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+
+[fragment shader]
+in vec4 color;
+
+void main()
+{
+ gl_FragColor = color;
+}
+
+[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]
+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
diff --git a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs.shader_test
deleted file mode 100644
index e389c65..0000000
--- a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs.shader_test
+++ /dev/null
@@ -1,64 +0,0 @@
-[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](3.0, 2.0, 4.0, 5.0);
- gl_TessLevelInner = float[2](6.0, 7.0);
-}
-
-
-[tessellation evaluation shader]
-#extension GL_ARB_tessellation_shader: require
-layout(triangles) in;
-
-out vec4 color;
-
-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 = gl_TessLevelOuter == float[4](3.0, 2.0, 4.0, 5.0) &&
- gl_TessLevelInner == float[2](6.0, 7.0) ?
- vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
-}
-
-
-[fragment shader]
-in vec4 color;
-
-void main()
-{
- gl_FragColor = color;
-}
-
-[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]
-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.6.1
More information about the Piglit
mailing list