- we cannot recover from this

This commit is contained in:
Magnus Norddahl 2019-04-11 05:36:36 +02:00
parent 59904faff4
commit 1e7911d1f9

View file

@ -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");
}
}