[Mesa-dev] [PATCH 5/6] r600g: invalidate caches at the beginning of CS

Marek Olšák maraeo at gmail.com
Mon Apr 2 08:10:57 PDT 2012


---
 src/gallium/drivers/r600/r600_hw_context.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c
index 46c8c04..e898a59 100644
--- a/src/gallium/drivers/r600/r600_hw_context.c
+++ b/src/gallium/drivers/r600/r600_hw_context.c
@@ -1197,7 +1197,16 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags)
 	ctx->pm4_dirty_cdwords = 0;
 	ctx->flags = 0;
 
+	/* Begin a new CS. */
 	r600_emit_atom(ctx, &ctx->start_cs_cmd.atom);
+
+	/* Invalidate caches. */
+	r600_inval_vertex_cache(ctx);
+	r600_inval_texture_cache(ctx);
+	r600_inval_shader_cache(ctx);
+	r600_flush_framebuffer(ctx, false);
+
+	/* Re-emit states. */
 	r600_atom_dirty(ctx, &ctx->db_misc_state.atom);
 	r600_atom_dirty(ctx, &ctx->vertex_buffer_state);
 
-- 
1.7.5.4



More information about the mesa-dev mailing list