[Piglit] [PATCH] arb_bindless_texture: add test for conversion of bounded sampler2D to uvec2

Karol Herbst kherbst at redhat.com
Tue Apr 10 14:09:02 UTC 2018


conversion of bounded sampler2D to uvec2 is legal with
ARB_bindless_texture. Currently Mesa fails with an assert:

../src/compiler/glsl/opt_function_inlining.cpp:248:
void ir_call::generate_inline(ir_instruction*): Assertion `deref' failed.
---
 ...rithmetic-bounded-sampler-texture2D.shader_test | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 tests/spec/arb_bindless_texture/execution/samplers/basic-arithmetic-bounded-sampler-texture2D.shader_test

diff --git a/tests/spec/arb_bindless_texture/execution/samplers/basic-arithmetic-bounded-sampler-texture2D.shader_test b/tests/spec/arb_bindless_texture/execution/samplers/basic-arithmetic-bounded-sampler-texture2D.shader_test
new file mode 100644
index 000000000..5724aa93e
--- /dev/null
+++ b/tests/spec/arb_bindless_texture/execution/samplers/basic-arithmetic-bounded-sampler-texture2D.shader_test
@@ -0,0 +1,32 @@
+# Same as basic-texture2D.shader_test, but doing some uvec2 conversion and math
+# on a bounded sampler
+[require]
+GL >= 3.3
+GLSL >= 3.30
+GL_ARB_bindless_texture
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 330
+#extension GL_ARB_bindless_texture: require
+
+uniform sampler2D tex;
+uniform uvec2 handleOffset;
+
+out vec4 finalColor;
+
+void main()
+{
+	uvec2 handle = uvec2(tex);
+	handle.x -= 0x12345678u;
+	handle.y -= 0x9abcdef0u;
+	finalColor = texture2D(sampler2D(handle + handleOffset), vec2(0, 0));
+}
+
+[test]
+texture rgbw 0 (16, 16)
+uniform int tex 0
+uniform uvec2 handleOffset 0x12345678 0x9abcdef0
+draw rect -1 -1 2 2
+relative probe rgb (0.0, 0.0) (1.0, 0.0, 0.0)
-- 
2.14.3



More information about the Piglit mailing list