Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recreate swapchain on VK_SUBOPTIMAL_KHR #35

Merged
merged 1 commit into from
Feb 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Vulkan/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void Application::DrawFrame()
uint32_t imageIndex;
auto result = vkAcquireNextImageKHR(device_->Handle(), swapChain_->Handle(), noTimeout, imageAvailableSemaphore, nullptr, &imageIndex);

if (result == VK_ERROR_OUT_OF_DATE_KHR || isWireFrame_ != graphicsPipeline_->IsWireFrame())
if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR || isWireFrame_ != graphicsPipeline_->IsWireFrame())
{
RecreateSwapChain();
return;
Expand Down Expand Up @@ -222,7 +222,7 @@ void Application::DrawFrame()

result = vkQueuePresentKHR(device_->PresentQueue(), &presentInfo);

if (result == VK_ERROR_OUT_OF_DATE_KHR)
if (result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR)
{
RecreateSwapChain();
return;
Expand Down