ir3/cp: swap back correct srcs when swap failed

While making the swapping code generic, the swap-back path was left as
is causing the wrong sources to be swapped.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 00656526d8 ("ir3/cp: extract common src swapping code")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32920>
This commit is contained in:
Job Noorman 2025-01-07 11:00:36 +01:00 committed by Marge Bot
parent ac2046c5b0
commit b5c99e6f57

View file

@ -227,7 +227,7 @@ try_swap_two_srcs(struct ir3_instruction *instr, unsigned n, unsigned new_flags,
if (!valid_swap) {
/* put things back the way they were: */
swap(instr->srcs[0], instr->srcs[1]);
swap(instr->srcs[swap_n], instr->srcs[n]);
} else {
/* otherwise leave things swapped */
instr->cat3.swapped = true;