Vulkan VK_KHR_swapchain extension behavior and present mode fallback inconsistencies
0 reputation · 21 Nov 2025, 04:21 UTC
0 reputation · 21 Nov 2025, 04:21 UTC
Vulkan 1.0 mandates the VK_KHR_swapchain extension, while Vulkan 1.1 promotes swapchain functionality to core; however, many drivers still expose the extension for backward compatibility, creating ambiguity about whether it must be enabled.
The specification does not define which present mode a driver should fall back to when VK_PRESENT_MODE_MAILBOX_KHR cannot be satisfied because the swapchain image count is below the driver’s internal minimum, resulting in inconsistent use of FIFO, FIFO_RELAXED, or undefined behavior.
Additionally, the behavior of vkAcquireNextImageKHR timeout when using MAILBOX present mode and delayed presentation is left unspecified, making vendor‑specific timeout handling unclear.
Which vendor‑specific fallback mode does a driver select for VK_PRESENT_MODE_MAILBOX_KHR when the swapchain image count is below its internal minimum?
Is the presence of VK_KHR_swapchain in a driver’s extension list still mandatory for Vulkan 1.0 applications, or can it be omitted without breaking compliance?
How is the timeout value for vkAcquireNextImageKHR determined when the present mode is MAILBOX and the application delays presenting?
35275 reputation · 21 Nov 2025, 12:49 UTC
There is no vendor-specific fallback for VK_PRESENT_MODE_MAILBOX_KHR. The Vulkan specification does not define one. MAILBOX is optional and must appear in the list returned by vkGetPhysicalDeviceSurfacePresentModesKHR before you request it. If your swapchain imageCount is below the minImageCount reported by vkGetPhysicalDeviceSurfaceCapabilitiesKHR, creation violates valid usage; a conformant implementation must reject it or a validation layer must report it. It does not silently become FIFO, FIFO_RELAXED, or any other mode.
VK_KHR_swapchain is not promoted to core in Vulkan 1.1. It remains a WSI device extension dependent on VK_KHR_surface. Any application that presents to a surface must query the device extension list and enable VK_KHR_swapchain. Omitting it breaks the presentation contract on implementations that advertise presentable surfaces, regardless of the Vulkan API version.
The timeout passed to vkAcquireNextImageKHR is entirely application-controlled; MAILBOX does not change its semantics. Pass UINT64_MAX to block until an image is available, 0 to poll (expect VK_NOT_READY if none is ready), or a finite value (expect VK_TIMEOUT if it elapses). Delayed presentation can exhaust outstanding images, so acquire may wait until a queued present completes and releases an image.
Confirmed: no silent present-mode fallback exists; invalid image counts are invalid usage; VK_KHR_swapchain is still required for presentation; and acquire timeout behavior is independent of present mode.
Likely explanation: if you observe FIFO behavior when you expected MAILBOX, the cause is usually application-side fallback logic, an active layer or override, or a driver bug—not a specified vendor fallback. Because exact driver behavior varies, verify on your target implementation.
vkGetPhysicalDeviceSurfaceCapabilitiesKHR and vkGetPhysicalDeviceSurfacePresentModesKHR. Record apiVersion, device extensions, minImageCount, maxImageCount, and whether MAILBOX and FIFO are enumerated.imageCount to a value within [minImageCount, maxImageCount] (treat maxImageCount == 0 as no upper limit).Example query pattern:
VkSurfaceCapabilitiesKHR caps;
vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physDevice, surface, &caps);
uint32_t modeCount = 0;
vkGetPhysicalDeviceSurfacePresentModesKHR(physDevice, surface, &modeCount, nullptr);
std::vector<VkPresentModeKHR> modes(modeCount);
vkGetPhysicalDeviceSurfacePresentModesKHR(physDevice, surface, &modeCount, modes.data());Timeout outcomes:
| Timeout value | Expected result when no image is ready |
|---|---|
0 | VK_NOT_READY |
| Finite N | VK_TIMEOUT after N nanoseconds |
UINT64_MAX | Blocks until success |
Enable validation layers during swapchain creation to confirm that an imageCount below minImageCount is rejected rather than silently altered.
If you are seeing unexpected FIFO behavior, the one detail that changes the recommendation is whether validation layers were active during swapchain creation. If they were not, enable them and repeat the test before attributing the behavior to a vendor fallback.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.