Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,39 @@ python launcher/launcher.py
The build stages `rexruntime*.dll` and `TracyClient*.dll` next to `simpsons.exe`
automatically — Windows has no `LD_LIBRARY_PATH`, so DLLs live beside the exe.

### Building with Vulkan on Windows

Windows defaults to the **D3D12** backend, but the **Vulkan** backend also builds and
runs on Windows (it is the default on Linux). This is useful if you want the fragment
shader interlock render path, or if you are hitting a D3D12-only issue — for example,
FMV playback (`.vp6`) currently shows a black screen on the host render target path
(D3D12, and Vulkan with `render_target_path_vulkan=""`), while it plays fine on the
Vulkan interlock path.

Prerequisites are the same as the D3D12 build above. Configure a separate build
directory so the SDK output does not clobber the D3D12 one:

```powershell
cmake -S simpsons -B simpsons/out/build/win-vk -G Ninja `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ `
"-DCMAKE_CXX_FLAGS=-march=x86-64-v3" `
-DREXGLUE_USE_D3D12=OFF -DREXGLUE_USE_VULKAN=ON `
-DREXSDK_DIR="$PWD/tools/rexglue-sdk"
cmake --build simpsons/out/build/win-vk --target simpsons
```

Notes:

- The Vulkan backend links `dxgi` on Windows because the presenter (`rexui`) uses
DXGI for the swapchain regardless of the graphics backend (this was only linked in
the D3D12 branch).
- The SDK output directory (`tools/rexglue-sdk/out/win-amd64`) is shared between the
D3D12 and Vulkan builds — building the Vulkan variant overwrites
`rexruntimerd.dll` there, so back it up before switching back to D3D12.
- Use a `RelWithDebInfo`/`Release` build type: without `-DNDEBUG`, the render path
assertions (`GetPath() == Path::kHostRenderTargets`) fire on the interlock path.

## Legal & disclaimers

*The Simpsons Game* © 2007 Electronic Arts / Fox. This is an unaffiliated, non-commercial
Expand Down
5 changes: 5 additions & 0 deletions tools/rexglue-sdk/src/graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ if(REXGLUE_USE_VULKAN)
glslang::SPIRV
GPUOpen::VulkanMemoryAllocator
)
# 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()
Comment on lines +133 to +137

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

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

target_link_libraries(rexgraphics PRIVATE
glslang
MachineIndependent
Expand Down
Loading