From 8040b797a821af9b91e1dd6014e596e6f8d9e1a2 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 17 Nov 2020 11:23:35 +0100 Subject: [PATCH] pan/bi: Only update LOD mode on TEX operations If we don't add this check we clobber fetch mode when a 0 LOD is specified on a txf instruction. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 7b51543190f..d8aeb727484 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -2006,7 +2006,9 @@ emit_texc(bi_context *ctx, nir_tex_instr *instr) break; case nir_tex_src_lod: - if (nir_src_is_const(instr->src[i].src) && nir_src_as_uint(instr->src[i].src) == 0) { + if (desc.op == BIFROST_TEX_OP_TEX && + nir_src_is_const(instr->src[i].src) && + nir_src_as_uint(instr->src[i].src) == 0) { desc.lod_or_fetch = BIFROST_LOD_MODE_ZERO; } else if (desc.op == BIFROST_TEX_OP_TEX) { assert(base == nir_type_float);