[Piglit] [PATCH 1/2] arb_shader_image_load_store: add new compiler tests with qualifiers and functions

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed May 3 13:33:50 UTC 2017


func-param-restrict-qualifier.frag currently fails with Mesa
because the GLSL 4.50 has been relaxed the restrict qualifier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 .../compiler/func-param-additional-qualifiers.frag | 29 ++++++++++++++++++++++
 .../compiler/func-param-lack-qualifiers.frag       | 28 +++++++++++++++++++++
 .../compiler/func-param-restrict-qualifier.frag    | 23 +++++++++++++++++
 3 files changed, 80 insertions(+)
 create mode 100644 tests/spec/arb_shader_image_load_store/compiler/func-param-additional-qualifiers.frag
 create mode 100644 tests/spec/arb_shader_image_load_store/compiler/func-param-lack-qualifiers.frag
 create mode 100644 tests/spec/arb_shader_image_load_store/compiler/func-param-restrict-qualifier.frag

diff --git a/tests/spec/arb_shader_image_load_store/compiler/func-param-additional-qualifiers.frag b/tests/spec/arb_shader_image_load_store/compiler/func-param-additional-qualifiers.frag
new file mode 100644
index 000000000..4d6b881d3
--- /dev/null
+++ b/tests/spec/arb_shader_image_load_store/compiler/func-param-additional-qualifiers.frag
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: pass
+// 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:
+//
+// "It is legal to have any additional memory qualifiers on a formal
+//  parameter..."
+
+layout(rgba32f) uniform image2D img1;
+layout(rgba32f) uniform image2D img2;
+layout(rgba32f) uniform image2D img3;
+writeonly uniform image2D img4;
+
+void f1(restrict coherent image2D i) {}
+void f2(volatile writeonly image2D i) {}
+
+void main()
+{
+	f1(img1);
+	f1(img2);
+	f1(img3);
+	f2(img4);
+}
diff --git a/tests/spec/arb_shader_image_load_store/compiler/func-param-lack-qualifiers.frag b/tests/spec/arb_shader_image_load_store/compiler/func-param-lack-qualifiers.frag
new file mode 100644
index 000000000..63e185d91
--- /dev/null
+++ b/tests/spec/arb_shader_image_load_store/compiler/func-param-lack-qualifiers.frag
@@ -0,0 +1,28 @@
+// [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 qualified with coherent, volatile, readonly, or writeonly may
+//  not be passed to functions whose formal parameters lack such qualifiers."
+
+layout(rgba32f) coherent uniform image2D img1;
+layout(rgba32f) volatile uniform image2D img2;
+layout(rgba32f) readonly uniform image2D img3;
+writeonly uniform image2D img4;
+
+void f(image2D i) {}
+
+void main()
+{
+	f(img1);
+	f(img2);
+	f(img3);
+	f(img4);
+}
diff --git a/tests/spec/arb_shader_image_load_store/compiler/func-param-restrict-qualifier.frag b/tests/spec/arb_shader_image_load_store/compiler/func-param-restrict-qualifier.frag
new file mode 100644
index 000000000..76f92b974
--- /dev/null
+++ b/tests/spec/arb_shader_image_load_store/compiler/func-param-restrict-qualifier.frag
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: pass
+// 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:
+//
+// "It is legal to have any additional memory qualifiers on a formal parameter,
+//  but only  restrict  can be taken away from a calling argument, by a formal
+//  parameter that lacks the restrict qualifier."
+
+layout(rgba32f) restrict uniform image2D img;
+
+void f(image2D i) {}
+
+void main()
+{
+	f(img);
+}
-- 
2.12.2



More information about the Piglit mailing list