Skip to content

Commit

Permalink
Use FIFO_RELAXED if available in low latency mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Themaister committed Nov 3, 2023
1 parent f74497b commit 4c47f1c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vulkan/wsi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,6 @@ static bool init_surface_info(Device &device, WSIPlatform &platform,
VkSurfaceKHR surface, BackbufferFormat format,
PresentMode present_mode, SurfaceInfo &info, bool low_latency_mode_enable)
{
(void)low_latency_mode_enable;
if (surface == VK_NULL_HANDLE)
{
LOGE("Cannot create swapchain with surface == VK_NULL_HANDLE.\n");
Expand Down Expand Up @@ -1113,6 +1112,13 @@ static bool init_surface_info(Device &device, WSIPlatform &platform,
}
}

if (swapchain_present_mode == VK_PRESENT_MODE_FIFO_KHR && low_latency_mode_enable)
for (auto mode : present_modes)
if (mode == VK_PRESENT_MODE_FIFO_RELAXED_KHR)
swapchain_present_mode = mode;

LOGI("Using present mode: %u.\n", swapchain_present_mode);

// First, query minImageCount without any present mode.
// Avoid opting for present mode compat that is pathological in nature,
// e.g. Xorg MAILBOX where minImageCount shoots up to 5 for stupid reasons.
Expand Down

0 comments on commit 4c47f1c

Please sign in to comment.