Mesa (main): zink: improve oom flushing
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jul 27 00:35:24 UTC 2021
Module: Mesa
Branch: main
Commit: 907e4a0f0284f2ed370f9fa52cf24999c86aea59
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=907e4a0f0284f2ed370f9fa52cf24999c86aea59
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Tue Jun 1 08:08:02 2021 -0400
zink: improve oom flushing
flush on 30k works and also check oom_flush
Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12010>
---
src/gallium/drivers/zink/zink_draw.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp
index 9afcf8b999b..c06e25d92f8 100644
--- a/src/gallium/drivers/zink/zink_draw.cpp
+++ b/src/gallium/drivers/zink/zink_draw.cpp
@@ -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>
More information about the mesa-commit
mailing list