From a9eb83a15f3c125e67e2c7d7b31328fb1954f138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 25 Aug 2024 18:16:19 -0400 Subject: [PATCH] radeonsi: don't sync CS and PS before rendering if there are no FBO attachments because CB/DB don't read/write anything in that case Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_barrier.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_barrier.c b/src/gallium/drivers/radeonsi/si_barrier.c index d368ca62dce..83c0f6771b2 100644 --- a/src/gallium/drivers/radeonsi/si_barrier.c +++ b/src/gallium/drivers/radeonsi/si_barrier.c @@ -727,8 +727,10 @@ static void si_set_sampler_depth_decompress_mask(struct si_context *sctx, struct void si_fb_barrier_before_rendering(struct si_context *sctx) { /* Wait for all shaders because all image loads must finish before CB/DB can write there. */ - sctx->barrier_flags |= SI_BARRIER_SYNC_CS | SI_BARRIER_SYNC_PS; - si_mark_atom_dirty(sctx, &sctx->atoms.s.barrier); + if (sctx->framebuffer.state.nr_cbufs || sctx->framebuffer.state.zsbuf) { + sctx->barrier_flags |= SI_BARRIER_SYNC_CS | SI_BARRIER_SYNC_PS; + si_mark_atom_dirty(sctx, &sctx->atoms.s.barrier); + } } void si_fb_barrier_after_rendering(struct si_context *sctx, unsigned flags)