[Mesa-dev] [PATCH 03/12] radeonsi: take scratch buffer and draw indirect memory usage into account

Marek Olšák maraeo at gmail.com
Fri Jul 29 21:42:42 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeonsi/si_state_draw.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index 24fa682..6f87721 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -983,6 +983,12 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
 	if (sctx->b.flags)
 		si_mark_atom_dirty(sctx, sctx->atoms.s.cache_flush);
 
+	/* Add buffer sizes for memory checking in need_cs_space. */
+	if (sctx->emit_scratch_reloc && sctx->scratch_buffer)
+		r600_context_add_resource_size(ctx, &sctx->scratch_buffer->b.b);
+	if (info->indirect)
+		r600_context_add_resource_size(ctx, info->indirect);
+
 	si_need_cs_space(sctx);
 
 	/* Emit states. */
-- 
2.7.4



More information about the mesa-dev mailing list