[Piglit] [PATCH] arb_uniform_buffer_object: add uniform-block-memory-qualifier.frag

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed May 3 16:31:41 UTC 2017


It's more appropriate to have this test here (or in
arb_shader_storage_bufer_object).

This also removes memory-qualifier-with-non-image-type.frag
which is not totally correct.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 .../memory-qualifier-with-non-image-type.frag      | 25 --------------------
 .../compiler/uniform-block-memory-qualifier.frag   | 27 ++++++++++++++++++++++
 2 files changed, 27 insertions(+), 25 deletions(-)
 delete mode 100644 tests/spec/arb_shader_image_load_store/compiler/memory-qualifier-with-non-image-type.frag
 create mode 100644 tests/spec/arb_uniform_buffer_object/compiler/uniform-block-memory-qualifier.frag

diff --git a/tests/spec/arb_shader_image_load_store/compiler/memory-qualifier-with-non-image-type.frag b/tests/spec/arb_shader_image_load_store/compiler/memory-qualifier-with-non-image-type.frag
deleted file mode 100644
index 71087ec21..000000000
--- a/tests/spec/arb_shader_image_load_store/compiler/memory-qualifier-with-non-image-type.frag
+++ /dev/null
@@ -1,25 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 3.30
-// require_extensions: GL_ARB_shader_image_load_store
-// [end config]
-
-#version 330
-#extension GL_ARB_shader_image_load_store: enable
-
-// From Section 4.10 (Memory Qualifiers) of the GLSL 4.50 spec:
-//
-// "Variables declared as image types (the basic opaque types with “image”
-//  in their keyword) can be further qualified with one or more of the
-//  following memory qualifiers: ..."
-//
-// Easy enough to infer that memory qualifiers should not be used with
-// non-image types.
-
-uniform Block {
-	volatile int x;
-};
-
-void main()
-{
-}
diff --git a/tests/spec/arb_uniform_buffer_object/compiler/uniform-block-memory-qualifier.frag b/tests/spec/arb_uniform_buffer_object/compiler/uniform-block-memory-qualifier.frag
new file mode 100644
index 000000000..5d0c6deb3
--- /dev/null
+++ b/tests/spec/arb_uniform_buffer_object/compiler/uniform-block-memory-qualifier.frag
@@ -0,0 +1,27 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// require_extensions: GL_ARB_uniform_buffer_object GL_ARB_shader_storage_buffer_object
+// [end config]
+
+#version 120
+#extension GL_ARB_uniform_buffer_object: require
+#extension GL_ARB_shader_storage_buffer_object: enable
+
+// From Section 4.10 (Memory Qualifiers) of the GLSL 4.50 spec:
+//
+// "Memory qualifiers are only supported in the declarations of image
+//  variables, buffer variables, and shader  storage blocks; it is an error to
+//  use such qualifiers in any other declarations."
+
+uniform Block {
+	readonly int a;
+	writeonly int b;
+	coherent int c;
+	volatile int d;
+	restrict int e;
+};
+
+void main()
+{
+}
-- 
2.12.2



More information about the Piglit mailing list