Mesa (master): ir3: Fix txs with bindless

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 14 16:36:42 UTC 2020


Module: Mesa
Branch: master
Commit: 31988baba48e974240af68aff84f8c5620d2e62a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=31988baba48e974240af68aff84f8c5620d2e62a

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Tue Apr 14 11:35:50 2020 +0200

ir3: Fix txs with bindless

I missed that this had a micro-optimization to assume that there was
only ever one source, which is no longer valid for the bindless model
since we now have a bindless handle source. Remove the optimization to
fix assertion failures with turnip.

Fixes e.g.
dEQP-VK.glsl.texture_functions.query.texturesize.sampler2d_fixed_vertex

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4548>

---

 src/freedreno/ir3/ir3_compiler_nir.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c
index 365870509b3..307eded893a 100644
--- a/src/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/freedreno/ir3/ir3_compiler_nir.c
@@ -2548,10 +2548,10 @@ emit_tex_txs(struct ir3_context *ctx, nir_tex_instr *tex)
 
 	dst = ir3_get_dst(ctx, &tex->dest, 4);
 
-	compile_assert(ctx, tex->num_srcs == 1);
-	compile_assert(ctx, tex->src[0].src_type == nir_tex_src_lod);
+	int lod_idx = nir_tex_instr_src_index(tex, nir_tex_src_lod);
+	compile_assert(ctx, lod_idx >= 0);
 
-	lod = ir3_get_src(ctx, &tex->src[0].src)[0];
+	lod = ir3_get_src(ctx, &tex->src[lod_idx].src)[0];
 
 	sam = emit_sam(ctx, OPC_GETSIZE, info, dst_type, 0b1111, lod, NULL);
 	ir3_split_dest(b, dst, sam, 0, 4);



More information about the mesa-commit mailing list