zink: handle split acquire/present
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 12 Sep 2022 18:47:39 +0000 (14:47 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 14 Sep 2022 15:09:44 +0000 (15:09 +0000)
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 <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18557>

src/gallium/drivers/zink/zink_kopper.c

index 4ca8b21..bc00d5b 100644 (file)
@@ -593,6 +593,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 */