[Piglit] [PATCH 09/14] Test that after redeclaration, absent members of gl_PerVertex can't be used.

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


---
 ...redeclares-pervertex-in-before-other-usage.geom | 34 ++++++++++++++++++++
 ...edeclares-pervertex-out-before-other-usage.geom | 37 ++++++++++++++++++++++
 ...edeclares-pervertex-out-before-other-usage.vert | 34 ++++++++++++++++++++
 3 files changed, 105 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-before-other-usage.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-before-other-usage.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-before-other-usage.vert

diff --git a/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-before-other-usage.geom b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-before-other-usage.geom
new file mode 100644
index 0000000..f9b2b5e
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-before-other-usage.geom
@@ -0,0 +1,34 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// From section 7.1 (Built-In Language Variables) of the GLSL 4.10
+// spec:
+//
+//     It is also a compilation error to redeclare a built-in block
+//     and then use a member from that built- in block that was not
+//     included in the redeclaration.
+//
+// This appears to be a clarification to the behaviour established for
+// gl_PerVertex by GLSL 1.50, therefore we test it using GLSL version
+// 1.50.
+
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+in gl_PerVertex {
+    vec4 gl_Position;
+} gl_in[];
+
+float foo()
+{
+  return gl_in[0].gl_PointSize;
+}
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-before-other-usage.geom b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-before-other-usage.geom
new file mode 100644
index 0000000..69b3b43
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-before-other-usage.geom
@@ -0,0 +1,37 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// From section 7.1 (Built-In Language Variables) of the GLSL 4.10
+// spec:
+//
+//     It is also a compilation error to redeclare a built-in block
+//     and then use a member from that built- in block that was not
+//     included in the redeclaration.
+//
+// This appears to be a clarification to the behaviour established for
+// gl_PerVertex by GLSL 1.50, therefore we test it using GLSL version
+// 1.50.
+//
+// In this test the variable that we attempt to use before redeclaring
+// gl_PerVertex is not included in the redeclaration of gl_PerVertex.
+
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+out gl_PerVertex {
+    vec4 gl_Position;
+};
+
+void foo()
+{
+  gl_PointSize = 1.0;
+}
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-before-other-usage.vert b/tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-before-other-usage.vert
new file mode 100644
index 0000000..d0ba4da
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-before-other-usage.vert
@@ -0,0 +1,34 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// From section 7.1 (Built-In Language Variables) of the GLSL 4.10
+// spec:
+//
+//     It is also a compilation error to redeclare a built-in block
+//     and then use a member from that built- in block that was not
+//     included in the redeclaration.
+//
+// This appears to be a clarification to the behaviour established for
+// gl_PerVertex by GLSL 1.50, therefore we test it using GLSL version
+// 1.50.
+//
+// In this test the variable that we attempt to use before redeclaring
+// gl_PerVertex is not included in the redeclaration of gl_PerVertex.
+
+#version 150
+
+out gl_PerVertex {
+    vec4 gl_Position;
+};
+
+void foo()
+{
+  gl_PointSize = 1.0;
+}
+
+void main()
+{
+}
-- 
1.8.4



More information about the Piglit mailing list