[Piglit] [PATCH] glsl-1.20: new test for a GLSL scoping bug in Mesa
Marek Olšák
maraeo at gmail.com
Tue Sep 9 07:51:48 PDT 2014
From: Marek Olšák <marek.olsak at amd.com>
Mesa things Name is a type in "gl_Position = Name".
---
.../compiler/scoping-struct-vs-variable.vert | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 tests/spec/glsl-1.20/compiler/scoping-struct-vs-variable.vert
diff --git a/tests/spec/glsl-1.20/compiler/scoping-struct-vs-variable.vert b/tests/spec/glsl-1.20/compiler/scoping-struct-vs-variable.vert
new file mode 100644
index 0000000..2ab288b
--- /dev/null
+++ b/tests/spec/glsl-1.20/compiler/scoping-struct-vs-variable.vert
@@ -0,0 +1,24 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// check_link: true
+// [end config]
+//
+// GLSLangSpec.1.20.8, 4.2 Scoping:
+//
+// "If a nested scope redeclares a name used in an outer scope, it hides all
+// existing uses of that name. There is no way to access the hidden name or
+// make it unhidden, without exiting the scope that hid it."
+
+#version 120
+
+struct Name {
+ float a;
+};
+
+void main()
+{
+ vec4 Name = vec4(1.0);
+ gl_Position = Name;
+}
+
--
1.9.1
More information about the Piglit
mailing list