radeonsi: only do VGT_FLUSH for fast launch if previous draw was normal launch

Fixes: 3da91b3327 - radeonsi/ngg: add VGT_FLUSH when enabling fast launch

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7542>
This commit is contained in:
Marek Olšák 2020-10-16 11:37:16 -04:00 committed by Marge Bot
parent c4ebdf9ee7
commit 8d2876a343
2 changed files with 6 additions and 1 deletions

View File

@ -425,6 +425,10 @@ void si_begin_new_gfx_cs(struct si_context *ctx, bool first_cs)
ctx->flags |= SI_CONTEXT_INV_ICACHE | SI_CONTEXT_INV_SCACHE | SI_CONTEXT_INV_VCACHE |
SI_CONTEXT_INV_L2 | SI_CONTEXT_START_PIPELINE_STATS;
/* We don't know if the last draw call used GS fast launch, so assume it didn't. */
if (ctx->ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL)
ctx->flags |= SI_CONTEXT_VGT_FLUSH;
radeon_add_to_buffer_list(ctx, ctx->gfx_cs, ctx->border_color_buffer,
RADEON_USAGE_READ, RADEON_PRIO_BORDER_COLORS);
if (ctx->shadowed_regs) {

View File

@ -2104,7 +2104,8 @@ static void si_draw_vbo(struct pipe_context *ctx,
/* 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)
if (ngg_culling & SI_NGG_CULL_GS_FAST_LAUNCH_ALL &&
!(sctx->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;