From 910e1a1835362d333968304058c71c895f84ce6a Mon Sep 17 00:00:00 2001 From: Chip Davis Date: Mon, 1 Apr 2019 13:46:38 -0500 Subject: [PATCH] Only try once to recreate surfaces on surface loss. --- src/vulkan/vulkan_presenter.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/vulkan/vulkan_presenter.cpp b/src/vulkan/vulkan_presenter.cpp index c760bb1b2..623db231c 100644 --- a/src/vulkan/vulkan_presenter.cpp +++ b/src/vulkan/vulkan_presenter.cpp @@ -106,15 +106,14 @@ namespace dxvk::vk { if ((status = m_vki->vkGetPhysicalDeviceSurfaceCapabilitiesKHR( m_device.adapter, m_surface, &caps)) != VK_SUCCESS) { - for (uint32_t i = 0; i < 5 && status == VK_ERROR_SURFACE_LOST_KHR; i++) { - // Recreate the surface and try again. Give up after 5 tries. + if (status == VK_ERROR_SURFACE_LOST_KHR) { + // Recreate the surface and try again. if (m_surface) destroySurface(); if ((status = createSurface()) != VK_SUCCESS) - continue; - if ((status = m_vki->vkGetPhysicalDeviceSurfaceCapabilitiesKHR( - m_device.adapter, m_surface, &caps)) != VK_SUCCESS) - continue; + return status; + status = m_vki->vkGetPhysicalDeviceSurfaceCapabilitiesKHR( + m_device.adapter, m_surface, &caps); } if (status != VK_SUCCESS) return status;