ir3: fix handle_partial_const with vectorized src

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 50a91fbf87 ("freedreno/ir3: cleanup "partially const" ubo srcs")
(cherry picked from commit c27f0406b0)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40979>
This commit is contained in:
Job Noorman 2026-04-03 08:18:08 +02:00 committed by Eric Engestrom
parent 7b5ed90bdc
commit fa14f8e6d5
2 changed files with 4 additions and 3 deletions

View file

@ -4714,7 +4714,7 @@
"description": "ir3: fix handle_partial_const with vectorized src",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "50a91fbf87c346469a0cfa17f7742cdd2643893a",
"notes": null

View file

@ -218,6 +218,7 @@ handle_partial_const(nir_builder *b, nir_def **srcp, int *offp)
return;
nir_alu_instr *alu = nir_def_as_alu((*srcp));
assert(alu->def.num_components == 1);
if (alu->op == nir_op_imad24_ir3) {
/* This case is slightly more complicated as we need to
@ -238,9 +239,9 @@ handle_partial_const(nir_builder *b, nir_def **srcp, int *offp)
if (nir_src_is_const(alu->src[0].src)) {
*offp += nir_src_as_uint(alu->src[0].src);
*srcp = alu->src[1].src.ssa;
*srcp = nir_mov_alu(b, alu->src[1], 1);
} else if (nir_src_is_const(alu->src[1].src)) {
*srcp = alu->src[0].src.ssa;
*srcp = nir_mov_alu(b, alu->src[0], 1);
*offp += nir_src_as_uint(alu->src[1].src);
}
}