zink: split draw_count checking to local variable
Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11965>
This commit is contained in:

committed by
Marge Bot

parent
49ee703e11
commit
1ffe73c71a
@@ -420,6 +420,7 @@ zink_draw_vbo(struct pipe_context *pctx,
|
||||
bool mode_changed = ctx->gfx_pipeline_state.mode != dinfo->mode;
|
||||
bool reads_drawid = ctx->shader_reads_drawid;
|
||||
bool reads_basevertex = ctx->shader_reads_basevertex;
|
||||
unsigned draw_count = ctx->batch.state->draw_count;
|
||||
|
||||
update_barriers(ctx, false);
|
||||
|
||||
@@ -688,7 +689,7 @@ zink_draw_vbo(struct pipe_context *pctx,
|
||||
}
|
||||
|
||||
bool needs_drawid = reads_drawid && ctx->drawid_broken;
|
||||
batch->state->draw_count += num_draws;
|
||||
draw_count += num_draws;
|
||||
if (index_size > 0) {
|
||||
if (dindirect && dindirect->buffer) {
|
||||
assert(num_draws == 1);
|
||||
@@ -750,9 +751,10 @@ 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;
|
||||
ctx->batch.state->draw_count = draw_count;
|
||||
/* flush if there's >100k draws */
|
||||
if (unlikely(ctx->batch.state->resource_size >= zink_screen(ctx->base.screen)->total_video_mem / 2 ||
|
||||
ctx->batch.state->draw_count >= 100000))
|
||||
if (unlikely(ctx->batch.state->resource_size >= screen->total_video_mem / 2 ||
|
||||
draw_count >= 100000))
|
||||
pctx->flush(pctx, NULL, PIPE_FLUSH_ASYNC);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user