[Piglit] [PATCH] glsl-1.50: test for interface block global name reuse error

Matt Turner mattst88 at gmail.com
Wed Jul 24 14:14:07 PDT 2013


Placing the use of the block name before the block declaration currently
compiles with Mesa, which is a bug.
---
 .../interface-blocks-name-reused-globally.vert     | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally.vert

diff --git a/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally.vert b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally.vert
new file mode 100644
index 0000000..8f20695
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/interface-blocks-name-reused-globally.vert
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
+// "Block names have no other use within a shader beyond interface matching;
+//  it is an error to use a block name at global scope for anything other than
+//  as a block name."
+//
+// Tests that an interface block name may not be reused globally as anything
+// other than as a block name.
+
+#version 150
+
+vec4 block;
+
+out block {
+    vec4 a;
+} inst;
+
+void main()
+{
+}
+
-- 
1.8.1.5



More information about the Piglit mailing list