pan/bi: Run bifrost_nir_lower_algebraic_late while there is progress

With v11 needing specific lowering, we now need to run it multiple time
to ensure every new instructions materialized aren't invalid.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Benjamin Lee <benjamin.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33867>
This commit is contained in:
Mary Guillemard
2025-03-04 10:12:40 +01:00
committed by Marge Bot
parent 54ce78c4e1
commit cbc42abdb3

View File

@@ -5177,8 +5177,13 @@ bi_optimize_nir(nir_shader *nir, unsigned gpu_id, bool is_blend)
NIR_PASS(progress, nir, nir_lower_bool_to_bitsize);
/* Prepass to simplify instruction selection */
late_algebraic = false;
NIR_PASS(late_algebraic, nir, bifrost_nir_lower_algebraic_late, pan_arch(gpu_id));
bool late_algebraic_progress = true;
while (late_algebraic_progress) {
late_algebraic_progress = false;
NIR_PASS(late_algebraic_progress, nir, bifrost_nir_lower_algebraic_late,
pan_arch(gpu_id));
late_algebraic |= late_algebraic_progress;
}
while (late_algebraic) {
late_algebraic = false;