From a1bbccf5214f95d8e23d6da88f51aae6032cbfe9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 29 Dec 2014 01:25:48 +0100 Subject: [PATCH] radeonsi: change TC cache flushing strategy for textures MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Michel Dänzer --- src/gallium/drivers/radeonsi/si_descriptors.c | 4 ---- src/gallium/drivers/radeonsi/si_state.c | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index 1644ec7a8d3..573787a991a 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -445,8 +445,6 @@ static void si_set_sampler_views(struct pipe_context *ctx, } } - sctx->b.flags |= SI_CONTEXT_INV_TC_L1 | - SI_CONTEXT_INV_TC_L2; si_update_descriptors(sctx, &samplers->views.desc); } @@ -671,8 +669,6 @@ void si_update_vertex_buffers(struct si_context *sctx) * on performance (confirmed by testing). New descriptors are always * uploaded to a fresh new buffer, so I don't think flushing the const * cache is needed. */ - sctx->b.flags |= SI_CONTEXT_INV_TC_L1 | - SI_CONTEXT_INV_TC_L2; } diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 4b146b5c86d..9e1b3cd6577 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -2004,6 +2004,12 @@ static void si_set_framebuffer_state(struct pipe_context *ctx, SI_CONTEXT_FLUSH_AND_INV_DB_META; } + /* Only flush TC when changing the framebuffer state, because + * the only client not using TC that can change textures is + * the framebuffer. */ + sctx->b.flags |= SI_CONTEXT_INV_TC_L1 | + SI_CONTEXT_INV_TC_L2; + util_copy_framebuffer_state(&sctx->framebuffer.state, state); sctx->framebuffer.export_16bpc = 0; -- 2.30.2