From edb60c76e29914f7fc2407f2e635ac372aa1508d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 27 Apr 2026 22:10:01 -0400 Subject: [PATCH] nir: generalize nir_vertex_divergence_analysis -> nir_custom_divergence_analysis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Timur Kristóf Part-of: --- src/compiler/nir/nir.h | 2 +- src/compiler/nir/nir_divergence_analysis.c | 6 +++--- src/compiler/nir/nir_opt_varyings.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 541f7bd878d..b2e8100b020 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -6640,7 +6640,7 @@ void nir_convert_loop_to_lcssa(nir_loop *loop); bool nir_convert_to_lcssa(nir_shader *shader, bool skip_invariants, bool skip_bool_invariants); void nir_divergence_analysis_impl(nir_function_impl *impl, nir_divergence_options options); void nir_divergence_analysis(nir_shader *shader); -void nir_vertex_divergence_analysis(nir_shader *shader); +void nir_custom_divergence_analysis(nir_shader *shader, nir_divergence_options options); bool nir_has_divergent_loop(nir_shader *shader); void diff --git a/src/compiler/nir/nir_divergence_analysis.c b/src/compiler/nir/nir_divergence_analysis.c index 6d4c64db4b3..2ae88f5d06d 100644 --- a/src/compiler/nir/nir_divergence_analysis.c +++ b/src/compiler/nir/nir_divergence_analysis.c @@ -1637,10 +1637,10 @@ nir_divergence_analysis(nir_shader *shader) * pass. */ void -nir_vertex_divergence_analysis(nir_shader *shader) +nir_custom_divergence_analysis(nir_shader *shader, + nir_divergence_options options) { - nir_divergence_options options = - shader->options->divergence_analysis_options | nir_divergence_vertex; + options |= shader->options->divergence_analysis_options; nir_foreach_function_impl(impl, shader) { nir_divergence_analysis_impl(impl, options); diff --git a/src/compiler/nir/nir_opt_varyings.c b/src/compiler/nir/nir_opt_varyings.c index 54ee5bbc611..18387eb3997 100644 --- a/src/compiler/nir/nir_opt_varyings.c +++ b/src/compiler/nir/nir_opt_varyings.c @@ -5426,7 +5426,7 @@ nir_opt_varyings(nir_shader *producer, nir_shader *consumer, bool spirv, * divergence information. */ if (consumer->info.stage == MESA_SHADER_FRAGMENT) { - nir_vertex_divergence_analysis(producer); + nir_custom_divergence_analysis(producer, nir_divergence_vertex); } /* This also removes dead varyings. */