mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[vulkan] Don't loop endlessly on a lost surface.
If the surface is lost in a way that can't be recovered by recreating the surface from the window, the previous change would wind up looping forever. Just retry 5 times before giving up.
This commit is contained in:
parent
e633dbc06f
commit
540900b792
@ -106,8 +106,8 @@ namespace dxvk::vk {
|
||||
|
||||
if ((status = m_vki->vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
|
||||
m_device.adapter, m_surface, &caps)) != VK_SUCCESS) {
|
||||
while (status == VK_ERROR_SURFACE_LOST_KHR) {
|
||||
// Recreate the surface and try again.
|
||||
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 (m_surface)
|
||||
destroySurface();
|
||||
if ((status = createSurface()) != VK_SUCCESS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user