From 878d8d96c759bbc594218fea3d55a7db2c1bad13 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 7 Oct 2021 16:53:03 -0500 Subject: [PATCH] nir/lower_discard_or_demote: Fix metadata Passes generally shouldn't use nir_metadata_all unless they don't change the program in any significant way. Some of these passes insert new instructions so they should definitely not be preserving most of it. Reviewed-by: Emma Anholt Part-of: --- src/compiler/nir/nir_lower_discard_or_demote.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/compiler/nir/nir_lower_discard_or_demote.c b/src/compiler/nir/nir_lower_discard_or_demote.c index 5857dcaa76d..c3c3c3e17e5 100644 --- a/src/compiler/nir/nir_lower_discard_or_demote.c +++ b/src/compiler/nir/nir_lower_discard_or_demote.c @@ -164,7 +164,10 @@ nir_lower_discard_or_demote(nir_shader *shader, */ progress = nir_shader_instructions_pass(shader, nir_lower_discard_to_demote_instr, - nir_metadata_all, + nir_metadata_block_index | + nir_metadata_dominance | + nir_metadata_live_ssa_defs | + nir_metadata_instr_index, NULL); shader->info.fs.uses_demote = true; } else if (!shader->info.fs.needs_quad_helper_invocations && @@ -173,7 +176,8 @@ nir_lower_discard_or_demote(nir_shader *shader, /* If we don't need any helper invocations, convert demote to discard. */ progress = nir_shader_instructions_pass(shader, nir_lower_demote_to_discard_instr, - nir_metadata_all, + nir_metadata_block_index | + nir_metadata_dominance, NULL); shader->info.fs.uses_demote = false; } else if (shader->info.fs.uses_demote && @@ -184,7 +188,8 @@ nir_lower_discard_or_demote(nir_shader *shader, nir_ssa_def *is_helper = NULL; progress = nir_shader_instructions_pass(shader, nir_lower_load_helper_to_is_helper, - nir_metadata_all, + nir_metadata_block_index | + nir_metadata_dominance, &is_helper); BITSET_CLEAR(shader->info.system_values_read, nir_system_value_from_intrinsic(nir_intrinsic_load_helper_invocation));