zink: improve oom flushing

flush on 30k works and also check oom_flush

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12010>
This commit is contained in:
Mike Blumenkrantz
2021-06-01 08:08:02 -04:00
committed by Marge Bot
parent 9460c350b1
commit 907e4a0f02
+4 -4
View File
@@ -754,8 +754,8 @@ zink_draw_vbo(struct pipe_context *pctx,
batch->has_work = true;
ctx->batch.work_count = work_count;
/* flush if there's >100k draws */
if (unlikely(work_count >= 100000))
pctx->flush(pctx, NULL, PIPE_FLUSH_ASYNC);
if (unlikely(work_count >= 30000) || ctx->oom_flush)
pctx->flush(pctx, NULL, 0);
}
template <bool BATCH_CHANGED>
@@ -807,8 +807,8 @@ zink_launch_grid(struct pipe_context *pctx, const struct pipe_grid_info *info)
vkCmdDispatch(batch->state->cmdbuf, info->grid[0], info->grid[1], info->grid[2]);
batch->has_work = true;
/* flush if there's >100k computes */
if (unlikely(ctx->batch.work_count >= 100000))
pctx->flush(pctx, NULL, PIPE_FLUSH_ASYNC);
if (unlikely(ctx->batch.work_count >= 30000) || ctx->oom_flush)
pctx->flush(pctx, NULL, 0);
}
template <zink_multidraw HAS_MULTIDRAW, zink_dynamic_state HAS_DYNAMIC_STATE, bool BATCH_CHANGED>