From 586011486dba1c977d8f9aeb8f95b14e891afcbb Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 12 Apr 2014 17:53:57 +0200 Subject: r600g: merge r600_flush with r600_context_flush MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Christian König --- src/gallium/drivers/r600/r600_hw_context.c | 31 ++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/r600/r600_hw_context.c') diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index 60260eea0c5..6d3f7992708 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -230,11 +230,28 @@ void r600_flush_emit(struct r600_context *rctx) rctx->b.flags = 0; } -void r600_context_flush(struct r600_context *ctx, unsigned flags, - struct pipe_fence_handle **fence) +void r600_context_gfx_flush(void *context, unsigned flags, + struct pipe_fence_handle **fence) { + struct r600_context *ctx = context; struct radeon_winsys_cs *cs = ctx->b.rings.gfx.cs; + if (ctx->b.rings.gfx.cs->cdw == ctx->b.initial_gfx_cs_size) + return; + + ctx->b.rings.gfx.flushing = true; + + /* Disable render condition. */ + ctx->b.saved_render_cond = NULL; + ctx->b.saved_render_cond_cond = FALSE; + ctx->b.saved_render_cond_mode = 0; + if (ctx->b.current_render_cond) { + ctx->b.saved_render_cond = ctx->b.current_render_cond; + ctx->b.saved_render_cond_cond = ctx->b.current_render_cond_cond; + ctx->b.saved_render_cond_mode = ctx->b.current_render_cond_mode; + ctx->b.b.render_condition(&ctx->b.b, NULL, FALSE, 0); + } + ctx->b.nontimer_queries_suspended = false; ctx->b.streamout.suspended = false; @@ -272,6 +289,9 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags, /* Flush the CS. */ ctx->b.ws->cs_flush(cs, flags, fence, ctx->screen->b.cs_count++); + ctx->b.rings.gfx.flushing = false; + + r600_begin_new_cs(ctx); } void r600_begin_new_cs(struct r600_context *ctx) @@ -352,6 +372,13 @@ void r600_begin_new_cs(struct r600_context *ctx) r600_resume_nontimer_queries(&ctx->b); } + /* Re-enable render condition. */ + if (ctx->b.saved_render_cond) { + ctx->b.b.render_condition(&ctx->b.b, ctx->b.saved_render_cond, + ctx->b.saved_render_cond_cond, + ctx->b.saved_render_cond_mode); + } + /* Re-emit the draw state. */ ctx->last_primitive_type = -1; ctx->last_start_instance = -1; -- cgit v1.2.3