[Piglit] [PATCH 3/8] GL_ARB_uniform_buffer_object: Test more misuse of layout qualifiers.
Eric Anholt
eric at anholt.net
Tue May 1 11:08:12 PDT 2012
---
.../compiler/layout-packed-within-block.frag | 23 ++++++++++++++++++++
.../compiler/layout-shared-within-block.frag | 23 ++++++++++++++++++++
.../compiler/layout-std140-within-block.frag | 23 ++++++++++++++++++++
3 files changed, 69 insertions(+)
create mode 100644 tests/spec/arb_uniform_buffer_object/compiler/layout-packed-within-block.frag
create mode 100644 tests/spec/arb_uniform_buffer_object/compiler/layout-shared-within-block.frag
create mode 100644 tests/spec/arb_uniform_buffer_object/compiler/layout-std140-within-block.frag
diff --git a/tests/spec/arb_uniform_buffer_object/compiler/layout-packed-within-block.frag b/tests/spec/arb_uniform_buffer_object/compiler/layout-packed-within-block.frag
new file mode 100644
index 0000000..521b410
--- /dev/null
+++ b/tests/spec/arb_uniform_buffer_object/compiler/layout-packed-within-block.frag
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// require_extensions: GL_ARB_uniform_buffer_object
+// [end config]
+
+/* From the GL_ARB_uniform_buffer_object_spec:
+ *
+ * "Layout qualifiers on member declarations cannot use the
+ * shared, packed, or std140 qualifiers. These can only be used
+ * at global scope or on a block declaration."
+ */
+
+#version 120
+#extension GL_ARB_uniform_buffer_object: require
+
+uniform ubo {
+ layout(packed) vec4 a;
+};
+
+vec4 foo(void) {
+ return a;
+}
diff --git a/tests/spec/arb_uniform_buffer_object/compiler/layout-shared-within-block.frag b/tests/spec/arb_uniform_buffer_object/compiler/layout-shared-within-block.frag
new file mode 100644
index 0000000..4a84c10
--- /dev/null
+++ b/tests/spec/arb_uniform_buffer_object/compiler/layout-shared-within-block.frag
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// require_extensions: GL_ARB_uniform_buffer_object
+// [end config]
+
+/* From the GL_ARB_uniform_buffer_object_spec:
+ *
+ * "Layout qualifiers on member declarations cannot use the
+ * shared, packed, or std140 qualifiers. These can only be used
+ * at global scope or on a block declaration."
+ */
+
+#version 120
+#extension GL_ARB_uniform_buffer_object: require
+
+uniform ubo {
+ layout(shared) vec4 a;
+};
+
+vec4 foo(void) {
+ return a;
+}
diff --git a/tests/spec/arb_uniform_buffer_object/compiler/layout-std140-within-block.frag b/tests/spec/arb_uniform_buffer_object/compiler/layout-std140-within-block.frag
new file mode 100644
index 0000000..06bc79b
--- /dev/null
+++ b/tests/spec/arb_uniform_buffer_object/compiler/layout-std140-within-block.frag
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// require_extensions: GL_ARB_uniform_buffer_object
+// [end config]
+
+/* From the GL_ARB_uniform_buffer_object_spec:
+ *
+ * "Layout qualifiers on member declarations cannot use the
+ * shared, packed, or std140 qualifiers. These can only be used
+ * at global scope or on a block declaration."
+ */
+
+#version 120
+#extension GL_ARB_uniform_buffer_object: require
+
+uniform ubo {
+ layout(std140) vec4 a;
+};
+
+vec4 foo(void) {
+ return a;
+}
--
1.7.10
More information about the Piglit
mailing list