summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Mack <nichmack@gmail.com>2013-09-13 16:27:22 -0700
committerNicholas Mack <nichmack@gmail.com>2013-10-28 14:09:36 -0700
commitae85668a23ebb7e81587b2aafa4c1c843e038423 (patch)
treebf890945b79667d4d124ea35579d02cf394b1e25
parent3a87db4585a3ff48e5dc97e2750b25277f4d9eb3 (diff)
GS: Test geometry output layout qualifier rules
v2: Split first test into two separate tests and remove the unnecessary second test Reviewed-by: Paul Berry <stereotype441@gmail.com>
-rw-r--r--tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program-max-verts.geom22
-rw-r--r--tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program-prim-type.geom22
-rw-r--r--tests/spec/glsl-1.50/compiler/layout-out-order-irrelevant.geom22
3 files changed, 66 insertions, 0 deletions
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 000000000..c3b067f83
--- /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 000000000..d19932ec7
--- /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 000000000..05c2b21bb
--- /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()
+{
+}