mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
nir/builder: invalidate metadata per function
Fixes: a62098fff2 ("nir: Add a helper for general instruction-modifying passes.")
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12324>
This commit is contained in:
parent
a57bcc4394
commit
e1b325f587
1 changed files with 4 additions and 2 deletions
|
|
@ -103,17 +103,19 @@ nir_shader_instructions_pass(nir_shader *shader,
|
|||
if (!function->impl)
|
||||
continue;
|
||||
|
||||
bool func_progress = false;
|
||||
nir_builder b;
|
||||
nir_builder_init(&b, function->impl);
|
||||
|
||||
nir_foreach_block_safe(block, function->impl) {
|
||||
nir_foreach_instr_safe(instr, block) {
|
||||
progress |= pass(&b, instr, cb_data);
|
||||
func_progress |= pass(&b, instr, cb_data);
|
||||
}
|
||||
}
|
||||
|
||||
if (progress) {
|
||||
if (func_progress) {
|
||||
nir_metadata_preserve(function->impl, preserved);
|
||||
progress = true;
|
||||
} else {
|
||||
nir_metadata_preserve(function->impl, nir_metadata_all);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue