diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-04-11 11:08:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-11 11:08:32 +0200 |
commit | 9bd71f40644a8108bc158777deefa8c8302f44d3 (patch) | |
tree | 0c607a634db7077157101f9f703a6f77c0a48d86 /src/video_core/renderer_vulkan/vk_swapchain.cpp | |
parent | Merge pull request #6167 from Morph1984/time-fix (diff) | |
parent | renderer_vulkan: Check return value of AcquireNextImage (diff) | |
download | yuzu-9bd71f40644a8108bc158777deefa8c8302f44d3.tar yuzu-9bd71f40644a8108bc158777deefa8c8302f44d3.tar.gz yuzu-9bd71f40644a8108bc158777deefa8c8302f44d3.tar.bz2 yuzu-9bd71f40644a8108bc158777deefa8c8302f44d3.tar.lz yuzu-9bd71f40644a8108bc158777deefa8c8302f44d3.tar.xz yuzu-9bd71f40644a8108bc158777deefa8c8302f44d3.tar.zst yuzu-9bd71f40644a8108bc158777deefa8c8302f44d3.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_swapchain.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_swapchain.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/video_core/renderer_vulkan/vk_swapchain.cpp b/src/video_core/renderer_vulkan/vk_swapchain.cpp index 0b63bd6c8..dfd5c65ba 100644 --- a/src/video_core/renderer_vulkan/vk_swapchain.cpp +++ b/src/video_core/renderer_vulkan/vk_swapchain.cpp @@ -82,11 +82,13 @@ void VKSwapchain::Create(u32 width, u32 height, bool srgb) { resource_ticks.resize(image_count); } -void VKSwapchain::AcquireNextImage() { - device.GetLogical().AcquireNextImageKHR(*swapchain, std::numeric_limits<u64>::max(), - *present_semaphores[frame_index], {}, &image_index); +bool VKSwapchain::AcquireNextImage() { + const VkResult result = + device.GetLogical().AcquireNextImageKHR(*swapchain, std::numeric_limits<u64>::max(), + *present_semaphores[frame_index], {}, &image_index); scheduler.Wait(resource_ticks[image_index]); + return result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR; } bool VKSwapchain::Present(VkSemaphore render_semaphore) { |