[Piglit] [PATCH] arb_shader_image_load_store: test duplicate format qualifier more thoroughly

Timothy Arceri timothy.arceri at collabora.com
Tue Jan 19 15:25:51 PST 2016


>From the ARB_shader_image_load_store spec:

   "Only one format qualifier may be specified for any image variable
    declaration."
---
 .../gen_shader_image_load_store_tests.py           | 15 +++++++++++
 ...aration-format-qualifier-duplicate-420pack.frag | 28 +++++++++++++++++++++
 ...aration-format-qualifier-duplicate-420pack.vert | 28 +++++++++++++++++++++
 ...ormat-qualifier-duplicate-enhanced-layouts.frag | 29 ++++++++++++++++++++++
 ...ormat-qualifier-duplicate-enhanced-layouts.vert | 29 ++++++++++++++++++++++
 5 files changed, 129 insertions(+)
 create mode 100644 tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-420pack.frag
 create mode 100644 tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-420pack.vert
 create mode 100644 tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-enhanced-layouts.frag
 create mode 100644 tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-enhanced-layouts.vert

diff --git a/generated_tests/gen_shader_image_load_store_tests.py b/generated_tests/gen_shader_image_load_store_tests.py
index 8d6be9c..ee27808 100644
--- a/generated_tests/gen_shader_image_load_store_tests.py
+++ b/generated_tests/gen_shader_image_load_store_tests.py
@@ -473,6 +473,21 @@ gen('declaration-format-qualifier-duplicate', """\
     }
 """, shader_stages)
 
+gen('declaration-format-qualifier-duplicate-within-layout', """\
+    ${header('fail')}
+    /*
+     * From the ARB_shader_image_load_store spec:
+     *
+     * "Only one format qualifier may be specified for any image variable
+     *  declaration."
+     */
+    layout(rgba32f, rgba32f) uniform image2D img;
+
+    void main()
+    {
+    }
+""", shader_stages)
+
 gen('declaration-format-qualifier-missing', """\
     ${header(status)}
     /*
diff --git a/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-420pack.frag b/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-420pack.frag
new file mode 100644
index 0000000..1ea3749
--- /dev/null
+++ b/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-420pack.frag
@@ -0,0 +1,28 @@
+/*
+ * [config]
+ * expect_result: fail
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_shader_image_load_store GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_shader_image_load_store: require
+#extension GL_ARB_shading_language_420pack: require
+
+/*
+ * From the ARB_shader_image_load_store spec:
+ *
+ *   "Only one format qualifier may be specified for any image variable
+ *    declaration."
+ *
+ * From the ARB_shading_language_420pack spec:
+ *
+ *   "More than one layout qualifier may appear in a single declaration. If
+ *   the same layout-qualifier-name occurs in multiple layout qualifiers for
+ *   the same declaration, the last one overrides the former ones."
+ */
+layout(rgba32f) layout(rgba32f) uniform image2D img;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-420pack.vert b/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-420pack.vert
new file mode 100644
index 0000000..1ea3749
--- /dev/null
+++ b/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-420pack.vert
@@ -0,0 +1,28 @@
+/*
+ * [config]
+ * expect_result: fail
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_shader_image_load_store GL_ARB_shading_language_420pack
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_shader_image_load_store: require
+#extension GL_ARB_shading_language_420pack: require
+
+/*
+ * From the ARB_shader_image_load_store spec:
+ *
+ *   "Only one format qualifier may be specified for any image variable
+ *    declaration."
+ *
+ * From the ARB_shading_language_420pack spec:
+ *
+ *   "More than one layout qualifier may appear in a single declaration. If
+ *   the same layout-qualifier-name occurs in multiple layout qualifiers for
+ *   the same declaration, the last one overrides the former ones."
+ */
+layout(rgba32f) layout(rgba32f) uniform image2D img;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-enhanced-layouts.frag b/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-enhanced-layouts.frag
new file mode 100644
index 0000000..f1bb73d
--- /dev/null
+++ b/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-enhanced-layouts.frag
@@ -0,0 +1,29 @@
+/*
+ * [config]
+ * expect_result: fail
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_shader_image_load_store GL_ARB_enhanced_layouts
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_shader_image_load_store: require
+#extension GL_ARB_enhanced_layouts: require
+
+/*
+ * From the ARB_shader_image_load_store spec:
+ *
+ *   "Only one format qualifier may be specified for any image variable
+ *    declaration."
+ *
+ *  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"
+ */
+layout(rgba32f, rgba32f) uniform image2D img;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-enhanced-layouts.vert b/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-enhanced-layouts.vert
new file mode 100644
index 0000000..f1bb73d
--- /dev/null
+++ b/tests/spec/arb_shader_image_load_store/compiler/declaration-format-qualifier-duplicate-enhanced-layouts.vert
@@ -0,0 +1,29 @@
+/*
+ * [config]
+ * expect_result: fail
+ * glsl_version: 1.50
+ * require_extensions: GL_ARB_shader_image_load_store GL_ARB_enhanced_layouts
+ * [end config]
+ */
+#version 150
+#extension GL_ARB_shader_image_load_store: require
+#extension GL_ARB_enhanced_layouts: require
+
+/*
+ * From the ARB_shader_image_load_store spec:
+ *
+ *   "Only one format qualifier may be specified for any image variable
+ *    declaration."
+ *
+ *  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"
+ */
+layout(rgba32f, rgba32f) uniform image2D img;
+
+void main()
+{
+}
-- 
2.4.3



More information about the Piglit mailing list