assert(ctx->base.saved_fb_state.nr_cbufs != ~0);
}
+static void blitter_disable_render_cond(struct blitter_context_priv *ctx)
+{
+ struct pipe_context *pipe = ctx->base.pipe;
+
+ if (ctx->base.saved_render_cond_query) {
+ pipe->render_condition(pipe, NULL, 0);
+ }
+}
+
+static void blitter_restore_render_cond(struct blitter_context_priv *ctx)
+{
+ struct pipe_context *pipe = ctx->base.pipe;
+
+ if (ctx->base.saved_render_cond_query) {
+ pipe->render_condition(pipe, ctx->base.saved_render_cond_query,
+ ctx->base.saved_render_cond_mode);
+ ctx->base.saved_render_cond_query = NULL;
+ }
+}
+
static void blitter_restore_fb_state(struct blitter_context_priv *ctx)
{
struct pipe_context *pipe = ctx->base.pipe;
blitter_set_running_flag(ctx);
blitter_check_saved_vertex_states(ctx);
blitter_check_saved_fragment_states(ctx);
+ blitter_disable_render_cond(ctx);
/* bind states */
if (custom_blend) {
blitter_restore_vertex_states(ctx);
blitter_restore_fragment_states(ctx);
+ blitter_restore_render_cond(ctx);
blitter_unset_running_flag(ctx);
}
blitter_check_saved_fragment_states(ctx);
blitter_check_saved_textures(ctx);
blitter_check_saved_fb_state(ctx);
+ blitter_disable_render_cond(ctx);
/* Initialize framebuffer state. */
fb_state.width = dst->width;
blitter_restore_fragment_states(ctx);
blitter_restore_textures(ctx);
blitter_restore_fb_state(ctx);
+ blitter_restore_render_cond(ctx);
blitter_unset_running_flag(ctx);
}
blitter_check_saved_vertex_states(ctx);
blitter_check_saved_fragment_states(ctx);
blitter_check_saved_fb_state(ctx);
+ blitter_disable_render_cond(ctx);
/* bind states */
pipe->bind_blend_state(pipe, ctx->blend_write_color);
blitter_restore_vertex_states(ctx);
blitter_restore_fragment_states(ctx);
blitter_restore_fb_state(ctx);
+ blitter_restore_render_cond(ctx);
blitter_unset_running_flag(ctx);
}
blitter_check_saved_vertex_states(ctx);
blitter_check_saved_fragment_states(ctx);
blitter_check_saved_fb_state(ctx);
+ blitter_disable_render_cond(ctx);
/* bind states */
pipe->bind_blend_state(pipe, ctx->blend_keep_color);
blitter_restore_vertex_states(ctx);
blitter_restore_fragment_states(ctx);
blitter_restore_fb_state(ctx);
+ blitter_restore_render_cond(ctx);
blitter_unset_running_flag(ctx);
}
blitter_check_saved_vertex_states(ctx);
blitter_check_saved_fragment_states(ctx);
blitter_check_saved_fb_state(ctx);
+ blitter_disable_render_cond(ctx);
/* bind states */
pipe->bind_blend_state(pipe, ctx->blend_write_color);
blitter_restore_vertex_states(ctx);
blitter_restore_fragment_states(ctx);
blitter_restore_fb_state(ctx);
+ blitter_restore_render_cond(ctx);
blitter_unset_running_flag(ctx);
}
blitter_set_running_flag(ctx);
blitter_check_saved_vertex_states(ctx);
+ blitter_disable_render_cond(ctx);
vb.buffer = src;
vb.buffer_offset = srcx;
util_draw_arrays(pipe, PIPE_PRIM_POINTS, 0, size / 4);
blitter_restore_vertex_states(ctx);
+ blitter_restore_render_cond(ctx);
blitter_unset_running_flag(ctx);
pipe_so_target_reference(&so_target, NULL);
}
blitter_set_running_flag(ctx);
blitter_check_saved_vertex_states(ctx);
blitter_check_saved_fragment_states(ctx);
+ blitter_disable_render_cond(ctx);
/* bind states */
pipe->bind_blend_state(pipe, custom_blend);
blitter_restore_fb_state(ctx);
blitter_restore_vertex_states(ctx);
blitter_restore_fragment_states(ctx);
+ blitter_restore_render_cond(ctx);
blitter_unset_running_flag(ctx);
pipe_surface_reference(&srcsurf, NULL);
blitter_check_saved_vertex_states(ctx);
blitter_check_saved_fragment_states(ctx);
blitter_check_saved_fb_state(ctx);
+ blitter_disable_render_cond(ctx);
/* bind states */
pipe->bind_blend_state(pipe, custom_blend);
blitter_restore_vertex_states(ctx);
blitter_restore_fragment_states(ctx);
blitter_restore_fb_state(ctx);
+ blitter_restore_render_cond(ctx);
blitter_unset_running_flag(ctx);
}
}
if ((op & R600_DISABLE_RENDER_COND) && rctx->current_render_cond) {
- rctx->saved_render_cond = rctx->current_render_cond;
- rctx->saved_render_cond_mode = rctx->current_render_cond_mode;
- rctx->context.render_condition(&rctx->context, NULL, 0);
- }
-
+ util_blitter_save_render_condition(rctx->blitter,
+ rctx->current_render_cond,
+ rctx->current_render_cond_mode);
+ }
}
static void r600_blitter_end(struct pipe_context *ctx)
{
struct r600_context *rctx = (struct r600_context *)ctx;
- if (rctx->saved_render_cond) {
- rctx->context.render_condition(&rctx->context,
- rctx->saved_render_cond,
- rctx->saved_render_cond_mode);
- rctx->saved_render_cond = NULL;
- }
- r600_resume_nontimer_queries(rctx);
+ r600_resume_nontimer_queries(rctx);
}
static unsigned u_max_layer(struct pipe_resource *r, unsigned level)