[Piglit] [PATCH 07/14] Test that gl_PerVertex can't be redeclared after it's been used.

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


---
 ...-redeclares-pervertex-in-after-other-usage.geom | 37 +++++++++++++++++++++
 .../gs-redeclares-pervertex-in-after-usage.geom    | 38 ++++++++++++++++++++++
 ...redeclares-pervertex-out-after-other-usage.geom | 37 +++++++++++++++++++++
 .../gs-redeclares-pervertex-out-after-usage.geom   | 38 ++++++++++++++++++++++
 ...redeclares-pervertex-out-after-other-usage.vert | 34 +++++++++++++++++++
 .../vs-redeclares-pervertex-out-after-usage.vert   | 35 ++++++++++++++++++++
 6 files changed, 219 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-after-other-usage.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-after-usage.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-other-usage.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-usage.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-after-other-usage.vert
 create mode 100644 tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-after-usage.vert

diff --git a/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-after-other-usage.geom b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-after-other-usage.geom
new file mode 100644
index 0000000..cc08280
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-after-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:
+//
+//     If a built-in interface block is redeclared, it must appear in
+//     the shader before any use of any member included in the
+//     built-in declaration, or a compilation error will result.
+//
+// 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;
+
+float foo()
+{
+  return gl_in[0].gl_PointSize;
+}
+
+in gl_PerVertex {
+    vec4 gl_Position;
+} gl_in[];
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-after-usage.geom b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-after-usage.geom
new file mode 100644
index 0000000..df9a6f3
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-after-usage.geom
@@ -0,0 +1,38 @@
+// [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:
+//
+//     If a built-in interface block is redeclared, it must appear in
+//     the shader before any use of any member included in the
+//     built-in declaration, or a compilation error will result.
+//
+// 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 included in the redeclaration of gl_PerVertex.
+
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+float foo()
+{
+  return gl_in[0].gl_PointSize;
+}
+
+in gl_PerVertex {
+    vec4 gl_Position;
+    float gl_PointSize;
+} gl_in[];
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-other-usage.geom b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-other-usage.geom
new file mode 100644
index 0000000..63442d1
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-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:
+//
+//     If a built-in interface block is redeclared, it must appear in
+//     the shader before any use of any member included in the
+//     built-in declaration, or a compilation error will result.
+//
+// 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;
+
+void foo()
+{
+  gl_PointSize = 1.0;
+}
+
+out gl_PerVertex {
+    vec4 gl_Position;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-usage.geom b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-usage.geom
new file mode 100644
index 0000000..36b8e77
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-after-usage.geom
@@ -0,0 +1,38 @@
+// [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:
+//
+//     If a built-in interface block is redeclared, it must appear in
+//     the shader before any use of any member included in the
+//     built-in declaration, or a compilation error will result.
+//
+// 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 included in the redeclaration of gl_PerVertex.
+
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+void foo()
+{
+  gl_PointSize = 1.0;
+}
+
+out gl_PerVertex {
+    vec4 gl_Position;
+    float gl_PointSize;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-after-other-usage.vert b/tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-after-other-usage.vert
new file mode 100644
index 0000000..419e57d
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-after-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:
+//
+//     If a built-in interface block is redeclared, it must appear in
+//     the shader before any use of any member included in the
+//     built-in declaration, or a compilation error will result.
+//
+// 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
+
+void foo()
+{
+  gl_PointSize = 1.0;
+}
+
+out gl_PerVertex {
+    vec4 gl_Position;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-after-usage.vert b/tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-after-usage.vert
new file mode 100644
index 0000000..e68eec6
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/vs-redeclares-pervertex-out-after-usage.vert
@@ -0,0 +1,35 @@
+// [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:
+//
+//     If a built-in interface block is redeclared, it must appear in
+//     the shader before any use of any member included in the
+//     built-in declaration, or a compilation error will result.
+//
+// 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 included in the redeclaration of gl_PerVertex.
+
+#version 150
+
+void foo()
+{
+  gl_PointSize = 1.0;
+}
+
+out gl_PerVertex {
+    vec4 gl_Position;
+    float gl_PointSize;
+};
+
+void main()
+{
+}
-- 
1.8.4



More information about the Piglit mailing list