summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/radeonsi/si_hw_context.c
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-05-06 17:14:29 -0500
committerNicolai Hähnle <nicolai.haehnle@amd.com>2016-06-01 22:52:20 +0200
commit89ba076de4c8cfa171365700e6a3b017d5e3eeff (patch)
tree26319856e9ee655d47e938596798c42226e39cb0 /src/gallium/drivers/radeonsi/si_hw_context.c
parenta7c26bfc0ce9d12def9f05a84c19f51f3d311aaa (diff)
radeon/winsys: introduce radeon_winsys_cs_chunk
We will chain multiple chunks together and will keep pointers to the older chunks to support IB dumping. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_hw_context.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_hw_context.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c
index c25b264ec5c..fa6a2cbef0b 100644
--- a/src/gallium/drivers/radeonsi/si_hw_context.c
+++ b/src/gallium/drivers/radeonsi/si_hw_context.c
@@ -130,13 +130,19 @@ void si_context_gfx_flush(void *context, unsigned flags,
si_trace_emit(ctx);
if (ctx->is_debug) {
+ uint32_t *buf;
unsigned i;
/* Save the IB for debug contexts. */
free(ctx->last_ib);
- ctx->last_ib_dw_size = cs->cdw;
- ctx->last_ib = malloc(cs->cdw * 4);
- memcpy(ctx->last_ib, cs->buf, cs->cdw * 4);
+ ctx->last_ib_dw_size = cs->prev_dw + cs->current.cdw;
+ ctx->last_ib = malloc(ctx->last_ib_dw_size * 4);
+ buf = ctx->last_ib;
+ for (i = 0; i < cs->num_prev; ++i) {
+ memcpy(buf, cs->prev[i].buf, cs->prev[i].cdw * 4);
+ buf += cs->prev[i].cdw;
+ }
+ memcpy(buf, cs->current.buf, cs->current.cdw * 4);
r600_resource_reference(&ctx->last_trace_buf, ctx->trace_buf);
r600_resource_reference(&ctx->trace_buf, NULL);
@@ -232,7 +238,8 @@ void si_begin_new_cs(struct si_context *ctx)
r600_postflush_resume_features(&ctx->b);
- ctx->b.initial_gfx_cs_size = ctx->b.gfx.cs->cdw;
+ assert(!ctx->b.gfx.cs->prev_dw);
+ ctx->b.initial_gfx_cs_size = ctx->b.gfx.cs->current.cdw;
/* Invalidate various draw states so that they are emitted before
* the first draw call. */