[Piglit] [PATCH 7/7] arb_enhanced_layouts: More multiple layout qualifiers in a single declaration tests

Andres Gomez agomez at igalia.com
Sat Oct 22 20:42:26 UTC 2016


Added tests for the layout-qualifier-names "max_vertices",
"invocations", "vertices", "local_size_[x|y|z]" and "xfb_stride" which
may have redeclarations but all of them enforce that a global or
variable redeclaration holds the same value than in the previous
declaration(s).

These tests check that multiple appearances of the same
layout-qualifier-name across multiple layout-qualifiers in the same
declaration with different values won't trigger a compile/link error.

>From the ARB_enhanced_layouts spec:

    "More than one layout qualifier may appear in a single declaration.
     Additionally, the same layout-qualifier-name can occur multiple times
     within a layout qualifier or across multiple layout qualifiers in the
     same declaration"

Signed-off-by: Andres Gomez <agomez at igalia.com>
---
 ...identifiers-in-single-declaration-mismatch.geom | 38 +++++++++++++++++++
 ...vocation-identifiers-in-single-declaration.geom | 38 +++++++++++++++++++
 ...identifiers-in-single-declaration-mismatch.comp | 38 +++++++++++++++++++
 ...cal_size-identifiers-in-single-declaration.comp | 38 +++++++++++++++++++
 ...identifiers-in-single-declaration-mismatch.geom | 40 ++++++++++++++++++++
 ...vertices-identifiers-in-single-declaration.geom | 40 ++++++++++++++++++++
 ...identifiers-in-single-declaration-mismatch.tesc | 39 +++++++++++++++++++
 ...vertices-identifiers-in-single-declaration.tesc | 39 +++++++++++++++++++
 ...identifiers-in-single-declaration-mismatch.vert | 41 ++++++++++++++++++++
 ...k-global-identifiers-in-single-declaration.vert | 41 ++++++++++++++++++++
 ...identifiers-in-single-declaration-mismatch.vert | 44 ++++++++++++++++++++++
 ...de-block-identifiers-in-single-declaration.vert | 44 ++++++++++++++++++++++
 ...identifiers-in-single-declaration-mismatch.vert | 37 ++++++++++++++++++
 ...e-global-identifiers-in-single-declaration.vert | 37 ++++++++++++++++++
 ...identifiers-in-single-declaration-mismatch.vert | 41 ++++++++++++++++++++
 ...k-global-identifiers-in-single-declaration.vert | 41 ++++++++++++++++++++
 ...identifiers-in-single-declaration-mismatch.vert | 44 ++++++++++++++++++++++
 ...medblock-identifiers-in-single-declaration.vert | 44 ++++++++++++++++++++++
 ...identifiers-in-single-declaration-mismatch.vert | 39 +++++++++++++++++++
 ...e-global-identifiers-in-single-declaration.vert | 39 +++++++++++++++++++
 ...identifiers-in-single-declaration-mismatch.vert | 39 +++++++++++++++++++
 ...variable-identifiers-in-single-declaration.vert | 39 +++++++++++++++++++
 22 files changed, 880 insertions(+)
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-invocation-identifiers-in-single-declaration-mismatch.geom
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-invocation-identifiers-in-single-declaration.geom
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-local_size-identifiers-in-single-declaration-mismatch.comp
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-local_size-identifiers-in-single-declaration.comp
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-max_vertices-identifiers-in-single-declaration-mismatch.geom
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-max_vertices-identifiers-in-single-declaration.geom
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-vertices-identifiers-in-single-declaration-mismatch.tesc
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-vertices-identifiers-in-single-declaration.tesc
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-global-identifiers-in-single-declaration-mismatch.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-global-identifiers-in-single-declaration.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-identifiers-in-single-declaration-mismatch.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-identifiers-in-single-declaration.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-global-identifiers-in-single-declaration-mismatch.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-global-identifiers-in-single-declaration.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-global-identifiers-in-single-declaration-mismatch.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-global-identifiers-in-single-declaration.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-identifiers-in-single-declaration-mismatch.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-identifiers-in-single-declaration.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-global-identifiers-in-single-declaration-mismatch.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-global-identifiers-in-single-declaration.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-identifiers-in-single-declaration-mismatch.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-identifiers-in-single-declaration.vert

diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-invocation-identifiers-in-single-declaration-mismatch.geom b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-invocation-identifiers-in-single-declaration-mismatch.geom
new file mode 100644
index 0000000..1d9ed39
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-invocation-identifiers-in-single-declaration-mismatch.geom
@@ -0,0 +1,38 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader5
+// check_link: false
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_gpu_shader5 spec:
+//
+//    "If an invocation count is declared, all such declarations must
+//     specify the same count."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: enable
+#extension GL_ARB_gpu_shader5 : enable
+
+layout(points, invocations=4) layout(invocations=3) in;
+layout(invocations=4) in;
+layout(triangle_strip, max_vertices=3) out;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-invocation-identifiers-in-single-declaration.geom b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-invocation-identifiers-in-single-declaration.geom
new file mode 100644
index 0000000..4a5c9b4
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-invocation-identifiers-in-single-declaration.geom
@@ -0,0 +1,38 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader5
+// check_link: false
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_gpu_shader5 spec:
+//
+//    "If an invocation count is declared, all such declarations must
+//     specify the same count."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: enable
+#extension GL_ARB_gpu_shader5 : enable
+
+layout(points, invocations=3) layout(invocations=4) in;
+layout(invocations=4) in;
+layout(triangle_strip, max_vertices=3) out;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-local_size-identifiers-in-single-declaration-mismatch.comp b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-local_size-identifiers-in-single-declaration-mismatch.comp
new file mode 100644
index 0000000..97728e0
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-local_size-identifiers-in-single-declaration-mismatch.comp
@@ -0,0 +1,38 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_compute_shader
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_compute_shader spec:
+//
+//    "[If an input layout qualifier] is declared more than once in
+//     the same shader, all those declarations must indicate the same
+//     local work-group size; otherwise a compile-time error results."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: enable
+#extension GL_ARB_compute_shader: enable
+
+layout(local_size_z = 2) layout(local_size_z = 1) in;
+layout(local_size_z = 2) in;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-local_size-identifiers-in-single-declaration.comp b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-local_size-identifiers-in-single-declaration.comp
new file mode 100644
index 0000000..db7982c
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-local_size-identifiers-in-single-declaration.comp
@@ -0,0 +1,38 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_compute_shader
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_compute_shader spec:
+//
+//    "[If an input layout qualifier] is declared more than once in
+//     the same shader, all those declarations must indicate the same
+//     local work-group size; otherwise a compile-time error results."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: enable
+#extension GL_ARB_compute_shader: enable
+
+layout(local_size_z = 1) layout(local_size_z = 2) in;
+layout(local_size_z = 2) in;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-max_vertices-identifiers-in-single-declaration-mismatch.geom b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-max_vertices-identifiers-in-single-declaration-mismatch.geom
new file mode 100644
index 0000000..1ab2121
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-max_vertices-identifiers-in-single-declaration-mismatch.geom
@@ -0,0 +1,40 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From 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
+#extension GL_ARB_enhanced_layouts: enable
+
+layout(lines) in;
+layout(line_strip, max_vertices=3) layout(max_vertices=2) out;
+
+in vec4 pos[];
+
+layout(max_vertices=3) out;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-max_vertices-identifiers-in-single-declaration.geom b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-max_vertices-identifiers-in-single-declaration.geom
new file mode 100644
index 0000000..f5b64cb
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-max_vertices-identifiers-in-single-declaration.geom
@@ -0,0 +1,40 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From 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
+#extension GL_ARB_enhanced_layouts: enable
+
+layout(lines) in;
+layout(line_strip, max_vertices=2) layout(max_vertices=3) out;
+
+in vec4 pos[];
+
+layout(max_vertices=3) out;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-vertices-identifiers-in-single-declaration-mismatch.tesc b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-vertices-identifiers-in-single-declaration-mismatch.tesc
new file mode 100644
index 0000000..610e374
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-vertices-identifiers-in-single-declaration-mismatch.tesc
@@ -0,0 +1,39 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_compute_shader
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_tessellation_shader spec:
+//
+//    "All tessellation control shader layout declarations in a program must
+//     specify the same output patch vertex count."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: enable
+#extension GL_ARB_tessellation_shader: require
+
+layout(vertices = 3) layout(vertices = 4) out;
+layout(vertices = 3) out;
+
+void main() {
+    gl_out[gl_InvocationID].gl_Position = vec4(0.0);
+    gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
+    gl_TessLevelInner = float[2](1.0, 1.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-vertices-identifiers-in-single-declaration.tesc b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-vertices-identifiers-in-single-declaration.tesc
new file mode 100644
index 0000000..b3b5cf9
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-vertices-identifiers-in-single-declaration.tesc
@@ -0,0 +1,39 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_tessellation_shader
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_tessellation_shader spec:
+//
+//    "All tessellation control shader layout declarations in a program must
+//     specify the same output patch vertex count."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: enable
+#extension GL_ARB_tessellation_shader: require
+
+layout(vertices = 4) layout(vertices = 3) out;
+layout(vertices = 3) out;
+
+void main() {
+    gl_out[gl_InvocationID].gl_Position = vec4(0.0);
+    gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
+    gl_TessLevelInner = float[2](1.0, 1.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-global-identifiers-in-single-declaration-mismatch.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-global-identifiers-in-single-declaration-mismatch.vert
new file mode 100644
index 0000000..efcca2b
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-global-identifiers-in-single-declaration-mismatch.vert
@@ -0,0 +1,41 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 20, xfb_buffer = 0) out;
+
+layout(xfb_stride = 20) layout(xfb_stride = 32) out block {
+  vec4 var;
+};
+
+void main()
+{
+  var = vec4(1.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-global-identifiers-in-single-declaration.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-global-identifiers-in-single-declaration.vert
new file mode 100644
index 0000000..9a1b10e
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-global-identifiers-in-single-declaration.vert
@@ -0,0 +1,41 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 20, xfb_buffer = 0) out;
+
+layout(xfb_stride = 32) layout(xfb_stride = 20) out block {
+  vec4 var;
+};
+
+void main()
+{
+  var = vec4(1.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-identifiers-in-single-declaration-mismatch.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-identifiers-in-single-declaration-mismatch.vert
new file mode 100644
index 0000000..0317837
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-identifiers-in-single-declaration-mismatch.vert
@@ -0,0 +1,44 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 20) layout(xfb_stride = 32) out block1 {
+  vec4 var;
+};
+
+layout(xfb_buffer = 0, xfb_stride = 20) out block2 {
+  vec4 var2;
+};
+
+void main()
+{
+  var = vec4(1.0);
+  var2 = vec4(0.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-identifiers-in-single-declaration.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-identifiers-in-single-declaration.vert
new file mode 100644
index 0000000..5899e22
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-block-identifiers-in-single-declaration.vert
@@ -0,0 +1,44 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 32) layout(xfb_stride = 20) out block1 {
+  vec4 var;
+};
+
+layout(xfb_buffer = 0, xfb_stride = 20) out block2 {
+  vec4 var2;
+};
+
+void main()
+{
+  var = vec4(1.0);
+  var2 = vec4(0.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-global-identifiers-in-single-declaration-mismatch.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-global-identifiers-in-single-declaration-mismatch.vert
new file mode 100644
index 0000000..4e2fe72
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-global-identifiers-in-single-declaration-mismatch.vert
@@ -0,0 +1,37 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 32) layout(xfb_stride = 20) out;
+layout(xfb_buffer = 0, xfb_stride = 32) out;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-global-identifiers-in-single-declaration.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-global-identifiers-in-single-declaration.vert
new file mode 100644
index 0000000..73d509d
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-global-identifiers-in-single-declaration.vert
@@ -0,0 +1,37 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 32) layout(xfb_stride = 20) out;
+layout(xfb_buffer = 0, xfb_stride = 20) out;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-global-identifiers-in-single-declaration-mismatch.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-global-identifiers-in-single-declaration-mismatch.vert
new file mode 100644
index 0000000..c226925
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-global-identifiers-in-single-declaration-mismatch.vert
@@ -0,0 +1,41 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 20, xfb_buffer = 0) out;
+
+layout(xfb_stride = 20) layout(xfb_stride = 32) out block {
+  vec4 var;
+} b1;
+
+void main()
+{
+  b1.var = vec4(1.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-global-identifiers-in-single-declaration.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-global-identifiers-in-single-declaration.vert
new file mode 100644
index 0000000..9460bfa
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-global-identifiers-in-single-declaration.vert
@@ -0,0 +1,41 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 20, xfb_buffer = 0) out;
+
+layout(xfb_stride = 32) layout(xfb_stride = 20) out block {
+  vec4 var;
+} b1;
+
+void main()
+{
+  b1.var = vec4(1.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-identifiers-in-single-declaration-mismatch.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-identifiers-in-single-declaration-mismatch.vert
new file mode 100644
index 0000000..6c22f63
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-identifiers-in-single-declaration-mismatch.vert
@@ -0,0 +1,44 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 20) layout(xfb_stride = 32) out block1 {
+  vec4 var;
+} b1;
+
+layout(xfb_buffer = 0, xfb_stride = 20) out block2 {
+  vec4 var2;
+} b2;
+
+void main()
+{
+  b1.var = vec4(1.0);
+  b2.var2 = vec4(0.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-identifiers-in-single-declaration.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-identifiers-in-single-declaration.vert
new file mode 100644
index 0000000..56b5b2a
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-namedblock-identifiers-in-single-declaration.vert
@@ -0,0 +1,44 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 32) layout(xfb_stride = 20) out block1 {
+  vec4 var;
+} b1;
+
+layout(xfb_buffer = 0, xfb_stride = 20) out block2 {
+  vec4 var2;
+} b2;
+
+void main()
+{
+  b1.var = vec4(1.0);
+  b2.var2 = vec4(0.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-global-identifiers-in-single-declaration-mismatch.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-global-identifiers-in-single-declaration-mismatch.vert
new file mode 100644
index 0000000..e3cdfc4
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-global-identifiers-in-single-declaration-mismatch.vert
@@ -0,0 +1,39 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 20, xfb_buffer = 0) out;
+
+layout(xfb_buffer = 0, xfb_stride = 20) layout(xfb_stride = 32) out vec4 var;
+
+void main()
+{
+  var = vec4(1.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-global-identifiers-in-single-declaration.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-global-identifiers-in-single-declaration.vert
new file mode 100644
index 0000000..89ebdd8
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-global-identifiers-in-single-declaration.vert
@@ -0,0 +1,39 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 20, xfb_buffer = 0) out;
+
+layout(xfb_buffer = 0, xfb_stride = 32) layout(xfb_stride = 20) out vec4 var;
+
+void main()
+{
+  var = vec4(1.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-identifiers-in-single-declaration-mismatch.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-identifiers-in-single-declaration-mismatch.vert
new file mode 100644
index 0000000..73e4345
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-identifiers-in-single-declaration-mismatch.vert
@@ -0,0 +1,39 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 20) layout(xfb_stride = 32) out vec4 var;
+layout(xfb_buffer = 0, xfb_stride = 20) out vec4 var2;
+
+void main()
+{
+  var = vec4(1.0);
+  var2 = vec4(0.0);
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-identifiers-in-single-declaration.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-identifiers-in-single-declaration.vert
new file mode 100644
index 0000000..8ca3776
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-xfb_stride-variable-identifiers-in-single-declaration.vert
@@ -0,0 +1,39 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// check_link: true
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration. When the same layout-qualifier-name occurs
+//     multiple times, in a single declaration, the last occurrence overrides
+//     the former occurrence(s).  Further, if such a layout-qualifier-name
+//     will effect subsequent declarations or other observable behavior, it
+//     is only the last occurrence that will have any effect, behaving as if
+//     the earlier occurrence(s) within the declaration are not present.
+//     This is also true for overriding layout-qualifier-names, where one
+//     overrides the other (e.g., row_major vs. column_major); only the last
+//     occurrence has any effect."
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "While *xfb_stride* can be declared multiple times for the same buffer,
+//     it is a compile-time or link-time error to have different values
+//     specified for the stride for the same buffer."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 32) layout(xfb_stride = 20) out vec4 var;
+layout(xfb_buffer = 0, xfb_stride = 20) out vec4 var2;
+
+void main()
+{
+  var = vec4(1.0);
+  var2 = vec4(0.0);
+}
-- 
2.9.3



More information about the Piglit mailing list