ir3: fix emitting descriptor prefetches at end of preamble

The fix in e7ac1094f6 to emit preamble defs in the correct block would
move the cursor of the builder that is later used to insert descriptor
prefetches, emitting them at the wrong place. Fix this by resetting the
cursor before emitting the prefetches.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: e7ac1094f6 ("ir3: rematerialize preamble defs in block dominated by sources")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33399>
This commit is contained in:
Job Noorman
2025-02-05 12:49:26 +01:00
committed by Marge Bot
parent e192d7d615
commit 8404e7428b
+2
View File
@@ -752,6 +752,8 @@ ir3_nir_opt_prefetch_descriptors(nir_shader *nir, struct ir3_shader_variant *v)
preamble_defs);
}
/* ir3_rematerialize_def_for_preamble may have moved the cursor. */
b.cursor = nir_after_impl(preamble);
progress |= emit_descriptor_prefetch(&b, instr, preamble_descs, &state);
if (state.sampler.num_prefetches == MAX_PREFETCHES &&