Windows 10 support: export the D3D12 Agility SDK symbols from the engine and load a user-supplied D3D12Core.dll #18
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fablinoo--kelvaroq#18
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@hopgop1 on GitHub · 2026-11-26 21:00 UTC · original
Kelvaroq version
0.2.0 built from source at commit
1270c42Hardware configuration
CPU: AMD Ryzen 7 5800X3D (8 cores / 16 threads)
GPU: NVIDIA GeForce RTX 4070 Ti, 12 GiB VRAM
Driver: 621.40. Windows reports it as 32.0.16.2140
RAM: 32 GiB
OS: Windows 10 Home 22H2, build 19045.6466
Displays: 2560×1440 (primary)
Engine settings: Automatic, none
What happened?
This is a feature request more than a bug, but this is the only issue form.
Problem. On Windows 10, kelvaroq-engine.exe fails at startup as it cannot create its D3D12 device. The engine uses the D3D12 runtime that ships with Windows. Windows 11 includes a new enough runtime, but the D3D12Core.dll in Windows 10 is too old for the features the engine needs.
Expected. The engine runs on Windows 10 when the GPU and driver support the required features.
Working fix (tested locally). Microsoft's DirectX 12 Agility SDK lets an application load a newer D3D12 runtime from a folder next to its exe. Windows looks for two exported symbols in the exe and uses the runtime in that folder. With the change below, the engine runs on Windows 10.
The change is in the victory crate of the pinned victory-fork tree, so it would be a new file in native/patches/ (I've attached it as [0065-agility-sdk.patch], made against f85101b6 with 0000–0064 applied):
// apps/victory/src/main.rs
#[repr(transparent)]
pub struct SdkPath(*const u8);
unsafe impl Sync for SdkPath {}
#[unsafe(no_mangle)]
pub static D3D12SDKVersion: u32 = 620;
#[unsafe(no_mangle)]
pub static D3D12SDKPath: SdkPath = SdkPath(b".\D3D12\\0".as_ptr());
// apps/victory/build.rs (add to the existing main if there is one)
println!("cargo:rustc-link-arg-bins=/EXPORT:D3D12SDKVersion,DATA");
println!("cargo:rustc-link-arg-bins=/EXPORT:D3D12SDKPath,DATA");
Rust doesn't export symbols from executables by default, and the D3D12 loader only reads them from the export table. dumpbin /exports kelvaroq-engine.exe confirms both symbols are present.
Packaging: I'm not asking you to ship the DLL. D3D12Core.dll is a closed Microsoft binary under the Agility SDK licence. That probably doesn't fit with a GPL-3.0 package and its source and notice requirements, so I'm suggesting a version that doesn't need it:
Add the two exports above anyway. If native\D3D12\D3D12Core.dll is missing, the D3D12 loader falls back to the system runtime. Windows 11 users and current packages would behave as they do now. The exports have no effect until someone adds the DLL.
Users who need it supply the DLL. A Windows 10 user downloads the Microsoft.Direct3D.D3D12 NuGet package for the pinned version (1.620) and copies build\native\bin\x64\D3D12Core.dll to native\D3D12\ beside kelvaroq-engine.exe. That path is fixed, because D3D12SDKPath has to be relative to the exe.
Check before launch, with a clear message. Before starting the engine (src/native.rs, and the launcher's checks), if the Windows build is below 22000:
check whether native\D3D12\D3D12Core.dll exists, and
check that its file version matches D3D12SDKVersion (1.620.x), since a mismatched DLL won't load,
and if either check fails, stop with a message such as:
Windows 10 needs the DirectX 12 Agility SDK runtime 1.620. Download the Microsoft.Direct3D.D3D12 1.620 package from NuGet, then copy build\native\bin\x64\D3D12Core.dll to \native\D3D12.
That replaces an unclear device-creation failure with a fix the user can follow. Windows 11 skips the check completely.
Points to decide:
Version pinning. D3D12SDKVersion and the DLL have to match. The pinned number could go in build.json and the docs so the message, the patch and the instructions all use the same value. It should be a stable SDK release, since preview builds only load with Developer Mode on.
Windows 11. If a Windows 11 user also adds the DLL, it will be used whenever it's newer than the system runtime. That's harmless, but worth documenting.
The launcher's hardware profile. src/hardware.rs creates its own D3D12 device in the launcher/CLI process, which doesn't have these exports. On Windows 10 it uses the old system runtime and may report Shader Model 6.6 or mesh shaders as missing even when the engine has them. Automatic would then leave settings at their inherited values. On my PC it reports: [what the Hardware profile shows].
Minimum Windows 10 build that the Agility SDK supports, for the README.
Diagnostics builds could take D3D12SDKLayers.dll from the same folder for the debug layer.
Steps to reproduce
Steps to reproduce:
Without the change, on Windows 10:
Extract the Windows x64 ZIP and open Kelvaroq.exe.
Select the game folder and start it.
Game crashes on launch.
With the change:
Build the engine with the attached patch.
Copy D3D12Core.dll (Agility SDK 1.620) to native\D3D12.
Start the game: [result].
Crash log
Additional information
0065-agility-sdk.patch
@MichaelsAlternative on GitHub · 2026-11-27 00:47 UTC · original
i hope this will be implent in this project