brw: fix brw_nir_move_interpolation_to_top

In a case like this :
   block_0:
      %5 = ...
      %6 = ...
      block_1:
         %7 = load_interpolated_input %5, %6

The current logic would move load_interpolated_input to block_0 before
%5 but not move %5 & %6 which are sources of that instruction.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34109>
This commit is contained in:
Lionel Landwerlin 2025-04-30 12:47:53 +03:00 committed by Marge Bot
parent 5ff1b31c3f
commit 6230f3029f

View file

@ -2481,12 +2481,9 @@ brw_nir_move_interpolation_to_top(nir_shader *nir)
instr
};
for (unsigned i = 0; i < ARRAY_SIZE(move); i++) {
if (move[i]->block != top) {
nir_instr_move(cursor, move[i]);
impl_progress = true;
}
}
for (unsigned i = 0; i < ARRAY_SIZE(move); i++)
nir_instr_move(cursor, move[i]);
impl_progress = true;
}
}