diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2021-04-20 15:08:17 -0400 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-04-21 14:18:17 +0000 |
commit | 04241e826eabf9fab16596d0454fffb48d476c93 (patch) | |
tree | f4536bb7f4bb1346b510854ab1e3fe01fbcfa054 | |
parent | be6532ecdfa448919f277c07391d38dcc50a6ab4 (diff) |
zink: add clear-on-flush mechanic deeper into flush codepath
we should probably trigger this any time a flush occurs just to avoid
doing too much (unexpected) cmdstream rewriting
both calls must be kept, however, as the one in the base flush hook will change
the behavior of flushing if no other work is queued
Fixes: 104603fa763 ("zink: create separate linear tiling image for scanout")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10358>
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 709fce66bca..92e9228e4ea 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1235,6 +1235,9 @@ static void flush_batch(struct zink_context *ctx, bool sync) { struct zink_batch *batch = &ctx->batch; + if (ctx->clears_enabled) + /* start rp to do all the clears */ + zink_begin_render_pass(ctx, batch); zink_end_render_pass(ctx, batch); zink_end_batch(ctx, batch); @@ -1717,12 +1720,10 @@ zink_flush(struct pipe_context *pctx, struct zink_fence *fence = NULL; struct zink_screen *screen = zink_screen(ctx->base.screen); - if (!deferred) { - if (ctx->clears_enabled) - /* start rp to do all the clears */ - zink_begin_render_pass(ctx, batch); - zink_end_render_pass(ctx, batch); - } + /* triggering clears will force has_work */ + if (!deferred && ctx->clears_enabled) + /* start rp to do all the clears */ + zink_begin_render_pass(ctx, batch); if (!batch->has_work) { if (pfence) { |