pan/bi: Use bi_half() for texture MS indices

It feeds into a v2i16 so it needs to be 16-bit.

Fixes: ae79f6765a ("pan/bi: Emit Valhall texture instructions")
Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com>
(cherry picked from commit e637130794)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40979>
This commit is contained in:
Faith Ekstrand 2026-03-29 01:58:26 -04:00 committed by Eric Engestrom
parent cb93fe85b9
commit e8955066a7
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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 */