diff options
author | Marek Olšák <[email protected]> | 2013-06-30 18:29:17 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2013-07-08 20:25:18 +0200 |
commit | 1faa37557373aa29169aa4e3b95c6dcf5aced025 (patch) | |
tree | c8ea228ad17e5423a44c4f8e5f646ef3b8ec3759 /src | |
parent | 287b2fa115f95f675f7b7915777ed29d8e9d6f44 (diff) |
r600g: improve the mechanism for recognizing an empty CS
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/r600/r600_hw_context.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.h | 1 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index e2444cc5cdc..652329bfa3c 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -302,9 +302,6 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags) { struct radeon_winsys_cs *cs = ctx->rings.gfx.cs; - if (cs->cdw == ctx->start_cs_cmd.num_dw) - return; - ctx->nontimer_queries_suspended = false; ctx->streamout.suspended = false; @@ -418,6 +415,8 @@ void r600_begin_new_cs(struct r600_context *ctx) /* Re-emit the draw state. */ ctx->last_primitive_type = -1; ctx->last_start_instance = -1; + + ctx->initial_gfx_cs_size = ctx->rings.gfx.cs->cdw; } void r600_context_emit_fence(struct r600_context *ctx, struct r600_resource *fence_bo, unsigned offset, unsigned value) diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 8b67e85af19..a4e88ce0d7a 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -164,6 +164,9 @@ static void r600_flush(struct pipe_context *ctx, unsigned flags) unsigned render_cond_mode = 0; boolean render_cond_cond = FALSE; + if (rctx->rings.gfx.cs->cdw == rctx->initial_gfx_cs_size) + return; + rctx->rings.gfx.flushing = true; /* Disable render condition. */ if (rctx->current_render_cond) { @@ -181,6 +184,8 @@ static void r600_flush(struct pipe_context *ctx, unsigned flags) if (render_cond) { ctx->render_condition(ctx, render_cond, render_cond_cond, render_cond_mode); } + + rctx->initial_gfx_cs_size = rctx->rings.gfx.cs->cdw; } static void r600_flush_from_st(struct pipe_context *ctx, diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index d5f54c4482e..3fad311da2e 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -533,6 +533,7 @@ struct r600_context { struct u_suballocator *allocator_so_filled_size; struct u_suballocator *allocator_fetch_shader; struct util_slab_mempool pool_transfers; + unsigned initial_gfx_cs_size; /* Hardware info. */ enum radeon_family family; |