Fix Windows Vulkan build: link dxgi for the DXGI presenter regardless of backend - #17
Conversation
… of backend The presenter (rexui) uses DXGI for the swapchain on Windows regardless of the graphics backend, but dxgi was only linked in the D3D12 branch of src/graphics/CMakeLists.txt, so a Vulkan build on Windows failed at link time with an undefined CreateDXGIFactory1. Also documents building with the Vulkan backend on Windows in the README (configure command + notes about the shared SDK output dir and the RelWithDebInfo requirement).
PR Summary by QodoFix Windows Vulkan link: always link DXGI for the presenter swapchain
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. DXGI dependency mis-attributed
|
| # The presenter (rexui) uses DXGI for the swapchain/display on Windows | ||
| # regardless of the graphics backend. | ||
| if(WIN32) | ||
| target_link_libraries(rexgraphics PUBLIC dxgi) | ||
| endif() |
There was a problem hiding this comment.
1. Dxgi dependency mis-attributed 🐞 Bug ⚙ Maintainability
The DXGI symbol (CreateDXGIFactory1) is referenced from rexui’s presenter on Windows, but this PR adds dxgi linkage under rexgraphics’ Vulkan branch, leaving rexui’s own Windows platform dependencies still backend-conditional. This spreads a platform dependency across multiple targets/backends, making the build graph harder to reason about and easier to regress later.
Agent Prompt
### Issue description
`CreateDXGIFactory1` is called from `rexui` (the presenter) on Windows, but the PR links `dxgi` from the Vulkan branch of `rexgraphics`. This makes the DXGI dependency non-local to the target that actually needs it, and keeps `rexui`’s Windows DXGI linkage dependent on backend configuration.
### Issue Context
- `Presenter` uses DXGI on Windows regardless of backend.
- `rexui` currently links `dxgi` only in the D3D12 block, not as a general Windows dependency.
### Fix Focus Areas
- tools/rexglue-sdk/src/ui/CMakeLists.txt[133-161]
- tools/rexglue-sdk/src/graphics/CMakeLists.txt[127-137]
### Suggested change
- Add `dxgi` to the `if(WIN32)` platform dependencies of `rexui` (keep `dxguid`/`dxc-headers` under the D3D12 block if they’re D3D12-specific).
- Optionally remove the Vulkan-specific `dxgi` linkage from `rexgraphics` to avoid duplicating responsibility across targets.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
this looks great thank you for the contribution if the workflow passes I will integrate this into the repo |
Title
Fix Windows Vulkan build: link dxgi for the DXGI presenter regardless of backend
Problem
On Windows, building with
-DREXGLUE_USE_D3D12=OFF -DREXGLUE_USE_VULKAN=ONfails at link time:The presenter (
rexui) uses DXGI for the swapchain on Windows regardless of the graphics backend, butdxgiwas only linked in the D3D12 branch ofsrc/graphics/CMakeLists.txt.Change
Also in this PR
README section "Building with Vulkan on Windows" — configure command, plus notes:
tools/rexglue-sdk/out/win-amd64) is shared between the D3D12 and Vulkan builds, so the Vulkan build overwritesrexruntimerd.dllthere;RelWithDebInfo/Releasebuild type is required (without-DNDEBUG, the render-path assertions fire on the interlock path).Testing
Built and ran on Windows 11 / AMD Radeon RX 6700: Vulkan instance 1.4.341, FMV playback works, 90-minute session stable, clean shutdown.
Files changed
tools/rexglue-sdk/src/graphics/CMakeLists.txt(+5)README.md(+33)