Skip to content
Permalink
Browse files

- we cannot recover from this

  • Loading branch information...
dpjudas committed Apr 11, 2019
1 parent 59904fa commit 1e7911d1f938fc87a97d1eef2334363fefb6619f
Showing with 17 additions and 5 deletions.
  1. +17 −5 src/rendering/vulkan/system/vk_swapchain.cpp
@@ -61,9 +61,21 @@ uint32_t VulkanSwapChain::AcquireImage(int width, int height, VulkanSemaphore *s
imageIndex = 0xffffffff;
break;
}
else if (result == VK_ERROR_OUT_OF_HOST_MEMORY || result == VK_ERROR_OUT_OF_DEVICE_MEMORY)
{
I_FatalError("vkAcquireNextImageKHR failed: out of memory");
}
else if (result == VK_ERROR_DEVICE_LOST)
{
I_FatalError("vkAcquireNextImageKHR failed: device lost");
}
else if (result == VK_ERROR_SURFACE_LOST_KHR)
{
I_FatalError("vkAcquireNextImageKHR failed: surface lost");
}
else
{
I_Error("Failed to acquire next image!");
I_FatalError("vkAcquireNextImageKHR failed");
}
}
return imageIndex;
@@ -90,19 +102,19 @@ void VulkanSwapChain::QueuePresent(uint32_t imageIndex, VulkanSemaphore *semapho
// The spec says we can recover from this.
// However, if we are out of memory it is better to crash now than in some other weird place further away from the source of the problem.

I_Error("vkQueuePresentKHR failed: out of memory");
I_FatalError("vkQueuePresentKHR failed: out of memory");
}
else if (result == VK_ERROR_DEVICE_LOST)
{
I_Error("vkQueuePresentKHR failed: device lost");
I_FatalError("vkQueuePresentKHR failed: device lost");
}
else if (result == VK_ERROR_SURFACE_LOST_KHR)
{
I_Error("vkQueuePresentKHR failed: surface lost");
I_FatalError("vkQueuePresentKHR failed: surface lost");
}
else if (result != VK_SUCCESS)
{
I_Error("vkQueuePresentKHR failed");
I_FatalError("vkQueuePresentKHR failed");
}
}

0 comments on commit 1e7911d

Please sign in to comment.
You can’t perform that action at this time.