mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-30 13:44:06 +08: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> (cherry picked from commite1b325f587
)
This commit is contained in:
parent
c63793dc47
commit
7e847fa52f
@ -3721,7 +3721,7 @@
|
||||
"description": "nir/builder: invalidate metadata per function",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "a62098fff202f5e6c689aa6e78ace67c50f17c8e"
|
||||
},
|
||||
|
@ -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…
Reference in New Issue
Block a user