diff --git a/src/gallium/drivers/asahi/agx_batch.c b/src/gallium/drivers/asahi/agx_batch.c index 40374b79688..e67b9f3f652 100644 --- a/src/gallium/drivers/asahi/agx_batch.c +++ b/src/gallium/drivers/asahi/agx_batch.c @@ -60,6 +60,7 @@ agx_batch_init(struct agx_context *ctx, batch->clear_depth = 0; batch->clear_stencil = 0; batch->varyings = 0; + batch->any_draws = false; /* We need to emit prim state at the start. Max collides with all. */ batch->reduced_prim = PIPE_PRIM_MAX; diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 453df377503..a40fc8168f6 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -964,8 +964,8 @@ agx_flush_batch(struct agx_context *ctx, struct agx_batch *batch) assert(agx_batch_is_active(batch)); - /* Nothing to do */ - if (!(batch->draw | batch->clear)) { + /* Make sure there's something to submit. */ + if (!batch->clear && !batch->any_draws) { agx_batch_cleanup(ctx, batch); return; } diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 11d6f00d564..ccf3094b779 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -2424,6 +2424,8 @@ agx_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info, batch->resolve |= ctx->zs->store; } + batch->any_draws = true; + if (agx_update_vs(ctx)) ctx->dirty |= AGX_DIRTY_VS | AGX_DIRTY_VS_PROG; else if (ctx->stage[PIPE_SHADER_VERTEX].dirty) diff --git a/src/gallium/drivers/asahi/agx_state.h b/src/gallium/drivers/asahi/agx_state.h index 6133f4de40f..4279cdab12f 100644 --- a/src/gallium/drivers/asahi/agx_state.h +++ b/src/gallium/drivers/asahi/agx_state.h @@ -162,6 +162,7 @@ struct agx_batch { /* PIPE_CLEAR_* bitmask */ uint32_t clear, draw, load, resolve; + bool any_draws; uint64_t uploaded_clear_color[PIPE_MAX_COLOR_BUFS]; double clear_depth;