diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 3de6de3970d..ae45a1a405c 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -2024,7 +2024,9 @@ zink_maybe_flush_or_stall(struct zink_context *ctx) { struct zink_screen *screen = zink_screen(ctx->base.screen); /* flush anytime our total batch memory usage is potentially >= 50% of total video memory */ - if (ctx->batch.state->resource_size >= screen->total_video_mem / 2) + if (ctx->batch.state->resource_size >= screen->total_video_mem / 2 || + /* or if there's >100k draws+computes */ + ctx->batch.state->work_count[0] + ctx->batch.state->work_count[1] >= 100000) flush_batch(ctx, true); if (ctx->resource_size >= screen->total_video_mem / 2 || _mesa_hash_table_num_entries(&ctx->batch_states) > 100) { diff --git a/src/gallium/drivers/zink/zink_draw.c b/src/gallium/drivers/zink/zink_draw.c index 12c6aa6caf0..2f0db2d9480 100644 --- a/src/gallium/drivers/zink/zink_draw.c +++ b/src/gallium/drivers/zink/zink_draw.c @@ -714,8 +714,6 @@ zink_draw_vbo(struct pipe_context *pctx, screen->vk_CmdEndTransformFeedbackEXT(batch->state->cmdbuf, 0, ctx->num_so_targets, counter_buffers, counter_buffer_offsets); } batch->has_work = true; - if (batch->state->work_count[0] + batch->state->work_count[1] >= 100000) - pctx->flush(pctx, NULL, 0); } void @@ -754,6 +752,4 @@ zink_launch_grid(struct pipe_context *pctx, const struct pipe_grid_info *info) } else vkCmdDispatch(batch->state->cmdbuf, info->grid[0], info->grid[1], info->grid[2]); batch->has_work = true; - if (batch->state->work_count[0] + batch->state->work_count[1] >= 100000) - pctx->flush(pctx, NULL, 0); }