[Piglit] [PATCH 12/14] Verify array-ness and instance name of gl_PerVertex redeclarations.

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


---
 .../gs-redeclares-pervertex-in-as-nonarray.geom    | 43 ++++++++++++++++++++++
 ...edeclares-pervertex-in-with-incorrect-name.geom | 38 +++++++++++++++++++
 ...eclares-pervertex-in-without-instance-name.geom | 38 +++++++++++++++++++
 .../gs-redeclares-pervertex-out-as-array.geom      | 42 +++++++++++++++++++++
 ...edeclares-pervertex-out-with-instance-name.geom | 43 ++++++++++++++++++++++
 5 files changed, 204 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-as-nonarray.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-with-incorrect-name.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-without-instance-name.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-as-array.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-with-instance-name.geom

diff --git a/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-as-nonarray.geom b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-as-nonarray.geom
new file mode 100644
index 0000000..dd36111
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-as-nonarray.geom
@@ -0,0 +1,43 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+//
+// From section 7.1.1 (Compatibility Profile Built-In Language
+// Variables) of the GLSL 4.10 spec:
+//
+//     However, when a built-in interface block with an instance name
+//     is redeclared (e.g., gl_in), the instance name must be included
+//     in the redeclaration. It is an error to not include the
+//     built-in instance name or to change its name.  For example,
+//
+//     in gl_PerVertex {
+//         vec4  gl_ClipVertex;
+//         vec4  gl_FrontColor;
+//     } gl_in[];  // must be present and must be "gl_in[]"
+//
+// Note: although this text appears in a section referring to
+// compatibility profile variables, it's clear from context that it's
+// meant to apply to any redeclaration of gl_in, whether it is done in
+// a compatibility or a core profile.
+//
+// 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, we try redeclaraing the gl_PerVertex input as a
+// non-array.
+
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+in gl_PerVertex {
+  vec4 gl_Position;
+} gl_in;
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-with-incorrect-name.geom b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-with-incorrect-name.geom
new file mode 100644
index 0000000..326fbf4
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-with-incorrect-name.geom
@@ -0,0 +1,38 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+//
+// From section 7.1.1 (Compatibility Profile Built-In Language
+// Variables) of the GLSL 4.10 spec:
+//
+//     However, when a built-in interface block with an instance name
+//     is redeclared (e.g., gl_in), the instance name must be included
+//     in the redeclaration. It is an error to not include the
+//     built-in instance name or to change its name.
+//
+// Note: although this text appears in a section referring to
+// compatibility profile variables, it's clear from context that it's
+// meant to apply to any redeclaration of gl_in, whether it is done in
+// a compatibility or a core profile.
+//
+// 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, we try redeclaraing the gl_PerVertex input with an
+// incorrect instance name.
+
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+in gl_PerVertex {
+  vec4 gl_Position;
+} foo[];
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-without-instance-name.geom b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-without-instance-name.geom
new file mode 100644
index 0000000..cdd26b6
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-in-without-instance-name.geom
@@ -0,0 +1,38 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+//
+// From section 7.1.1 (Compatibility Profile Built-In Language
+// Variables) of the GLSL 4.10 spec:
+//
+//     However, when a built-in interface block with an instance name
+//     is redeclared (e.g., gl_in), the instance name must be included
+//     in the redeclaration. It is an error to not include the
+//     built-in instance name or to change its name.
+//
+// Note: although this text appears in a section referring to
+// compatibility profile variables, it's clear from context that it's
+// meant to apply to any redeclaration of gl_in, whether it is done in
+// a compatibility or a core profile.
+//
+// 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, we try redeclaraing the gl_PerVertex input without
+// specifying an instance name.
+
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+in gl_PerVertex {
+  vec4 gl_Position;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-as-array.geom b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-as-array.geom
new file mode 100644
index 0000000..4530cae
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-as-array.geom
@@ -0,0 +1,42 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+//
+// From section 7.1.1 (Compatibility Profile Built-In Language
+// Variables) of the GLSL 4.10 spec:
+//
+//     However, when a built-in interface block with an instance name
+//     is redeclared (e.g., gl_in), the instance name must be included
+//     in the redeclaration. It is an error to not include the
+//     built-in instance name or to change its name.
+//
+// Note: although this text appears in a section referring to
+// compatibility profile variables, it's clear from context that it's
+// meant to apply to any redeclaration of gl_in, whether it is done in
+// a compatibility or a core profile.
+//
+// Although not explicitly stated, it seems logical to apply the
+// converse rule to redeclaring the gl_PerVertex output; in other
+// words, the gl_PerVertex output must be redeclared *without* and
+// instance name (and hence, as a non-array).
+//
+// 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, we try redeclaraing the gl_PerVertex input as an array.
+
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+out gl_PerVertex {
+  vec4 gl_Position;
+} foo[3];
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-with-instance-name.geom b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-with-instance-name.geom
new file mode 100644
index 0000000..3b23d81
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/gs-redeclares-pervertex-out-with-instance-name.geom
@@ -0,0 +1,43 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: false
+// [end config]
+//
+// From section 7.1.1 (Compatibility Profile Built-In Language
+// Variables) of the GLSL 4.10 spec:
+//
+//     However, when a built-in interface block with an instance name
+//     is redeclared (e.g., gl_in), the instance name must be included
+//     in the redeclaration. It is an error to not include the
+//     built-in instance name or to change its name.
+//
+// Note: although this text appears in a section referring to
+// compatibility profile variables, it's clear from context that it's
+// meant to apply to any redeclaration of gl_in, whether it is done in
+// a compatibility or a core profile.
+//
+// Although not explicitly stated, it seems logical to apply the
+// converse rule to redeclaring the gl_PerVertex output; in other
+// words, the gl_PerVertex output must be redeclared *without* and
+// instance name (and hence, as a non-array).
+//
+// 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, we try redeclaraing the gl_PerVertex input as a
+// non-array, but with an instance name.
+
+#version 150
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+out gl_PerVertex {
+  vec4 gl_Position;
+} foo;
+
+void main()
+{
+}
-- 
1.8.4



More information about the Piglit mailing list