From a021a38f5e4316e9366ebcaaee928c346c25fc7e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 12 Sep 2022 14:47:39 -0400 Subject: [PATCH] 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 Part-of: (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 */