From 31988baba48e974240af68aff84f8c5620d2e62a Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Tue, 14 Apr 2020 11:35:50 +0200 Subject: [PATCH] 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: --- 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); -- 2.30.2