Skip to content

Fix Win32 Vulkan swapchain capability queries and recreation - #159

Open
zxl0714 wants to merge 3 commits into
Themaister:masterfrom
zxl0714:fix/win32-wsi-swapchain-lifetime
Open

zxl0714 wants to merge 3 commits into
Themaister:masterfrom
zxl0714:fix/win32-wsi-swapchain-lifetime

Conversation

@zxl0714

@zxl0714 zxl0714 commented Nov 18, 2026

Copy link
Copy Markdown

This fixes three related swapchain lifetime issues found in our Win32 Vulkan host.

  • Preserve the Win32 fullscreen policy and monitor in capabilities queries. Probe alternate present modes without changing the selected mode, and acquire exclusive mode only after successful swapchain creation.
  • Drain in-flight work when broken_present_fence disables the fences required for deferred destruction.
  • Recreate the swapchain when presentation reports out-of-date or fullscreen-exclusive loss. Keep reporting other presentation errors and wait on an acquisition fence only after a successful acquire.

I compared the current upstream WSI source with these changes on an RTX 4080 using Vulkan validation layers. A Win32 fixture submitted real presents and injected the two recoverable results. FIFO and Immediate previously ended the frame loop and reported VUID-vkDestroySwapchainKHR-swapchain-01282. Both resumed presenting after recreation with zero validation errors after the patch. The capability probe also went from four attempts to acquire exclusive mode after failed creation to zero. With present fences disabled, the fixture observed the device-idle fallback and no validation errors.

The fixture follows the same setup as our Win32 WSI regression test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant