[Piglit] [PATCH 4/9] arb_tessellation_shader: test gl_TessLevelOuter and gl_TessLevelInner TES inputs
Marek Olšák
maraeo at gmail.com
Tue Jun 16 13:57:37 PDT 2015
From: Marek Olšák <marek.olsak at amd.com>
---
...-tcs-tes-tessinner-tessouter-inputs.shader_test | 64 ++++++++++++++++++++++
.../vs-tes-tessinner-tessouter-inputs.shader_test | 55 +++++++++++++++++++
2 files changed, 119 insertions(+)
create mode 100644 tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs.shader_test
create 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-tcs-tes-tessinner-tessouter-inputs.shader_test b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs.shader_test
new file mode 100644
index 0000000..e389c65
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs.shader_test
@@ -0,0 +1,64 @@
+[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
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
new file mode 100644
index 0000000..33be891
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs.shader_test
@@ -0,0 +1,55 @@
+[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.1.0
More information about the Piglit
mailing list