mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
Vulkan temporary workaround for swapchain recycling (nvidia) -
Both swapchain recreation methods are proper andwithin the Vulkan specs. The differnece is retroarch follows method (apparently proposed in vulkan samples) that "hopes" the driver will reuse some of the old swapchain resources, while the other method destroys everything and recreates from scratch. At the moment on Nvidia drivers the second method is stable while the first method is unreliable in all cases today.
This commit is contained in:
parent
7ab2cbf877
commit
2178b6d10f
@ -2552,6 +2552,15 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
|
||||
|
||||
old_swapchain = vk->swapchain;
|
||||
|
||||
if (/* NVIDIA WAR */
|
||||
vk->context.gpu_properties.vendorID == 0x10DE &&
|
||||
old_swapchain != VK_NULL_HANDLE)
|
||||
{
|
||||
RARCH_LOG("[Vulkan]: Old swapchain destroyed.\n");
|
||||
vkDestroySwapchainKHR(vk->context.device, old_swapchain, NULL);
|
||||
old_swapchain = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
info.surface = vk->vk_surface;
|
||||
info.minImageCount = desired_swapchain_images;
|
||||
info.imageFormat = format.format;
|
||||
@ -2575,7 +2584,8 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (old_swapchain != VK_NULL_HANDLE)
|
||||
if ( vk->context.gpu_properties.vendorID != 0x10DE &&
|
||||
old_swapchain != VK_NULL_HANDLE)
|
||||
{
|
||||
RARCH_LOG("[Vulkan]: Recycled old swapchain.\n");
|
||||
vkDestroySwapchainKHR(vk->context.device, old_swapchain, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user