radeonsi/ngg: add VGT_FLUSH when enabling fast launch
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 30 Jan 2020 11:16:46 +0000 (12:16 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 5 Feb 2020 10:27:54 +0000 (10:27 +0000)
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2418
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2426
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2434
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3675>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3675>

src/gallium/drivers/radeonsi/si_state_draw.c

index 2f87896ead6c778718d83dd70ab12c1345bc5e1a..96fa59145ae81207446dcabbd001b15ec9606723 100644 (file)
@@ -2080,6 +2080,11 @@ static void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *i
                }
 
                if (ngg_culling != sctx->ngg_culling) {
+                       /* Insert a VGT_FLUSH when enabling fast launch changes to prevent hangs.
+                       * See issues #2418, #2426, #2434
+                       */
+                       if (ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL)
+                               sctx->flags |= SI_CONTEXT_VGT_FLUSH;
                        sctx->ngg_culling = ngg_culling;
                        sctx->do_update_shaders = true;
                }