ac/nir/ngg: Move divergence analysis call to analyze_shader_before_culling.
authorTimur Kristóf <timur.kristof@gmail.com>
Fri, 17 Mar 2023 19:19:10 +0000 (12:19 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 21 Mar 2023 15:47:32 +0000 (15:47 +0000)
It actually belongs there.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21995>

src/amd/common/ac_nir_lower_ngg.c

index e7ce1ec..8f28f83 100644 (file)
@@ -1057,6 +1057,9 @@ analyze_shader_before_culling_walk(nir_ssa_def *ssa,
 static void
 analyze_shader_before_culling(nir_shader *shader, lower_ngg_nogs_state *nogs_state)
 {
+   /* We need divergence info for culling shaders. */
+   nir_divergence_analysis(shader);
+
    nir_foreach_function(func, shader) {
       nir_foreach_block(block, func->impl) {
          nir_foreach_instr(instr, block) {
@@ -2284,8 +2287,6 @@ ac_nir_lower_ngg_nogs(nir_shader *shader, const ac_nir_lower_ngg_options *option
    nir_builder_init(b, impl);
 
    if (options->can_cull) {
-      /* We need divergence info for culling shaders. */
-      nir_divergence_analysis(shader);
       analyze_shader_before_culling(shader, &state);
       save_reusable_variables(b, &state);
    }