From 58bdb3efa0da7e1f994cff34ab1ef238dd19dacb Mon Sep 17 00:00:00 2001 From: BearOso Date: Mon, 9 Oct 2023 15:01:35 -0500 Subject: [PATCH] Vulkan: Use mailbox when available. Suppress debug messages. --- vulkan/vulkan_swapchain.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vulkan/vulkan_swapchain.cpp b/vulkan/vulkan_swapchain.cpp index 9d3e6abe..00fde8ad 100644 --- a/vulkan/vulkan_swapchain.cpp +++ b/vulkan/vulkan_swapchain.cpp @@ -176,7 +176,7 @@ bool Swapchain::create(unsigned int desired_num_swapchain_images, int new_width, .setImageUsage(vk::ImageUsageFlagBits::eColorAttachment | vk::ImageUsageFlagBits::eTransferSrc) .setCompositeAlpha(vk::CompositeAlphaFlagBitsKHR::eOpaque) .setClipped(true) - .setPresentMode(vsync ? vk::PresentModeKHR::eFifo : vk::PresentModeKHR::eImmediate) + .setPresentMode(vsync ? vk::PresentModeKHR::eFifo : tearing_present_mode) .setSurface(surface) .setPreTransform(vk::SurfaceTransformFlagBitsKHR::eIdentity) .setImageArrayLayers(1) @@ -191,7 +191,6 @@ bool Swapchain::create(unsigned int desired_num_swapchain_images, int new_width, } catch (std::exception &e) { - printf("%s\n", e.what()); swapchain_object.reset(); } @@ -270,7 +269,7 @@ bool Swapchain::begin_frame() vk::ResultValue result_value(vk::Result::eSuccess, 0); try { - result_value = device.acquireNextImageKHR(swapchain_object.get(), 33333333, frame.acquire.get()); + result_value = device.acquireNextImageKHR(swapchain_object.get(), UINT64_MAX, frame.acquire.get()); } catch (vk::OutOfDateKHRError) { @@ -280,7 +279,6 @@ bool Swapchain::begin_frame() if (result_value.result == vk::Result::eErrorOutOfDateKHR || result_value.result == vk::Result::eSuboptimalKHR) { - // printf("Out of date\n"); recreate(); return begin_frame(); }