From 2d16f457c544ce55c4f61b4533d743c50a84a24a Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Wed, 6 Aug 2025 21:40:58 +0200 Subject: [PATCH] nir: add ACCESS_SKIP_HELPERS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/compiler/nir/nir_divergence_analysis.c | 4 ++++ src/compiler/nir/nir_print.c | 1 + src/compiler/shader_enums.h | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/src/compiler/nir/nir_divergence_analysis.c b/src/compiler/nir/nir_divergence_analysis.c index ea4ef613b0d..56506b18213 100644 --- a/src/compiler/nir/nir_divergence_analysis.c +++ b/src/compiler/nir/nir_divergence_analysis.c @@ -973,6 +973,10 @@ visit_intrinsic(nir_intrinsic_instr *instr, struct divergence_state *state) #endif } + if (nir_intrinsic_has_access(instr) && + (nir_intrinsic_access(instr) & ACCESS_SKIP_HELPERS)) + is_divergent = true; + instr->def.divergent = is_divergent; return is_divergent; } diff --git a/src/compiler/nir/nir_print.c b/src/compiler/nir/nir_print.c index 4d01473ebf8..4a2132cda87 100644 --- a/src/compiler/nir/nir_print.c +++ b/src/compiler/nir/nir_print.c @@ -850,6 +850,7 @@ print_access(enum gl_access_qualifier access, print_state *state, const char *se { ACCESS_IN_BOUNDS, "in-bounds" }, { ACCESS_KEEP_SCALAR, "keep-scalar" }, { ACCESS_SMEM_AMD, "smem-amd" }, + { ACCESS_SKIP_HELPERS, "skip-helpers" }, }; bool first = true; diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h index 5a4eb55f3aa..7a0df2a62d5 100644 --- a/src/compiler/shader_enums.h +++ b/src/compiler/shader_enums.h @@ -1167,6 +1167,11 @@ enum gl_access_qualifier * Indicates that this load will use SMEM. */ ACCESS_SMEM_AMD = (1 << 16), + + /** + * Indicates that this load must be skipped by helper invocations. + */ + ACCESS_SKIP_HELPERS = (1 << 17), }; /**