zink: trigger pending clears during flush
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 4 Nov 2020 14:08:14 +0000 (09:08 -0500)
committerMarge Bot <eric+marge@anholt.net>
Tue, 23 Mar 2021 17:14:05 +0000 (17:14 +0000)
this applies all pending fb clears at the time of flush to handle the scenario
of start -> clear() -> flush() properly

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9726>

src/gallium/drivers/zink/zink_context.c

index f12f4df..c19c45d 100644 (file)
@@ -1783,6 +1783,11 @@ zink_flush(struct pipe_context *pctx,
    struct zink_batch *batch = zink_batch_g(ctx);
    struct zink_fence *fence = &batch->state->fence;
 
+   if (!deferred && ctx->clears_enabled) {
+      /* start rp to do all the clears */
+      zink_begin_render_pass(ctx, batch);
+   }
+
    if (deferred)
       batch->state->fence.deferred_ctx = pctx;
    else if (batch->has_work) {