iris: Add missing nir_metadata_preserve in iris_lower_storage_image_derefs

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Fixes: 26a54ae4b2 ("iris: lower storage image derefs")
Closes: #12589
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33450>
(cherry picked from commit f2a01be57e)
This commit is contained in:
Ian Romanick 2025-02-07 09:52:17 -08:00 committed by Eric Engestrom
parent eabe6ec941
commit 1c8f1e820f
2 changed files with 9 additions and 1 deletions

View file

@ -504,7 +504,7 @@
"description": "iris: Add missing nir_metadata_preserve in iris_lower_storage_image_derefs",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "26a54ae4b26fc221e869af2c615ce0e8138e41d6",
"notes": null

View file

@ -773,6 +773,7 @@ iris_lower_storage_image_derefs(nir_shader *nir)
nir_function_impl *impl = nir_shader_get_entrypoint(nir);
nir_builder b = nir_builder_create(impl);
bool progress = false;
nir_foreach_block(block, impl) {
nir_foreach_instr_safe(instr, block) {
@ -797,6 +798,7 @@ iris_lower_storage_image_derefs(nir_shader *nir)
nir_iadd_imm(&b, get_aoa_deref_offset(&b, deref, 1),
var->data.driver_location);
nir_rewrite_image_intrinsic(intrin, index, false);
progress = true;
break;
}
@ -805,6 +807,12 @@ iris_lower_storage_image_derefs(nir_shader *nir)
}
}
}
if (progress) {
nir_metadata_preserve(impl, nir_metadata_control_flow);
} else {
nir_metadata_preserve(impl, nir_metadata_all);
}
}
static bool