Module: Mesa
Branch: staging/22.2
Commit: a021a38f5e4316e9366ebcaaee928c346c25fc7e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a021a38f5e4316e9366ebcaaee928c346c25fc7e

Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Sep 12 14:47:39 2022 -0400

zink: handle split acquire/present

if the swapchain image is acquired in a different cmdbuf than it gets
presented with, the acquire semaphore will have already been submitted
by this point, and the swapchain should be flagged as such

cc: mesa-stable

Reviewed-by: Adam Jackson <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18557>
(cherry picked from commit db192c08837300fe7017195effe047379c69dd96)

---

 .pick_status.json                      | 2 +-
 src/gallium/drivers/zink/zink_kopper.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 2cbd12eefb4..7b84ead91ca 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -76,7 +76,7 @@
         "description": "zink: handle split acquire/present",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/zink/zink_kopper.c 
b/src/gallium/drivers/zink/zink_kopper.c
index 3c97c0e8fd3..a9545fc8df7 100644
--- a/src/gallium/drivers/zink/zink_kopper.c
+++ b/src/gallium/drivers/zink/zink_kopper.c
@@ -591,6 +591,10 @@ zink_kopper_acquire_submit(struct zink_screen *screen, 
struct zink_resource *res
    if (cdt->swapchain->images[res->obj->dt_idx].dt_has_data)
       return VK_NULL_HANDLE;
    assert(res->obj->dt_idx != UINT32_MAX);
+   if (cdt->swapchain->images[res->obj->dt_idx].acquired) {
+      assert(!cdt->swapchain->images[res->obj->dt_idx].acquire);
+      return VK_NULL_HANDLE;
+   }
    assert(cdt->swapchain->images[res->obj->dt_idx].acquire);
    cdt->swapchain->images[res->obj->dt_idx].acquired = true;
    /* this is now owned by the batch */

Reply via email to