mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 12:28:07 +02:00
zink: also cache swapchain semaphores
a semaphore is a semaphore, as they say
Fixes: 7399b2241f ("zink: move semaphore caching to zink_reset_batch_state()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22935>
This commit is contained in:
parent
c6fd588027
commit
e9f18f64b9
1 changed files with 6 additions and 3 deletions
|
|
@ -146,13 +146,16 @@ destroy_swapchain(struct zink_screen *screen, struct kopper_swapchain *cswap)
|
||||||
if (!cswap)
|
if (!cswap)
|
||||||
return;
|
return;
|
||||||
for (unsigned i = 0; i < cswap->num_images; i++) {
|
for (unsigned i = 0; i < cswap->num_images; i++) {
|
||||||
VKSCR(DestroySemaphore)(screen->dev, cswap->images[i].acquire, NULL);
|
simple_mtx_lock(&screen->semaphores_lock);
|
||||||
|
util_dynarray_append(&screen->semaphores, VkSemaphore, cswap->images[i].acquire);
|
||||||
|
simple_mtx_unlock(&screen->semaphores_lock);
|
||||||
}
|
}
|
||||||
free(cswap->images);
|
free(cswap->images);
|
||||||
hash_table_foreach(cswap->presents, he) {
|
hash_table_foreach(cswap->presents, he) {
|
||||||
struct util_dynarray *arr = he->data;
|
struct util_dynarray *arr = he->data;
|
||||||
while (util_dynarray_contains(arr, VkSemaphore))
|
simple_mtx_lock(&screen->semaphores_lock);
|
||||||
VKSCR(DestroySemaphore)(screen->dev, util_dynarray_pop(arr, VkSemaphore), NULL);
|
util_dynarray_append_dynarray(&screen->semaphores, arr);
|
||||||
|
simple_mtx_unlock(&screen->semaphores_lock);
|
||||||
util_dynarray_fini(arr);
|
util_dynarray_fini(arr);
|
||||||
free(arr);
|
free(arr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue