Windows 10 support: export the D3D12 Agility SDK symbols from the engine and load a user-supplied D3D12Core.dll #18

Open
opened 2026-11-26 21:01:50 +00:00 by github-bot · 1 comment
Owner

@⁠hopgop1 on GitHub · 2026-11-26 21:00 UTC · original

Kelvaroq version

0.2.0 built from source at commit 1270c42

Hardware 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

unix time 1795716510, process 19460
VIctory: unhandled exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0xb5a5f8 (read 0x68: nothing mapped there)
  rax 0x0 rbx 0x3 rcx 0x0 rdx 0x0 rsi 0x1197bfea68 rdi 0x1197bfeb10 rsp 0x1197bfe9a0 rbp 0x13f
  r8 0xffffffff00000000 r9 0xffffffff00000000 r10 0xd151aa6f0 r11 0xd153a3b50 r12 0xd14e40308 r13 0x0 r14 0x0 r15 0x651e95c4d06fbfb1
  #0  victory-image-b99f876b74d4a77f.dll+0xb5a5f8
  #1  victory-image-b99f876b74d4a77f.dll+0x5bb7cce
  #2  victory-image-b99f876b74d4a77f.dll+0x1dbdc0b
  #3  victory-image-b99f876b74d4a77f.dll+0x5bb7111
  #4  victory-image-b99f876b74d4a77f.dll+0x5bb7071
  #5  victory-image-b99f876b74d4a77f.dll+0x63e78
  #6  victory-image-b99f876b74d4a77f.dll+0x4eaa05a
  #7  victory-image-b99f876b74d4a77f.dll+0x221c29c
  #8  victory-image-b99f876b74d4a77f.dll+0x2215eca
  #9  KERNEL32.DLL+0x17374
  #10 ntdll.dll+0x4cc91


###### DEBUG INFO ######

========= SYSTEM INFO =========
Game Running Time: 0h:0m:0s
Game Timestamp: [T:6276323]
Game State: Game Init [T:6273580]
Frame: 0
Paused: No
Streaming Requests: 0
TileHeap: used (174Mb) - total (6236Mb)

========= MEMORYINFO =========
Game Virtual: 0/0
Resource Virtual: 0/0
Game Physical: 0/0
Resource Physical: 0/0
Unused: 0/0
Pool: 0/0
OS: 0/0
Game External: 0/0
OS External: 0/0

========= MISC INFO =========
Game Environment: prod
Game Locale: EU
Game SKU: ROW
Conole Type: Anaconda
Sandbox: RETAIL
Camera Position: <262144.000000, 262144.000000, 21600.000000>
Camera Front: <0.000000, 1.000000, 0.000000>
Game Time: (12:0)
System Language: English
GFX Queue: 29a5ee15

========= MISSION =========
Current Mission Name: 0x00000000 [F:0]
Current Mission Stage: 0x00000000 [F:0]
Last Mission Name: 0x00000000
Current SRL Name:  [T:0]
Current SRL State:  [T:0]

========= ANIMSCENE =========
Current AnimScene: 0x0 [T:0]

========= SCRIPT =========
Current script program: 0x0 [T:0]
Currently running script threads: 0

========= PLAYER =========
Position: <0.000000, 0.000000, 0.000000> [T:0]
Wanted Level: 0 [T:0]
Arrest State: None [T:0]
Player Health: 0.00/0.00 [T:0]
Health State: Healthy [T:0]
Current Vehicle:  [T:0]

========= POOLS =========
 - NOTHING: 0/0
 - BUILDING: 0/0
 - VEHICLE: 0/0
 - PED: 0/0
 - OBJECT: 0/0
 - PORTAL: 0/0
 - MLO: 0/0
 - NOTINPOOLS: 0/0
 - PARTICLESYSTEM: 0/0
 - LIGHT: 0/0
 - LIGHTEMITTER: 0/0
 - COMPOSITE: 0/0
 - INSTANCE_LIST: 0/0
 - GRASS_INSTANCE_LIST: 0/0
 - VEHICLEGLASSCOMPONENT: 0/0

========= PEDS =========
Peds: 0/0 (real: 0, dummy: 0)
 - mission: 0
 - scenario: 0
 - wander: 0
 - perschar: 0
 - other: 0

========= VEHICLES =========
Cars: 0/0 (real: 0(0 traffic), dummy: 0, superdummy: 0) - clones: 0
 - ambient: 0
 - mission: 0
 - parked: 0
 - reusePool: 0
 - scriptExtensions: 0
 - scriptHandlers: 0

========= NETWORK =========
Telemetry PlSesId: 0

========= ANIMMISC =========
Misc Pool Usages:
 - CObjects: 0
 - CMoveObjects: 0
 - CObjectAnimationComponents: 0
 - CWeapons: 0
 - CPedEquippedWeapons: 0

###### END OF DEBUG INFO ######

Additional information

0065-agility-sdk.patch

