diff options
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 36e93f43831..315619dc246 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1885,17 +1885,19 @@ zink_flush(struct pipe_context *pctx, util_queue_fence_signal(&mfence->ready); } } - if (fence && !(flags & (PIPE_FLUSH_DEFERRED | PIPE_FLUSH_ASYNC))) - sync_flush(ctx, zink_batch_state(fence)); - - if (flags & PIPE_FLUSH_END_OF_FRAME && !(flags & TC_FLUSH_ASYNC) && !deferred) { - /* if the first frame has not yet occurred, we need an explicit fence here - * in some cases in order to correctly draw the first frame, though it's - * unknown at this time why this is the case - */ - if (!ctx->first_frame_done) - zink_vkfence_wait(screen, fence, PIPE_TIMEOUT_INFINITE); - ctx->first_frame_done = true; + if (fence) { + if (!(flags & (PIPE_FLUSH_DEFERRED | PIPE_FLUSH_ASYNC))) + sync_flush(ctx, zink_batch_state(fence)); + + if (flags & PIPE_FLUSH_END_OF_FRAME && !(flags & TC_FLUSH_ASYNC) && !deferred) { + /* if the first frame has not yet occurred, we need an explicit fence here + * in some cases in order to correctly draw the first frame, though it's + * unknown at this time why this is the case + */ + if (!ctx->first_frame_done) + zink_vkfence_wait(screen, fence, PIPE_TIMEOUT_INFINITE); + ctx->first_frame_done = true; + } } } |