[Piglit] [PATCH 05/14] Test that in general, interface blocks cannot be redeclared.

Paul Berry stereotype441 at gmail.com
Wed Oct 2 16:45:33 PDT 2013


---
 ...face-block-redeclared-different-block-name.vert | 36 ++++++++++++++++++++++
 ...interface-block-redeclared-same-block-name.vert | 36 ++++++++++++++++++++++
 2 files changed, 72 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/named-interface-block-redeclared-different-block-name.vert
 create mode 100644 tests/spec/glsl-1.50/compiler/named-interface-block-redeclared-same-block-name.vert

diff --git a/tests/spec/glsl-1.50/compiler/named-interface-block-redeclared-different-block-name.vert b/tests/spec/glsl-1.50/compiler/named-interface-block-redeclared-different-block-name.vert
new file mode 100644
index 0000000..13cc019
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/named-interface-block-redeclared-different-block-name.vert
@@ -0,0 +1,36 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+//
+// From section 4.1.9 (Arrays) of the GLSL 4.40 spec (as of revision 7):
+//
+//     However, unless noted otherwise, blocks cannot be redeclared;
+//     an unsized array in a user-declared block cannot be sized
+//     through redeclaration.
+//
+// The only place where the spec notes that interface blocks can be
+// redeclared is to allow for redeclaration of built-in interface
+// blocks such as gl_PerVertex.  Therefore, user-defined interface
+// blocks can never be redeclared.  This is a clarification of
+// previous intent (see Khronos bug 10659:
+// https://cvs.khronos.org/bugzilla/show_bug.cgi?id=10659), so we test
+// it for GLSL version 1.50.
+//
+// In this test, the named interface block is redeclared using a
+// different block name from the name that it had previously.
+
+#version 150
+
+out block1 {
+    vec4 a;
+} inst;
+
+out block2 {
+    vec4 a;
+} inst;
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/named-interface-block-redeclared-same-block-name.vert b/tests/spec/glsl-1.50/compiler/named-interface-block-redeclared-same-block-name.vert
new file mode 100644
index 0000000..676d4cc
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/named-interface-block-redeclared-same-block-name.vert
@@ -0,0 +1,36 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+//
+// From section 4.1.9 (Arrays) of the GLSL 4.40 spec (as of revision 7):
+//
+//     However, unless noted otherwise, blocks cannot be redeclared;
+//     an unsized array in a user-declared block cannot be sized
+//     through redeclaration.
+//
+// The only place where the spec notes that interface blocks can be
+// redeclared is to allow for redeclaration of built-in interface
+// blocks such as gl_PerVertex.  Therefore, user-defined interface
+// blocks can never be redeclared.  This is a clarification of
+// previous intent (see Khronos bug 10659:
+// https://cvs.khronos.org/bugzilla/show_bug.cgi?id=10659), so we test
+// it for GLSL version 1.50.
+//
+// In this test, the named interface block is redeclared using the
+// same block name that it had previously.
+
+#version 150
+
+out block {
+    vec4 a;
+} inst;
+
+out block {
+    vec4 a;
+} inst;
+
+void main()
+{
+}
-- 
1.8.4



More information about the Piglit mailing list