zink: defer more semaphore destruction

these have noticeable overhead, so handle them in the submit thread

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18664>
This commit is contained in:
Mike Blumenkrantz 2022-08-29 11:40:50 -04:00 committed by Marge Bot
parent babf9474c4
commit 1896111d25

View file

@ -87,13 +87,14 @@ zink_reset_batch_state(struct zink_context *ctx, struct zink_batch_state *bs)
bs->resource_size = 0;
bs->signal_semaphore = VK_NULL_HANDLE;
while (util_dynarray_contains(&bs->wait_semaphores, VkSemaphore))
VKSCR(DestroySemaphore)(screen->dev, util_dynarray_pop(&bs->wait_semaphores, VkSemaphore), NULL);
util_dynarray_clear(&bs->wait_semaphore_stages);
bs->present = VK_NULL_HANDLE;
memcpy(&bs->unref_semaphores, &bs->acquires, sizeof(struct util_dynarray));
util_dynarray_init(&bs->acquires, NULL);
while (util_dynarray_contains(&bs->wait_semaphores, VkSemaphore))
util_dynarray_append(&bs->unref_semaphores, VkSemaphore, util_dynarray_pop(&bs->wait_semaphores, VkSemaphore));
util_dynarray_init(&bs->wait_semaphores, NULL);
bs->swapchain = NULL;
while (util_dynarray_contains(&bs->dead_swapchains, VkImageView))