From 60b2920575e831ba06706c7e132ee1d15def1f3d Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Thu, 13 Feb 2025 16:58:27 +0100 Subject: [PATCH] pan/bi: Stop using S16_TO_F32 in nir_texop_lod computation on v11+ This was removed on v11. Signed-off-by: Mary Guillemard Reviewed-by: Lars-Ivar Hesselberg Simonsen Part-of: --- src/panfrost/compiler/bifrost_compile.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index 8fb69866435..07143701180 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -4169,7 +4169,14 @@ bi_emit_tex_valhall(bi_builder *b, nir_tex_instr *instr) I->force_delta_enable = true; I->lod_clamp_disable = i != 0; I->register_format = BI_REGISTER_FORMAT_U32; - bi_index lod = bi_s16_to_f32(b, bi_half(grdesc, 0)); + bi_index lod; + + /* v11 removed S16_TO_F32 */ + if (b->shader->arch >= 11) { + lod = bi_s32_to_f32(b, bi_s16_to_s32(b, bi_half(grdesc, 0))); + } else { + lod = bi_s16_to_f32(b, bi_half(grdesc, 0)); + } lod = bi_fmul_f32(b, lod, bi_imm_f32(1.0f / 256));