diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 7ebcb255ceb..e824d8d91fe 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -4580,7 +4580,7 @@ batch_get_polygon_list(struct panfrost_batch *batch) struct panfrost_device *dev = pan_device(batch->ctx->base.screen); if (!batch->tiler_ctx.midgard.polygon_list) { - bool has_draws = batch->scoreboard.first_tiler != NULL; + bool has_draws = batch->draw_count > 0; unsigned size = panfrost_tiler_get_polygon_list_size( dev, batch->key.width, batch->key.height, batch->tiler_ctx.vertex_count); diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index b19fc52ed81..3c564ad54ce 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -70,7 +70,7 @@ panfrost_clear(struct pipe_context *pipe, unsigned buffers, struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx); /* At the start of the batch, we can clear for free */ - if (!batch->scoreboard.first_job) { + if (batch->draw_count == 0) { panfrost_batch_clear(batch, buffers, color, depth, stencil); return; } diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index f08a77f2d69..c13cdbe73ad 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -229,7 +229,7 @@ panfrost_get_fresh_batch_for_fbo(struct panfrost_context *ctx, /* We only need to submit and get a fresh batch if there is no * draw/clear queued. Otherwise we may reuse the batch. */ - if (batch->scoreboard.first_job) { + if (batch->draw_count + batch->compute_count > 0) { perf_debug_ctx(ctx, "Flushing the current FBO due to: %s", reason); panfrost_batch_submit(ctx, batch); batch = panfrost_get_batch(ctx, &ctx->pipe_framebuffer); @@ -777,14 +777,13 @@ panfrost_batch_submit(struct panfrost_context *ctx, { struct pipe_screen *pscreen = ctx->base.screen; struct panfrost_screen *screen = pan_screen(pscreen); + bool has_frag = panfrost_has_fragment_job(batch); int ret; /* Nothing to do! */ - if (!batch->scoreboard.first_job && !batch->clear) + if (!has_frag && batch->compute_count == 0) goto out; - bool has_frag = panfrost_has_fragment_job(batch); - if (batch->key.zsbuf && has_frag) { struct pipe_surface *surf = batch->key.zsbuf; struct panfrost_resource *z_rsrc = pan_resource(surf->texture); diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h index 0f7236a0579..091682432b7 100644 --- a/src/gallium/drivers/panfrost/pan_job.h +++ b/src/gallium/drivers/panfrost/pan_job.h @@ -267,7 +267,7 @@ bool panfrost_batch_skip_rasterization(struct panfrost_batch *batch); static inline bool panfrost_has_fragment_job(struct panfrost_batch *batch) { - return batch->scoreboard.first_tiler || batch->clear; + return batch->draw_count > 0 || batch->clear; } #endif