summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_hw_context.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-04-12 17:53:57 +0200
committerMarek Olšák <[email protected]>2014-04-16 14:02:51 +0200
commit586011486dba1c977d8f9aeb8f95b14e891afcbb (patch)
treec2cadf9eebeb4563febbe5382e45b472dc038f73 /src/gallium/drivers/r600/r600_hw_context.c
parentd4edc607670e37138f7a804ba208cf91acd9d0f1 (diff)
r600g: merge r600_flush with r600_context_flush
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_hw_context.c')
-rw-r--r--src/gallium/drivers/r600/r600_hw_context.c31
1 files changed, 29 insertions, 2 deletions
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;