From 1528c6f524baaa7aaf51194b5beb5746de5862db Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Sun, 11 Feb 2024 15:41:46 +0100 Subject: [PATCH] zink: Always set mfence->submit_count to the fence submit_count Fixes glFinish not finishing all GPU work. cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8257 Part-of: (cherry picked from commit aed5e4e1f2bcbad5a63d483cf97bf7c30ca9cccc) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_context.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 6af5bb6196f..68b4b11395a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -7194,7 +7194,7 @@ "description": "zink: Always set mfence->submit_count to the fence submit_count", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 5916839c37b..63eb340e7b3 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3803,7 +3803,6 @@ zink_flush(struct pipe_context *pctx, struct zink_batch *batch = &ctx->batch; struct zink_fence *fence = NULL; struct zink_screen *screen = zink_screen(ctx->base.screen); - unsigned submit_count = 0; VkSemaphore export_sem = VK_NULL_HANDLE; /* triggering clears will force has_work */ @@ -3882,7 +3881,6 @@ zink_flush(struct pipe_context *pctx, tc_driver_internal_flush_notify(ctx->tc); } else { fence = &batch->state->fence; - submit_count = batch->state->usage.submit_count; if (deferred && !(flags & PIPE_FLUSH_FENCE_FD) && pfence) deferred_fence = true; else @@ -3906,7 +3904,7 @@ zink_flush(struct pipe_context *pctx, mfence->fence = fence; mfence->sem = export_sem; if (fence) { - mfence->submit_count = submit_count; + mfence->submit_count = zink_batch_state(fence)->usage.submit_count; util_dynarray_append(&fence->mfences, struct zink_tc_fence *, mfence); } if (export_sem) {