Module: Mesa
Branch: main
Commit: 0e32de0aed7279b680d0604ac45f1d1663e7c99d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0e32de0aed7279b680d0604ac45f1d1663e7c99d

Author: Mike Blumenkrantz <[email protected]>
Date:   Wed Jun 14 15:46:09 2023 -0400

zink: recache present semaphores

this otherwise depletes the entire cache

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23729>

---

 src/gallium/drivers/zink/zink_kopper.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_kopper.c 
b/src/gallium/drivers/zink/zink_kopper.c
index 972420519cb..f85212fb689 100644
--- a/src/gallium/drivers/zink/zink_kopper.c
+++ b/src/gallium/drivers/zink/zink_kopper.c
@@ -723,8 +723,9 @@ kopper_present(void *data, void *gdata, int thread_idx)
                                                       
(void*)(uintptr_t)swapchain->last_present_prune);
       if (he) {
          arr = he->data;
-         while (util_dynarray_contains(arr, VkSemaphore))
-            VKSCR(DestroySemaphore)(screen->dev, util_dynarray_pop(arr, 
VkSemaphore), NULL);
+         simple_mtx_lock(&screen->semaphores_lock);
+         util_dynarray_append_dynarray(&screen->semaphores, arr);
+         simple_mtx_unlock(&screen->semaphores_lock);
          util_dynarray_fini(arr);
          free(arr);
          _mesa_hash_table_remove(swapchain->presents, he);

Reply via email to