diff --git a/src/gallium/drivers/panfrost/pan_blit.c b/src/gallium/drivers/panfrost/pan_blit.c index 59c505bd297..610cee2e53d 100644 --- a/src/gallium/drivers/panfrost/pan_blit.c +++ b/src/gallium/drivers/panfrost/pan_blit.c @@ -34,7 +34,8 @@ static void panfrost_blitter_save( struct panfrost_context *ctx, - struct blitter_context *blitter) + struct blitter_context *blitter, + bool render_cond) { util_blitter_save_vertex_buffer_slot(blitter, ctx->vertex_buffers); @@ -59,6 +60,13 @@ panfrost_blitter_save( (struct pipe_sampler_view **)&ctx->sampler_views[PIPE_SHADER_FRAGMENT]); util_blitter_save_fragment_constant_buffer_slot(blitter, ctx->constant_buffer[PIPE_SHADER_FRAGMENT].cb); + + if (!render_cond) { + util_blitter_save_render_condition(blitter, + (struct pipe_query *) ctx->cond_query, + ctx->cond_cond, ctx->cond_mode); + } + } static bool @@ -72,7 +80,7 @@ panfrost_u_blitter_blit(struct pipe_context *pipe, /* TODO: Scissor */ - panfrost_blitter_save(ctx, ctx->blitter); + panfrost_blitter_save(ctx, ctx->blitter, info->render_condition_enable); util_blitter_blit(ctx->blitter, info); return true; @@ -86,6 +94,9 @@ panfrost_blit(struct pipe_context *pipe, * u_blitter. We could do a little better by culling * vertex jobs, though. */ + if (info->render_condition_enable && !pan_render_condition_check(pipe)) + return; + if (panfrost_u_blitter_blit(pipe, info)) return; diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 7dd324f634f..ed4a91e12ab 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -131,6 +131,9 @@ panfrost_clear( { struct panfrost_context *ctx = pan_context(pipe); + if (!pan_render_condition_check(pipe)) + return; + /* TODO: panfrost_get_fresh_batch_for_fbo() instantiates a new batch if * the existing batch targeting this FBO has draws. We could probably * avoid that by replacing plain clears by quad-draws with a specific @@ -457,6 +460,9 @@ panfrost_draw_vbo( struct panfrost_context *ctx = pan_context(pipe); struct panfrost_device *device = pan_device(ctx->base.screen); + if (!pan_render_condition_check(pipe)) + return; + /* First of all, check the scissor to see if anything is drawn at all. * If it's not, we drop the draw (mostly a conformance issue; * well-behaved apps shouldn't hit this) */