[Piglit] [PATCH 3/4] GS: Test geometry output layout qualifier rules

Nicholas Mack nichmack at gmail.com
Mon Sep 30 15:38:52 PDT 2013


v2: Split first test into two separate tests and remove the unnecessary second test
---
 ...-one-out-declaration-per-program-max-verts.geom | 22 ++++++++++++++++++++++
 ...-one-out-declaration-per-program-prim-type.geom | 22 ++++++++++++++++++++++
 .../compiler/layout-out-order-irrelevant.geom      | 22 ++++++++++++++++++++++
 3 files changed, 66 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program-max-verts.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program-prim-type.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/layout-out-order-irrelevant.geom

diff --git a/tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program-max-verts.geom b/tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program-max-verts.geom
new file mode 100644
index 0000000..c3b067f
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program-max-verts.geom
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// Section 4.3.8.2(Output Layout Qualifiers) of the GLSL 1.50 spec says:
+// "All geometry shader output layout declarations in a program must declare the
+//  same layout and same value for max_vertices."
+
+#version 150
+
+layout(lines) in;
+layout(line_strip, max_vertices=2) out;
+
+in vec4 pos[];
+
+layout(line_strip, max_vertices=3) out;
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program-prim-type.geom b/tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program-prim-type.geom
new file mode 100644
index 0000000..d19932e
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program-prim-type.geom
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// Section 4.3.8.2(Output Layout Qualifiers) of the GLSL 1.50 spec says:
+// "All geometry shader output layout declarations in a program must declare the
+//  same layout and same value for max_vertices."
+
+#version 150
+
+layout(lines) in;
+layout(line_strip, max_vertices=3) out;
+
+in vec4 pos[];
+
+layout(triangle_strip, max_vertices=3) out;
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/layout-out-order-irrelevant.geom b/tests/spec/glsl-1.50/compiler/layout-out-order-irrelevant.geom
new file mode 100644
index 0000000..05c2b21
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/layout-out-order-irrelevant.geom
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// check_link: true
+// [end config]
+//
+// Section 4.3.8 (Layout Qualifiers) of the GLSL 1.50 spec says:
+// "The tokens in any layout-qualifier-id-list are identifiers, not keywords.
+//  Generally, they can be listed in any order."
+//
+// Section 4.3.8.2(Output Layout Qualifiers) of the GLSL 1.50 spec says:
+// "One declaration can declare either a primitive type (points, line_strip, or
+//  triangle_strip), or max_vertices, or both."
+
+#version 150
+
+layout(triangles) in;
+layout(max_vertices = 3, triangle_strip) out;
+
+void main()
+{
+}
-- 
1.8.3.1



More information about the Piglit mailing list