diff options
| author | Stenzek <stenzek@gmail.com> | 2017-09-16 15:53:08 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2017-10-10 23:21:40 +1000 |
| commit | cdf34a79f7457da8c1ec29096ed448b62ece478d (patch) | |
| tree | b2ad7bd0cd58300940d7a98f83eceeeae3167e6d /Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp | |
| parent | 80593f502e57126de26796ff405a940587d1b87d (diff) | |
Vulkan: Set a flag to resize the swap chain when presenting fails
Drivers can return VK_ERROR_OUT_OF_DATE_KHR from vkQueuePresentKHR, and
we should resize the image in this case, as well as when getting it back
from vkAcquireNextImageKHR.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp index 350757194e..51706fc33f 100644 --- a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp +++ b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp @@ -353,8 +353,13 @@ void CommandBufferManager::SubmitCommandBuffer(size_t index, VkSemaphore wait_se nullptr}; res = vkQueuePresentKHR(g_vulkan_context->GetPresentQueue(), &present_info); - if (res != VK_SUCCESS && res != VK_ERROR_OUT_OF_DATE_KHR && res != VK_SUBOPTIMAL_KHR) - LOG_VULKAN_ERROR(res, "vkQueuePresentKHR failed: "); + if (res != VK_SUCCESS) + { + // VK_ERROR_OUT_OF_DATE_KHR is not fatal, just means we need to recreate our swap chain. + if (res != VK_ERROR_OUT_OF_DATE_KHR && res != VK_SUBOPTIMAL_KHR) + LOG_VULKAN_ERROR(res, "vkQueuePresentKHR failed: "); + m_present_failed_flag.Set(); + } } // Command buffer has been queued, so permit the next one. |
