diff --git a/.pick_status.json b/.pick_status.json index 4372dfceef0..dc11b9d1f02 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4711,7 +4711,7 @@ "description": "panfrost: Fix clears with conditional rendering", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "638b22354e75fa31551f776a2cd2bbf752db1ad5" }, diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 30f30ed261d..7dd8f179ccc 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -61,12 +61,15 @@ panfrost_clear( const union pipe_color_union *color, double depth, unsigned stencil) { + if (!panfrost_render_condition_check(pan_context(pipe))) + return; + + /* Only get batch after checking the render condition, since the check can + * cause the batch to be flushed. + */ struct panfrost_context *ctx = pan_context(pipe); struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx); - if (!panfrost_render_condition_check(ctx)) - return; - /* At the start of the batch, we can clear for free */ if (!batch->scoreboard.first_job) { panfrost_batch_clear(batch, buffers, color, depth, stencil);