mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 21:30:23 +01:00
zink/kopper: Don't recycle unused acquire semaphores
Fixes:e9f18f64b9("zink: also cache swapchain semaphores") Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014> (cherry picked from commit8d9675520f)
This commit is contained in:
parent
052a8a9426
commit
d30dedf5fb
2 changed files with 9 additions and 4 deletions
|
|
@ -1594,7 +1594,7 @@
|
|||
"description": "zink/kopper: Don't recycle unused acquire semaphores",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "e9f18f64b9ec56ed0e89a5baa41b4536585a8a90",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -150,9 +150,14 @@ destroy_swapchain(struct zink_screen *screen, struct kopper_swapchain *cswap)
|
|||
return;
|
||||
util_queue_fence_destroy(&cswap->present_fence);
|
||||
for (unsigned i = 0; i < cswap->num_images; i++) {
|
||||
simple_mtx_lock(&screen->semaphores_lock);
|
||||
util_dynarray_append(&screen->semaphores, VkSemaphore, cswap->images[i].acquire);
|
||||
simple_mtx_unlock(&screen->semaphores_lock);
|
||||
/* Destroy the acquire semaphore directly, if any. If acquire != NULL
|
||||
* then we've called vkAcquireNextImage() with the given semaphore but
|
||||
* not submitted anything which waits on it. This means the semaphore
|
||||
* has a pending signal operation and is not safe to recycle.
|
||||
*/
|
||||
if (cswap->images[i].acquire != VK_NULL_HANDLE)
|
||||
VKSCR(DestroySemaphore)(screen->dev, cswap->images[i].acquire, NULL);
|
||||
|
||||
pipe_resource_reference(&cswap->images[i].readback, NULL);
|
||||
}
|
||||
free(cswap->images);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue