On 04/27/2017 02:24 AM, Timothy Arceri wrote:
Same comment for 3-5 as for comment 2. I'd rather see varyables function params and return values used as frag/vert outputs otherwise there is no guarantee the compiler won't just optimise the invalid uses away.

I think it's a bit overkill. Most of the compiler tests in piglit are really pretty simple. Looks like only very few of them guarantee that the compiler won't optimize. Yeah, it's sad.

I have written and tested this series against NV blob. At least, this one doesn't need anything else because it fails as-is.


On 27/04/17 08:52, Samuel Pitoiset wrote:
"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 <[email protected]>
---
.../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);
+}

_______________________________________________
Piglit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to