diff options
author | Marek Olšák <[email protected]> | 2014-04-12 18:12:11 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-04-16 14:02:52 +0200 |
commit | 11459436d9314681087463f2c006c58b6fcff396 (patch) | |
tree | 3620c11c52f31e266783bfd74ad2d92bba3575f7 /src/gallium/drivers/r600 | |
parent | adfadeadd8316e95626fec4771393d32a70af649 (diff) |
r600g,radeonsi: share some of gfx flush code
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600')
-rw-r--r-- | src/gallium/drivers/r600/r600_hw_context.c | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index 6d3f7992708..a860519d911 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -236,35 +236,12 @@ void r600_context_gfx_flush(void *context, unsigned flags, 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) + if (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; - - /* suspend queries */ - if (ctx->b.num_cs_dw_nontimer_queries_suspend) { - r600_suspend_nontimer_queries(&ctx->b); - ctx->b.nontimer_queries_suspended = true; - } - - if (ctx->b.streamout.begin_emitted) { - r600_emit_streamout_end(&ctx->b); - ctx->b.streamout.suspended = true; - } + r600_preflush_suspend_features(&ctx->b); /* flush the framebuffer cache */ ctx->b.flags |= R600_CONTEXT_FLUSH_AND_INV | @@ -362,22 +339,7 @@ void r600_begin_new_cs(struct r600_context *ctx) r600_sampler_states_dirty(ctx, &samplers->states); } - if (ctx->b.streamout.suspended) { - ctx->b.streamout.append_bitmask = ctx->b.streamout.enabled_mask; - r600_streamout_buffers_dirty(&ctx->b); - } - - /* resume queries */ - if (ctx->b.nontimer_queries_suspended) { - 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); - } + r600_postflush_resume_features(&ctx->b); /* Re-emit the draw state. */ ctx->last_primitive_type = -1; |