From e8955066a7fe1437f5a789b63aab1a61af70f5c0 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Sun, 29 Mar 2026 01:58:26 -0400 Subject: [PATCH] pan/bi: Use bi_half() for texture MS indices It feeds into a v2i16 so it needs to be 16-bit. Fixes: ae79f6765a37 ("pan/bi: Emit Valhall texture instructions") Reviewed-by: Lorenzo Rossi (cherry picked from commit e63713079482fa1e34099619effc7e66af54ee92) Part-of: --- .pick_status.json | 2 +- src/panfrost/compiler/bifrost/bifrost_compile.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index fdda3c95747..15cd0dfad39 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3924,7 +3924,7 @@ "description": "pan/bi: Use bi_half() for texture MS indices", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ae79f6765a371ca3d6f612bdf607f29ae35101c7", "notes": null diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.c b/src/panfrost/compiler/bifrost/bifrost_compile.c index 344a10948a6..7e111c4834f 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost/bifrost_compile.c @@ -4035,7 +4035,8 @@ bi_emit_valhall_offsets(bi_builder *b, nir_tex_instr *instr) /* Component 2: multisample index */ if (ms_idx >= 0 && (!nir_src_is_const(instr->src[ms_idx].src) || nir_src_as_uint(instr->src[ms_idx].src) != 0)) { - dest = bi_mkvec_v2i16(b, dest, bi_src_index(&instr->src[ms_idx].src)); + bi_index ms = bi_src_index(&instr->src[ms_idx].src); + dest = bi_mkvec_v2i16(b, bi_half(dest, false), bi_half(ms, false)); } /* Component 3: 8-bit LOD */