**@⁠hopgop1** on GitHub · 2026-11-26 21:00 UTC · [original](https://github.com/stellarr-studio/kelvaroq/issues/18) ### Kelvaroq version 0.2.0 built from source at commit 1270c42 ### Hardware 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 <install>\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 ```text unix time 1795716510, process 19460 VIctory: unhandled exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0xb5a5f8 (read 0x68: nothing mapped there) rax 0x0 rbx 0x3 rcx 0x0 rdx 0x0 rsi 0x1197bfea68 rdi 0x1197bfeb10 rsp 0x1197bfe9a0 rbp 0x13f r8 0xffffffff00000000 r9 0xffffffff00000000 r10 0xd151aa6f0 r11 0xd153a3b50 r12 0xd14e40308 r13 0x0 r14 0x0 r15 0x651e95c4d06fbfb1 #0 victory-image-b99f876b74d4a77f.dll+0xb5a5f8 #1 victory-image-b99f876b74d4a77f.dll+0x5bb7cce #2 victory-image-b99f876b74d4a77f.dll+0x1dbdc0b #3 victory-image-b99f876b74d4a77f.dll+0x5bb7111 #4 victory-image-b99f876b74d4a77f.dll+0x5bb7071 #5 victory-image-b99f876b74d4a77f.dll+0x63e78 #6 victory-image-b99f876b74d4a77f.dll+0x4eaa05a #7 victory-image-b99f876b74d4a77f.dll+0x221c29c #8 victory-image-b99f876b74d4a77f.dll+0x2215eca #9 KERNEL32.DLL+0x17374 #10 ntdll.dll+0x4cc91 ###### DEBUG INFO ###### ========= SYSTEM INFO ========= Game Running Time: 0h:0m:0s Game Timestamp: [T:6276323] Game State: Game Init [T:6273580] Frame: 0 Paused: No Streaming Requests: 0 TileHeap: used (174Mb) - total (6236Mb) ========= MEMORYINFO ========= Game Virtual: 0/0 Resource Virtual: 0/0 Game Physical: 0/0 Resource Physical: 0/0 Unused: 0/0 Pool: 0/0 OS: 0/0 Game External: 0/0 OS External: 0/0 ========= MISC INFO ========= Game Environment: prod Game Locale: EU Game SKU: ROW Conole Type: Anaconda Sandbox: RETAIL Camera Position: <262144.000000, 262144.000000, 21600.000000> Camera Front: <0.000000, 1.000000, 0.000000> Game Time: (12:0) System Language: English GFX Queue: 29a5ee15 ========= MISSION ========= Current Mission Name: 0x00000000 [F:0] Current Mission Stage: 0x00000000 [F:0] Last Mission Name: 0x00000000 Current SRL Name: [T:0] Current SRL State: [T:0] ========= ANIMSCENE ========= Current AnimScene: 0x0 [T:0] ========= SCRIPT ========= Current script program: 0x0 [T:0] Currently running script threads: 0 ========= PLAYER ========= Position: <0.000000, 0.000000, 0.000000> [T:0] Wanted Level: 0 [T:0] Arrest State: None [T:0] Player Health: 0.00/0.00 [T:0] Health State: Healthy [T:0] Current Vehicle: [T:0] ========= POOLS ========= - NOTHING: 0/0 - BUILDING: 0/0 - VEHICLE: 0/0 - PED: 0/0 - OBJECT: 0/0 - PORTAL: 0/0 - MLO: 0/0 - NOTINPOOLS: 0/0 - PARTICLESYSTEM: 0/0 - LIGHT: 0/0 - LIGHTEMITTER: 0/0 - COMPOSITE: 0/0 - INSTANCE_LIST: 0/0 - GRASS_INSTANCE_LIST: 0/0 - VEHICLEGLASSCOMPONENT: 0/0 ========= PEDS ========= Peds: 0/0 (real: 0, dummy: 0) - mission: 0 - scenario: 0 - wander: 0 - perschar: 0 - other: 0 ========= VEHICLES ========= Cars: 0/0 (real: 0(0 traffic), dummy: 0, superdummy: 0) - clones: 0 - ambient: 0 - mission: 0 - parked: 0 - reusePool: 0 - scriptExtensions: 0 - scriptHandlers: 0 ========= NETWORK ========= Telemetry PlSesId: 0 ========= ANIMMISC ========= Misc Pool Usages: - CObjects: 0 - CMoveObjects: 0 - CObjectAnimationComponents: 0 - CWeapons: 0 - CPedEquippedWeapons: 0 ###### END OF DEBUG INFO ###### ``` ### Additional information [0065-agility-sdk.patch](https://github.com/user-attachments/files/35483933/0065-agility-sdk.patch)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 21:01:50 +00:00
Author
Owner

@⁠MichaelsAlternative on GitHub · 2026-11-27 00:47 UTC · original

i hope this will be implent in this project

**@⁠MichaelsAlternative** on GitHub · 2026-11-27 00:47 UTC · [original](https://github.com/stellarr-studio/kelvaroq/issues/18#issuecomment-7206757724) i hope this will be implent in this project
This discussion has been locked. Commenting is limited to contributors.
No description provided.