ir3: use the correct builder for adding preamble to main.

ir3 switches builder from main to preamble, but then adds
instructions to main using the preamble builder.

This wasn't a problem before, but we now store function impl
in blocks and this breaks that.

Reviewed-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41950>
This commit is contained in:
Dave Airlie 2026-06-11 12:15:09 +10:00 committed by Marge Bot
parent 67ded3d079
commit 0e2e2dedf0

View file

@ -964,6 +964,7 @@ ir3_nir_lower_preamble(nir_shader *nir, struct ir3_shader_variant *v)
*/
/* @decl_regs need to stay in the first block. */
b = &builder_main;
b->cursor = nir_after_reg_decls(main);
nir_if *outer_if = nir_push_if(b, nir_preamble_start_ir3(b, 1));