Skip to content
Snippets Groups Projects
Commit 811a6eda authored by Philip Whitfield's avatar Philip Whitfield
Browse files

fallback to immediate presentation mode if mailbox is not available

parent 38d01912
No related branches found
No related tags found
No related merge requests found
......@@ -116,9 +116,13 @@ VkPresentModeKHR swapchain::choose_present_mode(VkPresentModeKHRs const& present
if (v_sync())
return VK_PRESENT_MODE_FIFO_KHR;
for (auto const& present_mode : present_modes)
if (present_mode == VK_PRESENT_MODE_MAILBOX_KHR)
return present_mode;
if(std::find(present_modes.begin(), present_modes.end(), VK_PRESENT_MODE_MAILBOX_KHR) != present_modes.end()){
return VK_PRESENT_MODE_MAILBOX_KHR;
}
if(std::find(present_modes.begin(), present_modes.end(), VK_PRESENT_MODE_IMMEDIATE_KHR) != present_modes.end()){
return VK_PRESENT_MODE_IMMEDIATE_KHR;
}
return VK_PRESENT_MODE_FIFO_KHR;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment