Module: Mesa
Branch: staging/23.3
Commit: 35b321e9b8dbfce6a8a0c0639d3480af762ee992
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=35b321e9b8dbfce6a8a0c0639d3480af762ee992

Author: Mike Blumenkrantz <michael.blumenkra...@gmail.com>
Date:   Mon Jan  8 09:51:31 2024 -0500

zink: always force flushes when originating from api frontend

flags=0 is used for e.g., glFenceSync, which apps use to insert sync points
to determine when all prior work has completed. eliding these flushes into 
no-ops
is fine for all scenarios except when the last op was a present, in which
case the no-op (previous) fence will not sync as expected for the present and
graphical artifacts will result

in the future, this may be changed back to the previous behavior if/when 
presentation
gains timeline semaphore capabilities by providing the last timeline id
as a fence instead of the last batch

fixes #10386

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26935>
(cherry picked from commit 03f049f49730b8b1268f2975fc34ac2b1f9a4ef9)

---

 .pick_status.json                       | 2 +-
 src/gallium/drivers/zink/zink_context.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 9a8f56ce3b3..40f3634c46d 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -3294,7 +3294,7 @@
         "description": "zink: always force flushes when originating from api 
frontend",
         "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 f4716527883..28afec232eb 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -3849,7 +3849,8 @@ zink_flush(struct pipe_context *pctx,
       }
    }
 
-   if (!batch->has_work) {
+   /* TODO: if swapchains gain timeline semaphore semantics, `flags` can be 
eliminated and no-op fence can return timeline id */
+   if (!batch->has_work && flags) {
        if (pfence) {
           /* reuse last fence */
           fence = ctx->last_fence;

Reply via email to