Skip to content

Commit 8ef38e0

Browse files
committed
Allow non-uniform minImageCount when we have present wait.
1 parent a99eabe commit 8ef38e0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

vulkan/wsi.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1510,8 +1510,15 @@ static bool init_surface_info(Device &device, WSIPlatform &platform,
15101510

15111511
// Accept the present mode if it does not modify minImageCount.
15121512
// If image count changes, we should probably recreate the swapchain.
1513-
if (surface_capabilities2.surfaceCapabilities.minImageCount == info.surface_capabilities.minImageCount)
1513+
// If we have present wait we're at no risk of adding more latency, so just go ahead.
1514+
if (surface_capabilities2.surfaceCapabilities.minImageCount == info.surface_capabilities.minImageCount ||
1515+
device.get_device_features().present_wait_features.presentWait)
1516+
{
15141517
info.present_mode_compat_group.push_back(mode);
1518+
info.surface_capabilities.minImageCount =
1519+
std::max<uint32_t>(info.surface_capabilities.minImageCount,
1520+
surface_capabilities2.surfaceCapabilities.minImageCount);
1521+
}
15151522
}
15161523
}
15171524

0 commit comments

Comments
 (0)