From fada46cf99a04bd4d4ff2249444e5173fbc54a96 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Wed, 21 Jun 2023 14:02:57 +0200 Subject: [PATCH] nir: add helper to clear all pass_flags Will be used in different places so lets move it to a common place. Signed-off-by: Christian Gmeiner Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir.c | 12 ++++++++++++ src/compiler/nir/nir.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c index 4bca3aa7d21..cc424f54463 100644 --- a/src/compiler/nir/nir.c +++ b/src/compiler/nir/nir.c @@ -2264,6 +2264,18 @@ nir_index_instrs(nir_function_impl *impl) return index; } +void +nir_shader_clear_pass_flags(nir_shader *shader) +{ + nir_foreach_function_impl(impl, shader) { + nir_foreach_block(block, impl) { + nir_foreach_instr(instr, block) { + instr->pass_flags = 0; + } + } + } +} + unsigned nir_shader_index_vars(nir_shader *shader, nir_variable_mode modes) { diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 602e027961d..e0d65447aa1 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -4647,6 +4647,8 @@ unsigned nir_index_instrs(nir_function_impl *impl); void nir_index_blocks(nir_function_impl *impl); +void nir_shader_clear_pass_flags(nir_shader *shader); + unsigned nir_shader_index_vars(nir_shader *shader, nir_variable_mode modes); unsigned nir_function_impl_index_vars(nir_function_impl *impl);