radeonsi: move fixing ngg_culling into si_update_shaders
authorMarek Olšák <marek.olsak@amd.com>
Sun, 14 Aug 2022 07:57:58 +0000 (03:57 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 30 Aug 2022 04:57:43 +0000 (04:57 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18195>

src/gallium/drivers/radeonsi/si_state_draw.cpp

index 89ac7e9..055f591 100644 (file)
@@ -377,6 +377,12 @@ static bool si_update_shaders(struct si_context *sctx)
       }
    }
 
+   /* si_shader_select_with_key can clear the ngg_culling in the shader key if the shader
+    * compilation hasn't finished. Set it to the same value in si_context.
+    */
+   if (GFX_VERSION >= GFX10 && NGG)
+      sctx->ngg_culling = si_get_vs_inline(sctx, HAS_TESS, HAS_GS)->current->key.ge.opt.ngg_culling;
+
    sctx->do_update_shaders = false;
    return true;
 }
@@ -2437,12 +2443,6 @@ static void si_draw(struct pipe_context *ctx,
          DRAW_CLEANUP;
          return;
       }
-
-      /* si_update_shaders can clear the ngg_culling in the shader key if the shader compilation
-       * hasn't finished. Set it to the correct value in si_context.
-       */
-      if (GFX_VERSION >= GFX10 && NGG)
-         sctx->ngg_culling = si_get_vs_inline(sctx, HAS_TESS, HAS_GS)->current->key.ge.opt.ngg_culling;
    }
 
    /* Since we've called si_context_add_resource_size for vertex buffers,