From e63713079482fa1e34099619effc7e66af54ee92 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 Part-of: --- src/panfrost/compiler/bifrost/bifrost_compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panfrost/compiler/bifrost/bifrost_compile.c b/src/panfrost/compiler/bifrost/bifrost_compile.c index 02e30a1620d..da8d8a7c973 100644 --- a/src/panfrost/compiler/bifrost/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost/bifrost_compile.c @@ -3762,7 +3762,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 */