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 <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18557>
(cherry picked from commit db192c0883)
This commit is contained in:
Mike Blumenkrantz
2022-09-12 14:47:39 -04:00
committed by Dylan Baker
parent 5b6aa0c7ee
commit a021a38f5e
2 changed files with 5 additions and 1 deletions

View File

@@ -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
},

View File

@@ -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 */