Implement DXGI Swapchain on Vulkan - #8388
Open
cwfitzgerald wants to merge 6 commits into
Open
Conversation
6 tasks
cwfitzgerald
force-pushed
the
cw/dxgi-on-vulkan
branch
from
October 26, 2025 20:32
0f734e0 to
705937b
Compare
cwfitzgerald
force-pushed
the
cw/dxgi-on-vulkan
branch
7 times, most recently
from
June 29, 2026 21:42
48007b9 to
ace10d7
Compare
cwfitzgerald
force-pushed
the
cw/dxgi-on-vulkan
branch
2 times, most recently
from
June 29, 2026 22:37
ff41c4c to
fa9ddce
Compare
cwfitzgerald
commented
Jun 30, 2026
cwfitzgerald
force-pushed
the
cw/dxgi-on-vulkan
branch
2 times, most recently
from
July 1, 2026 03:00
ae13a73 to
28452b4
Compare
cwfitzgerald
force-pushed
the
cw/dxgi-on-vulkan
branch
3 times, most recently
from
July 8, 2026 01:37
7b15171 to
71ba098
Compare
cwfitzgerald
marked this pull request as ready for review
July 8, 2026 01:42
inner-daemons
self-requested a review
July 8, 2026 15:05
cwfitzgerald
force-pushed
the
cw/dxgi-on-vulkan
branch
3 times, most recently
from
July 14, 2026 19:21
268951b to
bf32abd
Compare
…2 through them Adds a dxgi build cfg (dx12 || vulkan+windows), widens the vulkan feature with the Windows deps, moves DynLib/DxgiLib (library.rs), dcomp, ISwapChainPanelNative (types.rs) and SurfaceTarget into auxil::dxgi, and extracts the swapchain descriptor/flags/present/ waitable/colorspace/tearing helpers. DX12 now calls the shared helpers (proven by deleting its copies). Resolves the frame-latency-waitable inconsistency: the swapchain flag, SetMaximumFrameLatency and the waitable handle are now coupled, so None honors its documented no-waitable behavior.
The DX12 backend's d3d12.dll loader (D3D12Lib) and its error types move to auxil::dxgi::library so the Vulkan DXGI interop path can create its interop device through the same runtime-loaded entry points. Each entry point resolves against the windows-crate PFN_* alias. DX12 keeps using the loader via a re-export, so its call sites and public API are unchanged. Enable Win32_Graphics_Direct3D12 for the vulkan feature on Windows (replacing Win32_Graphics_Direct3D11) so the shared loader compiles in vulkan-only builds.
…uffer sharing (Windows) Vulkan renders directly into the DXGI flip-model back buffers, which are created on a LUID-matched interop D3D12 device and shared into Vulkan as external-memory images (no copy). A shared D3D12 fence orders Vulkan rendering ahead of a no-op present command list that binds each back buffer and transitions it to PRESENT. Opt-in via VulkanSwapchainKind / WGPU_VULKAN_SWAPCHAIN_KIND; the native VK_KHR_swapchain path stays the default.
cwfitzgerald
force-pushed
the
cw/dxgi-on-vulkan
branch
from
July 25, 2026 08:50
bf32abd to
0418319
Compare
Collaborator
|
Been "busy" for a while, I want to get to this in the next week or two but I can't make promises. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connections
Part of #8354
Description
This implements the DXGI swapchain backend for vulkan. It does device interop with D3D12 and submits dummy command buffers before and after the relevant vulkan work to ensure proper synchronization with the swapchain. In my testing this works on all devices I've tested on, has negligible performance impact (something on the order of 100us) and gives us all of the advantages of a native swapchain.
The code was AI assisted and all reviewed myself before opening for reviews. This description was hand written.
Testing
Did manual testing of the swapchain under various situations. Importantly I testing a gpu-bound scene which caught a few synchronization issues. As this is not the default setting, we don't need to validate that all devices work perfectly with this scheme as the point is to get this onto trunk/into a release so we can test it out before potentially making it default.
Squash or Rebase?
Rebase
Checklist
wgpumay be affected behaviorally.CHANGELOG.mdentries for the user-facing effects of this change are present.