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

Nicholas Mack nichmack at gmail.com
Mon Sep 16 09:35:44 PDT 2013


---
 ...ayout-only-one-out-declaration-per-program.geom | 22 ++++++++++++++++++++++
 .../compiler/layout-out-only-output-qualifier.geom | 22 ++++++++++++++++++++++
 .../compiler/layout-out-order-irrelevant.geom      | 21 +++++++++++++++++++++
 3 files changed, 65 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program.geom
 create mode 100644 tests/spec/glsl-1.50/compiler/layout-out-only-output-qualifier.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.geom b/tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program.geom
new file mode 100644
index 0000000..d7439e1
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program.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(triangle_strip, max_vertices=3) out;
+
+void main()
+{
+}
diff --git a/tests/spec/glsl-1.50/compiler/layout-out-only-output-qualifier.geom b/tests/spec/glsl-1.50/compiler/layout-out-only-output-qualifier.geom
new file mode 100644
index 0000000..37533d4
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/layout-out-only-output-qualifier.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:
+// "Geometry shaders can have output layout qualifiers only on the interface
+//  qualifier out, not on an output block or variable declaration.  The layout
+//  qualifier identifiers for geometry shader outputs are
+//	points
+//	line_strip
+//	triangle_strip
+//	max_vertices = integer-constant"
+
+#version 150
+
+layout(lines_adjacency) 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..603e175
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/layout-out-order-irrelevant.geom
@@ -0,0 +1,21 @@
+// [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(max_vertices = 3, triangle_strip) out;
+
+void main()
+{
+}
-- 
1.8.3.1



More information about the Piglit mailing list