[Piglit] [PATCH 2/3] arb_enhanced_layouts: xfb_buffer layout qualifier compile tests

Timothy Arceri timothy.arceri at collabora.com
Mon Feb 15 03:22:03 UTC 2016


---
 .../xfb_buffer/block-max.vert                      | 22 +++++++++++++
 .../xfb_buffer/block-member-global-mismatch.vert   | 35 +++++++++++++++++++++
 .../xfb_buffer/block-member-mismatch.vert          | 33 ++++++++++++++++++++
 .../xfb_buffer/block-member-mismatch2.vert         | 33 ++++++++++++++++++++
 .../xfb_buffer/block-member.vert                   | 33 ++++++++++++++++++++
 .../xfb_buffer/block-too-large.vert                | 22 +++++++++++++
 .../xfb_buffer/global-max.vert                     | 22 +++++++++++++
 .../xfb_buffer/global-too-large.vert               | 22 +++++++++++++
 .../xfb_buffer/multiple-qualifiers.vert            | 28 +++++++++++++++++
 .../named-block-member-global-mismatch.vert        | 35 +++++++++++++++++++++
 .../xfb_buffer/named-block-member-mismatch.vert    | 33 ++++++++++++++++++++
 .../xfb_buffer/named-block-member-mismatch2.vert   | 33 ++++++++++++++++++++
 .../xfb_buffer/named-block-member.vert             | 33 ++++++++++++++++++++
 .../xfb_buffer/type-arrays.vert                    | 36 ++++++++++++++++++++++
 .../xfb_buffer/types.vert                          | 36 ++++++++++++++++++++++
 .../xfb_buffer/variable-max.vert                   | 20 ++++++++++++
 .../xfb_buffer/variable-too-large.vert             | 20 ++++++++++++
 17 files changed, 496 insertions(+)
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-max.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-global-mismatch.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-mismatch.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-mismatch2.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-too-large.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/global-max.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/global-too-large.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/multiple-qualifiers.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-global-mismatch.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-mismatch.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-mismatch2.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/type-arrays.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/types.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/variable-max.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/variable-too-large.vert

diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-max.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-max.vert
new file mode 100644
index 0000000..adac1ab
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-max.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "It is a compile-time error to specify an *xfb_buffer* that is greater
+//    than the implementation-dependent constant
+//    gl_MaxTransformFeedbackBuffers."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout (xfb_buffer = gl_MaxTransformFeedbackBuffers - 1) out block {
+  vec4 var;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-global-mismatch.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-global-mismatch.vert
new file mode 100644
index 0000000..ae95c34
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-global-mismatch.vert
@@ -0,0 +1,35 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "Shaders in the transform feedback capturing mode have an initial global
+//    default of
+//
+//        layout(xfb_buffer = 0) out;"
+//
+//    ...
+//
+//    "When a variable or output block is declared without an xfb_buffer
+//    qualifier, it inherits the global default buffer. When a variable or
+//    output block is declared with an xfb_buffer qualifier, it has that 
+//    declared buffer. All members of a block inherit the block's buffer. A 
+//    member is allowed to declare an xfb_buffer, but it must match the buffer
+//    inherited from its block, or a compile-time error results."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout (xfb_buffer = 1) out;
+
+out block {
+  vec4 var1;
+  layout(xfb_buffer = 0) vec4 var2; // xfb_buffer must be 1
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-mismatch.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-mismatch.vert
new file mode 100644
index 0000000..d5f000b
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-mismatch.vert
@@ -0,0 +1,33 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "Shaders in the transform feedback capturing mode have an initial global
+//    default of
+//
+//        layout(xfb_buffer = 0) out;"
+//
+//    ...
+//
+//    "When a variable or output block is declared without an xfb_buffer
+//    qualifier, it inherits the global default buffer. When a variable or
+//    output block is declared with an xfb_buffer qualifier, it has that 
+//    declared buffer. All members of a block inherit the block's buffer. A 
+//    member is allowed to declare an xfb_buffer, but it must match the buffer
+//    inherited from its block, or a compile-time error results."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+out block {
+  vec4 var1;
+  layout(xfb_buffer = 1) vec4 var2; // xfb_buffer must be 0
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-mismatch2.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-mismatch2.vert
new file mode 100644
index 0000000..1a535b7
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member-mismatch2.vert
@@ -0,0 +1,33 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "Shaders in the transform feedback capturing mode have an initial global
+//    default of
+//
+//        layout(xfb_buffer = 0) out;"
+//
+//    ...
+//
+//    "When a variable or output block is declared without an xfb_buffer
+//    qualifier, it inherits the global default buffer. When a variable or
+//    output block is declared with an xfb_buffer qualifier, it has that 
+//    declared buffer. All members of a block inherit the block's buffer. A 
+//    member is allowed to declare an xfb_buffer, but it must match the buffer
+//    inherited from its block, or a compile-time error results."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_buffer = 1) out block {
+  vec4 var1;
+  layout(xfb_buffer = 0) vec4 var2; // xfb_buffer must be 1
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member.vert
new file mode 100644
index 0000000..287099b
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-member.vert
@@ -0,0 +1,33 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "Shaders in the transform feedback capturing mode have an initial global
+//    default of
+//
+//        layout(xfb_buffer = 0) out;"
+//
+//    ...
+//
+//    "When a variable or output block is declared without an xfb_buffer
+//    qualifier, it inherits the global default buffer. When a variable or
+//    output block is declared with an xfb_buffer qualifier, it has that 
+//    declared buffer. All members of a block inherit the block's buffer. A 
+//    member is allowed to declare an xfb_buffer, but it must match the buffer
+//    inherited from its block, or a compile-time error results."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+out block {
+  vec4 var1;
+  layout(xfb_buffer = 0) vec4 var2;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-too-large.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-too-large.vert
new file mode 100644
index 0000000..ea5ea36
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/block-too-large.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "It is a compile-time error to specify an *xfb_buffer* that is greater
+//    than the implementation-dependent constant
+//    gl_MaxTransformFeedbackBuffers."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout (xfb_buffer = gl_MaxTransformFeedbackBuffers) out block {
+  vec4 var;
+};
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/global-max.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/global-max.vert
new file mode 100644
index 0000000..3636bae
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/global-max.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "It is a compile-time error to specify an *xfb_buffer* that is greater
+//    than the implementation-dependent constant
+//    gl_MaxTransformFeedbackBuffers."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout (xfb_buffer = gl_MaxTransformFeedbackBuffers - 1) out;
+
+out vec4 var;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/global-too-large.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/global-too-large.vert
new file mode 100644
index 0000000..cd3cb3d
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/global-too-large.vert
@@ -0,0 +1,22 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "It is a compile-time error to specify an *xfb_buffer* that is greater
+//    than the implementation-dependent constant
+//    gl_MaxTransformFeedbackBuffers."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout (xfb_buffer = gl_MaxTransformFeedbackBuffers) out;
+
+out vec4 var;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/multiple-qualifiers.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/multiple-qualifiers.vert
new file mode 100644
index 0000000..fdaf89d
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/multiple-qualifiers.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout (xfb_buffer = 2) out;
+
+layout(xfb_buffer = 1) out block {
+  vec4 var1;
+  layout(xfb_buffer = 1) vec4 var2;
+};
+
+out block2 {
+  vec4 var1;
+  layout(xfb_buffer = 2) vec4 var2;
+} block_name;
+
+layout (xfb_buffer = 3) out;
+
+layout (xfb_buffer = 0) out vec4 var5;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-global-mismatch.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-global-mismatch.vert
new file mode 100644
index 0000000..a51602a
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-global-mismatch.vert
@@ -0,0 +1,35 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "Shaders in the transform feedback capturing mode have an initial global
+//    default of
+//
+//        layout(xfb_buffer = 0) out;"
+//
+//    ...
+//
+//    "When a variable or output block is declared without an xfb_buffer
+//    qualifier, it inherits the global default buffer. When a variable or
+//    output block is declared with an xfb_buffer qualifier, it has that 
+//    declared buffer. All members of a block inherit the block's buffer. A 
+//    member is allowed to declare an xfb_buffer, but it must match the buffer
+//    inherited from its block, or a compile-time error results."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout (xfb_buffer = 1) out;
+
+out block {
+  vec4 var1;
+  layout(xfb_buffer = 0) vec4 var2; // xfb_buffer must be 1
+} block_name;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-mismatch.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-mismatch.vert
new file mode 100644
index 0000000..5144639
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-mismatch.vert
@@ -0,0 +1,33 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "Shaders in the transform feedback capturing mode have an initial global
+//    default of
+//
+//        layout(xfb_buffer = 0) out;"
+//
+//    ...
+//
+//    "When a variable or output block is declared without an xfb_buffer
+//    qualifier, it inherits the global default buffer. When a variable or
+//    output block is declared with an xfb_buffer qualifier, it has that 
+//    declared buffer. All members of a block inherit the block's buffer. A 
+//    member is allowed to declare an xfb_buffer, but it must match the buffer
+//    inherited from its block, or a compile-time error results."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+out block {
+  vec4 var1;
+  layout(xfb_buffer = 1) vec4 var2; // xfb_buffer must be 0
+} block_name;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-mismatch2.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-mismatch2.vert
new file mode 100644
index 0000000..325f160
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member-mismatch2.vert
@@ -0,0 +1,33 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "Shaders in the transform feedback capturing mode have an initial global
+//    default of
+//
+//        layout(xfb_buffer = 0) out;"
+//
+//    ...
+//
+//    "When a variable or output block is declared without an xfb_buffer
+//    qualifier, it inherits the global default buffer. When a variable or
+//    output block is declared with an xfb_buffer qualifier, it has that 
+//    declared buffer. All members of a block inherit the block's buffer. A 
+//    member is allowed to declare an xfb_buffer, but it must match the buffer
+//    inherited from its block, or a compile-time error results."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_buffer = 1) out block {
+  vec4 var1;
+  layout(xfb_buffer = 0) vec4 var2; // xfb_buffer must be 1
+} block_name;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member.vert
new file mode 100644
index 0000000..5c78783
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/named-block-member.vert
@@ -0,0 +1,33 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "Shaders in the transform feedback capturing mode have an initial global
+//    default of
+//
+//        layout(xfb_buffer = 0) out;"
+//
+//    ...
+//
+//    "When a variable or output block is declared without an xfb_buffer
+//    qualifier, it inherits the global default buffer. When a variable or
+//    output block is declared with an xfb_buffer qualifier, it has that 
+//    declared buffer. All members of a block inherit the block's buffer. A 
+//    member is allowed to declare an xfb_buffer, but it must match the buffer
+//    inherited from its block, or a compile-time error results."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+out block {
+  vec4 var1;
+  layout(xfb_buffer = 0) vec4 var2;
+} block_name;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/type-arrays.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/type-arrays.vert
new file mode 100644
index 0000000..0ef49a5
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/type-arrays.vert
@@ -0,0 +1,36 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "Variables and block members qualified with *xfb_offset* can be scalars,
+//    vectors, matrices, structures, and (sized) arrays of these. The offset
+//    must be a multiple of the size of the first component of the first
+//    qualified variable or block member, or a compile-time error results.
+//    Further, if applied to an aggregate containing a double, the offset must
+//    also be a multiple of 8, and the space taken in the buffer will be a
+//    multiple of 8."
+//
+// We take this to mean xfb_buffer can also qualify these types.
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+struct S {
+  vec3 x;
+};
+
+layout(xfb_buffer = 0) out float var1[2];
+
+layout(xfb_buffer = 1) out vec4 var2[2];
+
+layout(xfb_buffer = 2) out mat4 var3[2];
+
+layout(xfb_buffer = 3) out S s[2];
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/types.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/types.vert
new file mode 100644
index 0000000..e33de2a
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/types.vert
@@ -0,0 +1,36 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "Variables and block members qualified with *xfb_offset* can be scalars,
+//    vectors, matrices, structures, and (sized) arrays of these. The offset
+//    must be a multiple of the size of the first component of the first
+//    qualified variable or block member, or a compile-time error results.
+//    Further, if applied to an aggregate containing a double, the offset must
+//    also be a multiple of 8, and the space taken in the buffer will be a
+//    multiple of 8."
+//
+// We take this to mean xfb_buffer can also qualify these types.
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+struct S {
+  vec3 x;
+};
+
+layout(xfb_buffer = 1) out float var1;
+
+layout(xfb_buffer = 0) out vec4 var2;
+
+layout(xfb_buffer = 3) out mat4 var3;
+
+layout(xfb_buffer = 2) out S s;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/variable-max.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/variable-max.vert
new file mode 100644
index 0000000..2ab6cd6
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/variable-max.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "It is a compile-time error to specify an *xfb_buffer* that is greater
+//    than the implementation-dependent constant
+//    gl_MaxTransformFeedbackBuffers."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout (xfb_buffer = gl_MaxTransformFeedbackBuffers - 1) out vec4 var;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/variable-too-large.vert b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/variable-too-large.vert
new file mode 100644
index 0000000..33c7b72
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_buffer/variable-too-large.vert
@@ -0,0 +1,20 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//    "It is a compile-time error to specify an *xfb_buffer* that is greater
+//    than the implementation-dependent constant
+//    gl_MaxTransformFeedbackBuffers."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+
+layout (xfb_buffer = gl_MaxTransformFeedbackBuffers) out vec4 var;
+
+void main()
+{
+}
-- 
2.5.0



More information about the Piglit mailing list