diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2021-04-20 15:08:17 -0400 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2021-04-21 21:38:46 +0200 |
commit | 80be401ef8c613fa5f3b3b554dcf4a864ff76a29 (patch) | |
tree | 9ca19ed1a050821ca81bda808719b128d735bc6a | |
parent | 9988f53d51d17a39bff2c48952c3d3eb5edc0fe0 (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>
(cherry picked from commit 04241e826eabf9fab16596d0454fffb48d476c93)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/.pick_status.json b/.pick_status.json index 5c3a3c20f1b..c2ae39c8ad2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -58,7 +58,7 @@ "description": "zink: add clear-on-flush mechanic deeper into flush codepath", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "104603fa763c52e98a79785dd514beab949546db" }, diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index dc054884a0a..be975cdc0b7 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1217,6 +1217,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); @@ -1699,12 +1702,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) { |