aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/ir3/ir3_compiler_nir.c
diff options
context:
space:
mode:
authorConnor Abbott <[email protected]>2020-04-14 11:35:50 +0200
committerMarge Bot <[email protected]>2020-04-14 16:25:34 +0000
commit31988baba48e974240af68aff84f8c5620d2e62a (patch)
treef16abf903d30ba91cc00a64868201267911ae9de /src/freedreno/ir3/ir3_compiler_nir.c
parentacf7e73be54c7f1cc52fcc9be38a9df26849200e (diff)
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>
Diffstat (limited to 'src/freedreno/ir3/ir3_compiler_nir.c')
-rw-r--r--src/freedreno/ir3/ir3_compiler_nir.c6
1 files 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);