[Mesa-dev] [RFC PATCH] radeonsi: flush DB caches when a Z/stencil buffer is attached

Samuel Pitoiset samuel.pitoiset at gmail.com
Tue Jul 25 13:29:05 UTC 2017


This is a workaround which fixes a rendering issue with Dawn
Of War III in full bindless mode because a depth texture most
likely doesn't invoke the decompression pass when it should.

Performance drops by 1% which doesn't really matter.

Fixes: 2263610827 ("radeonsi: flush DB caches only when transitioning from DB to texturing")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Cc: "17.2" <mesa-stable at lists.freedesktop.org>
---
 src/gallium/drivers/radeonsi/si_state.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 7e3d1a02e0..675b61ad7f 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2546,6 +2546,16 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
 	}
 	sctx->b.flags |= SI_CONTEXT_CS_PARTIAL_FLUSH;
 
+	/* Flush DB caches when a Z/stencil buffer is attached to the
+	 * framebuffer. This is a workaround which fixes a rendering issue with
+	 * Dawn Of War III in full bindless mode because a depth texture most
+	 * likely doesn't invoke the decompression pass when it should.
+	 *
+	 * TODO: Figure out a better fix.
+	 */
+	if (sctx->framebuffer.state.zsbuf)
+		sctx->b.flags |= SI_CONTEXT_FLUSH_AND_INV_DB;
+
 	/* u_blitter doesn't invoke depth decompression when it does multiple
 	 * blits in a row, but the only case when it matters for DB is when
 	 * doing generate_mipmap. So here we flush DB manually between
-- 
2.13.3



More information about the mesa-dev mailing list