From c33a930ceaeaa33c7b564609bb4415de104707f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 22 Jan 2022 09:56:39 -0500 Subject: [PATCH] radeonsi/gfx11: emit SQ_NON_EVENT for tessellation at the end of IBs Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_gfx_cs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_gfx_cs.c b/src/gallium/drivers/radeonsi/si_gfx_cs.c index e902b311052..5199d30fb0f 100644 --- a/src/gallium/drivers/radeonsi/si_gfx_cs.c +++ b/src/gallium/drivers/radeonsi/si_gfx_cs.c @@ -115,6 +115,16 @@ void si_flush_gfx_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_h if (ctx->chip_class >= GFX7) si_cp_dma_wait_for_idle(ctx, &ctx->gfx_cs); + /* If we use s_sendmsg to set tess factors to all 0 or all 1 instead of writing to the tess + * factor buffer, we need this at the end of command buffers: + */ + if (ctx->chip_class == GFX11 && ctx->tess_rings) { + radeon_begin(cs); + radeon_emit(PKT3(PKT3_EVENT_WRITE, 0, 0)); + radeon_emit(EVENT_TYPE(V_028A90_SQ_NON_EVENT) | EVENT_INDEX(0)); + radeon_end(); + } + /* Wait for draw calls to finish if needed. */ if (wait_flags) { ctx->flags |= wait_flags;