pan/va: Fix nir_op_pack_uvec4_to_uint

We don't have a generic v4i8 on Valhall, we have to lower it to two
v2i8. Fortunately, bi_make_vec_to() hides the Bifrost/Valhall
differences, so use that for nir_op_pack_uvec4_to_uint.

Fixes: 934b0f1add ("pan/bi: Respect swizzles for more vector ops")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31280>
This commit is contained in:
Boris Brezillon 2024-09-20 15:45:49 +02:00 committed by Marge Bot
parent 35ea8b6cd2
commit dc1a7b94a8

View file

@ -2462,11 +2462,15 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
bi_index src = bi_src_index(&instr->src[0].src);
assert(sz == 32 && src_sz == 32);
bi_mkvec_v4i8_to(
b, dst, bi_byte(bi_extract(b, src, instr->src[0].swizzle[0]), 0),
bi_byte(bi_extract(b, src, instr->src[0].swizzle[1]), 0),
bi_byte(bi_extract(b, src, instr->src[0].swizzle[2]), 0),
bi_byte(bi_extract(b, src, instr->src[0].swizzle[3]), 0));
bi_index srcs[4] = {
bi_extract(b, src, instr->src[0].swizzle[0]),
bi_extract(b, src, instr->src[0].swizzle[1]),
bi_extract(b, src, instr->src[0].swizzle[2]),
bi_extract(b, src, instr->src[0].swizzle[3]),
};
unsigned channels[4] = {0};
bi_make_vec_to(b, dst, srcs, channels, 4, 8);
return;
}