mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
nir: call nir_metadata_preserve in nir_io_add_const_offset_to_base
This is necessary to use this pass with the NIR_PASS() macro. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12448>
This commit is contained in:
parent
0d9ead8ca2
commit
f10d4bf963
1 changed files with 7 additions and 1 deletions
|
|
@ -2827,11 +2827,17 @@ nir_io_add_const_offset_to_base(nir_shader *nir, nir_variable_mode modes)
|
|||
|
||||
nir_foreach_function(f, nir) {
|
||||
if (f->impl) {
|
||||
bool impl_progress = false;
|
||||
nir_builder b;
|
||||
nir_builder_init(&b, f->impl);
|
||||
nir_foreach_block(block, f->impl) {
|
||||
progress |= add_const_offset_to_base_block(block, &b, modes);
|
||||
impl_progress |= add_const_offset_to_base_block(block, &b, modes);
|
||||
}
|
||||
progress |= impl_progress;
|
||||
if (impl_progress)
|
||||
nir_metadata_preserve(f->impl, nir_metadata_block_index | nir_metadata_dominance);
|
||||
else
|
||||
nir_metadata_preserve(f->impl, nir_metadata_all);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue