[Piglit] [PATCH 01/14] Test that struct names may not begin with "gl_" prefix.

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


---
 .../struct/struct-name-uses-gl-prefix.vert         | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 tests/spec/glsl-1.10/compiler/struct/struct-name-uses-gl-prefix.vert

diff --git a/tests/spec/glsl-1.10/compiler/struct/struct-name-uses-gl-prefix.vert b/tests/spec/glsl-1.10/compiler/struct/struct-name-uses-gl-prefix.vert
new file mode 100644
index 0000000..9cc9d55
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/struct/struct-name-uses-gl-prefix.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// From section 3.7 (Identifiers) of the GLSL 1.10 spec:
+//
+//     Identifiers starting with "gl_" are reserved for use by OpenGL
+//     and may not be declared in a shader as either a variable or a
+//     function.
+//
+// Consequently, a struct's name may not start with "gl_".
+
+struct gl_ProsciuttoHoagie {
+    vec4 a;
+};
+
+void main()
+{
+  gl_Position = vec4(0.0);
+}
-- 
1.8.4



More information about the Piglit mailing list