From 8d3ce4eb06e2a27069c8b9f90edb04e8c5da4e30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20Pi=C3=B1eiro?= Date: Mon, 18 Jul 2022 15:28:16 +0200 Subject: [PATCH] nir: call nir_metadata_preserve at nir_remove_unused_io_vars Without it we got a metadata assert: deqp-vk: ../src/compiler/nir/nir_metadata.c:108: nir_metadata_check_validation_flag: Assertion `!(function->impl->valid_metadata & nir_metadata_not_properly_reset)' failed if we try to use NIR_PASS(_, instead of NIR_PASS_V (that among other things, do more validations). Reviewed-by: Iago Toral Quiroga Reviewed-by: Timothy Arceri Part-of: --- src/compiler/nir/nir_linking_helpers.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c index 8304e82..4a607b1 100644 --- a/src/compiler/nir/nir_linking_helpers.c +++ b/src/compiler/nir/nir_linking_helpers.c @@ -172,8 +172,14 @@ nir_remove_unused_io_vars(nir_shader *shader, } } - if (progress) + nir_function_impl *impl = nir_shader_get_entrypoint(shader); + if (progress) { + nir_metadata_preserve(impl, nir_metadata_dominance | + nir_metadata_block_index); nir_fixup_deref_modes(shader); + } else { + nir_metadata_preserve(impl, nir_metadata_all); + } return progress; } -- 2.7.4