diff options
Diffstat (limited to 'video.cpp')
-rw-r--r-- | video.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -1895,8 +1895,15 @@ static VkSurfaceFormatKHR choose_swap_format(const Swap_Cap& cap) { } static VkPresentModeKHR choose_swap_mode(const Swap_Cap& cap, bool vsync) { - (void)vsync; - (void)cap; /* todo */ + if (!vsync) { + int i, c = cap.pm_count; + for (i = 0; i < c; i++) + if (cap.pms[i] == VK_PRESENT_MODE_IMMEDIATE_KHR) + return cap.pms[i]; + for (i = 0; i < c; i++) + if (cap.pms[i] == VK_PRESENT_MODE_MAILBOX_KHR) + return cap.pms[i]; + } return VK_PRESENT_MODE_FIFO_KHR; } @@ -1937,7 +1944,7 @@ void Swapchain::initr(const App& app, Device_Vk* dev) { image_count = get_image_count(dev->swap_cap); size = choose_swap_extent(app, dev->swap_cap.cap); format = choose_swap_format(dev->swap_cap); - mode = choose_swap_mode(dev->swap_cap, false); + mode = choose_swap_mode(dev->swap_cap, true); { VkResult r; VkSwapchainCreateInfoKHR si{}; |