[Piglit] [PATCH 5/6] arb_bindless_texture: add inout-non-matching-type.frag compiler tests

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Apr 26 22:52:35 UTC 2017


"Replace Section 4.1.X, (Images)"

    "As function parameters, images may be only passed to images
     of matching type."

"Replace Section 4.1.7 (Samplers), p. 25"

    "As function parameters, samplers may be only passed to samplers
     of matching type."

Two simple test cases to make sure types are checked.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 .../compiler/images/inout-non-matching-type.frag   | 26 ++++++++++++++++++++++
 .../compiler/samplers/inout-non-matching-type.frag | 25 +++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag
 create mode 100644 tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag

diff --git a/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag b/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag
new file mode 100644
index 000000000..0ff8d5bc9
--- /dev/null
+++ b/tests/spec/arb_bindless_texture/compiler/images/inout-non-matching-type.frag
@@ -0,0 +1,26 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture GL_ARB_shader_image_load_store
+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+#extension GL_ARB_shader_image_load_store: enable
+
+// The ARB_bindless_texture spec says:
+//
+//  "Replace Section 4.1.X, (Images)"
+//
+//  "As function parameters, images may be only passed to images of
+//   matching type."
+
+void f(inout image2D p)
+{
+}
+
+void main()
+{
+	writeonly image1D u;
+	f(u);
+}
diff --git a/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag b/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag
new file mode 100644
index 000000000..25a5724cf
--- /dev/null
+++ b/tests/spec/arb_bindless_texture/compiler/samplers/inout-non-matching-type.frag
@@ -0,0 +1,25 @@
+// [config]
+// expect_result: fail
+// glsl_version: 3.30
+// require_extensions: GL_ARB_bindless_texture
+// [end config]
+
+#version 330
+#extension GL_ARB_bindless_texture: require
+
+// The ARB_bindless_texture spec says:
+//
+//  "Replace Section 4.1.7 (Samplers), p. 25"
+//
+//  "As function parameters, samplers may be only passed to samplers of
+//   matching type."
+
+void f(inout sampler2D p)
+{
+}
+
+void main()
+{
+	sampler1D u;
+	f(u);
+}
-- 
2.12.2



More information about the Piglit mailing list