mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-03 15:10:37 +01: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
1e4967c184
commit
bcf16071a7
2 changed files with 5 additions and 3 deletions
|
|
@ -94,7 +94,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…
Add table
Reference in a new issue