mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(Vulkan) add missing queue locks when calling vkQueueWaitIdle.
This commit is contained in:
parent
ee809abf6b
commit
b948cf46e7
@ -922,7 +922,13 @@ static void vulkan_free(void *data)
|
|||||||
|
|
||||||
if (vk->context && vk->context->device)
|
if (vk->context && vk->context->device)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_THREADS
|
||||||
|
slock_lock(vk->context->queue_lock);
|
||||||
|
#endif
|
||||||
vkQueueWaitIdle(vk->context->queue);
|
vkQueueWaitIdle(vk->context->queue);
|
||||||
|
#ifdef HAVE_THREADS
|
||||||
|
slock_unlock(vk->context->queue_lock);
|
||||||
|
#endif
|
||||||
vulkan_deinit_resources(vk);
|
vulkan_deinit_resources(vk);
|
||||||
|
|
||||||
/* No need to init this since textures are create on-demand. */
|
/* No need to init this since textures are create on-demand. */
|
||||||
@ -1225,7 +1231,13 @@ static void vulkan_check_swapchain(vk_t *vk)
|
|||||||
{
|
{
|
||||||
if (vk->context->invalid_swapchain)
|
if (vk->context->invalid_swapchain)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_THREADS
|
||||||
|
slock_lock(vk->context->queue_lock);
|
||||||
|
#endif
|
||||||
vkQueueWaitIdle(vk->context->queue);
|
vkQueueWaitIdle(vk->context->queue);
|
||||||
|
#ifdef HAVE_THREADS
|
||||||
|
slock_unlock(vk->context->queue_lock);
|
||||||
|
#endif
|
||||||
|
|
||||||
vulkan_deinit_resources(vk);
|
vulkan_deinit_resources(vk);
|
||||||
vulkan_init_resources(vk);
|
vulkan_init_resources(vk);
|
||||||
@ -2254,7 +2266,13 @@ static void vulkan_unload_texture(void *data, uintptr_t handle)
|
|||||||
|
|
||||||
/* TODO: We really want to defer this deletion instead,
|
/* TODO: We really want to defer this deletion instead,
|
||||||
* but this will do for now. */
|
* but this will do for now. */
|
||||||
|
#ifdef HAVE_THREADS
|
||||||
|
slock_lock(vk->context->queue_lock);
|
||||||
|
#endif
|
||||||
vkQueueWaitIdle(vk->context->queue);
|
vkQueueWaitIdle(vk->context->queue);
|
||||||
|
#ifdef HAVE_THREADS
|
||||||
|
slock_unlock(vk->context->queue_lock);
|
||||||
|
#endif
|
||||||
vulkan_destroy_texture(
|
vulkan_destroy_texture(
|
||||||
vk->context->device, texture);
|
vk->context->device, texture);
|
||||||
free(texture);
|
free(texture);
|
||||||
@ -2351,7 +2369,13 @@ static bool vulkan_read_viewport(void *data, uint8_t *buffer, bool is_idle)
|
|||||||
if (!is_idle)
|
if (!is_idle)
|
||||||
video_driver_cached_frame();
|
video_driver_cached_frame();
|
||||||
|
|
||||||
|
#ifdef HAVE_THREADS
|
||||||
|
slock_lock(vk->context->queue_lock);
|
||||||
|
#endif
|
||||||
vkQueueWaitIdle(vk->context->queue);
|
vkQueueWaitIdle(vk->context->queue);
|
||||||
|
#ifdef HAVE_THREADS
|
||||||
|
slock_unlock(vk->context->queue_lock);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!staging->mapped)
|
if (!staging->mapped)
|
||||||
vulkan_map_persistent_texture(
|
vulkan_map_persistent_texture(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user