[Piglit] [PATCH 15/15] arb_tessellation_shader: Negative test linking without vertex shader.

Fabian Bieler fabianbieler at fastmail.fm
Mon Mar 24 15:02:54 PDT 2014


>From the ARB_tessellation_shader spec (Section 2.14.2):

   Linking will fail if the program object contains objects to form a
   tessellation control shader (see section 2.X.1), and

     * the program contains no objects to form a vertex shader;

>From the ARB_tessellation_shader spec (Section 2.14.2):

   Linking will fail if the program object contains objects to form a
   tessellation evaluation shader (see section 2.X.3), and

     * the program contains no objects to form a vertex shader;

Signed-off-by: Fabian Bieler <fabianbieler at fastmail.fm>
---
 tests/all.py                                       |  2 +-
 .../linker/no-vs.shader_test                       | 47 ++++++++++++++++++++++
 .../linker/tcs-no-vs.shader_test                   | 33 +++++++++++++++
 .../linker/tes-no-vs.shader_test                   | 30 ++++++++++++++
 4 files changed, 111 insertions(+), 1 deletion(-)
 create mode 100644 tests/spec/arb_tessellation_shader/linker/no-vs.shader_test
 create mode 100644 tests/spec/arb_tessellation_shader/linker/tcs-no-vs.shader_test
 create mode 100644 tests/spec/arb_tessellation_shader/linker/tes-no-vs.shader_test

diff --git a/tests/all.py b/tests/all.py
index 580e648..8d24751 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1446,7 +1446,7 @@ add_concurrent_test(arb_tessellation_shader, 'arb_tessellation_shader-invalid-pa
 add_concurrent_test(arb_tessellation_shader, 'arb_tessellation_shader-invalid-primitive')
 import_glsl_parser_tests(arb_tessellation_shader,
                          os.path.join(testsDir, 'spec',
-                         'arb_tessellation_shader'), ['compiler'])
+                         'arb_tessellation_shader'), ['compiler', 'linker'])
 
 # Group ARB_texture_multisample
 samplers_atm = ['sampler2DMS', 'isampler2DMS', 'usampler2DMS',
diff --git a/tests/spec/arb_tessellation_shader/linker/no-vs.shader_test b/tests/spec/arb_tessellation_shader/linker/no-vs.shader_test
new file mode 100644
index 0000000..c0cf17b
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/linker/no-vs.shader_test
@@ -0,0 +1,47 @@
+# From the ARB_tessellation_shader spec (Section 2.14.2):
+#
+#   Linking will fail if the program object contains objects to form a
+#   tessellation control shader (see section 2.X.1), and
+#
+#     * the program contains no objects to form a vertex shader;
+#
+# From the ARB_tessellation_shader spec (Section 2.14.2):
+#
+#   Linking will fail if the program object contains objects to form a
+#   tessellation evaluation shader (see section 2.X.3), and
+#
+#     * the program contains no objects to form a vertex shader;
+#
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+layout(vertices = 3) out;
+
+void main() {
+	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;
+
+void main() {
+	gl_Position = vec4(0);
+}
+
+
+[fragment shader]
+void main()
+{
+	gl_FragColor = vec4(0);
+}
+
+
+[test]
+link error
diff --git a/tests/spec/arb_tessellation_shader/linker/tcs-no-vs.shader_test b/tests/spec/arb_tessellation_shader/linker/tcs-no-vs.shader_test
new file mode 100644
index 0000000..13311af
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/linker/tcs-no-vs.shader_test
@@ -0,0 +1,33 @@
+# From the ARB_tessellation_shader spec (Section 2.14.2):
+#
+#   Linking will fail if the program object contains objects to form a
+#   tessellation control shader (see section 2.X.1), and
+#
+#     * the program contains no objects to form a vertex shader;
+#
+
+
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+layout(vertices = 3) out;
+
+void main() {
+	gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 0.0);
+	gl_TessLevelInner = float[2](0.0, 0.0);
+}
+
+
+[fragment shader]
+void main()
+{
+	gl_FragColor = vec4(0);
+}
+
+
+[test]
+link error
diff --git a/tests/spec/arb_tessellation_shader/linker/tes-no-vs.shader_test b/tests/spec/arb_tessellation_shader/linker/tes-no-vs.shader_test
new file mode 100644
index 0000000..f7ab0a2
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/linker/tes-no-vs.shader_test
@@ -0,0 +1,30 @@
+# From the ARB_tessellation_shader spec (Section 2.14.2):
+#
+#   Linking will fail if the program object contains objects to form a
+#   tessellation evaluation shader (see section 2.X.3), and
+#
+#     * the program contains no objects to form a vertex shader;
+#
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(triangles) in;
+
+void main() {
+	gl_Position = vec4(0);
+}
+
+
+[fragment shader]
+void main()
+{
+	gl_FragColor = vec4(0);
+}
+
+
+[test]
+link error
-- 
1.8.3.2



More information about the Piglit mailing list