[Piglit] [PATCH] Replace vs-tes-tessinner-tessouter-inputs with two new tests.
Kenneth Graunke
kenneth at whitecape.org
Thu Dec 17 12:06:39 PST 2015
(This is commit 42587e6d4bc8dd79be02b for the !TCS case.)
vs-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.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: Marek Olšák <marek.olsak at amd.com>
---
...es-tessinner-tessouter-inputs-quads.shader_test | 53 ++++++++++++++++++++
...tes-tessinner-tessouter-inputs-tris.shader_test | 57 ++++++++++++++++++++++
.../vs-tes-tessinner-tessouter-inputs.shader_test | 55 ---------------------
3 files changed, 110 insertions(+), 55 deletions(-)
create mode 100644 tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-quads.shader_test
create mode 100644 tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-tris.shader_test
delete mode 100644 tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs.shader_test
diff --git a/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-quads.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-quads.shader_test
new file mode 100644
index 0000000..67d5245
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-quads.shader_test
@@ -0,0 +1,53 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+ gl_Position = vertex;
+}
+
+
+[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](2.0, 4.0, 7.0, 6.0) &&
+ gl_TessLevelInner == float[2](5.0, 3.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 1
+patch parameter default level outer 2 4 7 6
+patch parameter default level inner 5 3
+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-tes-tessinner-tessouter-inputs-tris.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-tris.shader_test
new file mode 100644
index 0000000..bca8404
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-tris.shader_test
@@ -0,0 +1,57 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+ gl_Position = vertex;
+}
+
+
+[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] == 2.0 &&
+ gl_TessLevelOuter[1] == 4.0 &&
+ gl_TessLevelOuter[2] == 7.0 &&
+ gl_TessLevelInner[0] == 5.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
+patch parameter default level outer 2 4 7 6
+patch parameter default level inner 5 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-tes-tessinner-tessouter-inputs.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs.shader_test
deleted file mode 100644
index 33be891..0000000
--- a/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs.shader_test
+++ /dev/null
@@ -1,55 +0,0 @@
-[require]
-GLSL >= 1.50
-GL_ARB_tessellation_shader
-
-
-[vertex shader]
-in vec4 vertex;
-
-void main()
-{
- gl_Position = vertex;
-}
-
-
-[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](2.0, 4.0, 7.0, 6.0) &&
- gl_TessLevelInner == float[2](5.0, 3.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
-patch parameter default level outer 2 4 7 6
-patch parameter default level inner 5 3
-draw arrays GL_PATCHES 0 6
-probe all rgba 0.0 1.0 0.0 1.0
--
2.6.3
More information about the Piglit
mailing list