From f6f42b35a38e4cbc816341a52b6f1a8827781eee Mon Sep 17 00:00:00 2001 From: CocoBeans64 Date: Wed, 25 Nov 2026 18:14:05 +0100 Subject: [PATCH] victory: run on Windows 10 with the Agility SDK runtime Windows 10's own Direct3D 12 runtime stops at shader model 6.5 on the GPU (6.2 on WARP), so every title pipeline was refused and nothing was drawn. The executable now exports D3D12SDKVersion (614) and D3D12SDKPath (".\D3D12\"): with D3D12Core.dll from the Microsoft.Direct3D.D3D12 package in that folder, the loader uses it and the device reports SM 6.6. Without the folder, or on a newer Windows, the system runtime is used. The README says how to set it up. Tested on Windows 10 22H2 (19045.7846), RX 6800 XT, driver 32.0.21045.5002: the title reaches the world (intro, a playable stretch, next cutscene) with no crash; WARP 1.0.22 next to the exe also gives SM 6.6. Co-Authored-By: Claude Opus 5.5 --- README.md | 11 +++++++++++ apps/victory/build.rs | 13 +++++++++++++ apps/victory/src/main.rs | 21 +++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 apps/victory/build.rs diff --git a/README.md b/README.md index 4010879d7c..3058aa9180 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,17 @@ Requirements: Windows 10/11 x64, a CPU with AVX2, a Direct3D 12 GPU with shader model 6.6 (and mesh shaders for the world), Rust (pinned in `rust-toolchain.toml`). +Windows 10: its own Direct3D 12 runtime stops at shader model 6.5 on the +GPU (6.2 on WARP), so the title's pipelines are refused and nothing is +drawn. `victory.exe` asks for the Agility SDK runtime instead +(`D3D12SDKVersion` 614, in `D3D12\` next to the executable). Download the +NuGet package `Microsoft.Direct3D.D3D12` 1.614.x and copy its +`build\native\bin\x64\D3D12Core.dll` (and `d3d12SDKLayers.dll`) to +`target\\D3D12\`; for WARP also copy `d3d10warp.dll` from the +package `Microsoft.Direct3D.WARP` next to `victory.exe`. Without that +folder, or on a Windows whose runtime is newer, the system's is used. +Tested on Windows 10 22H2 (19045) with an RX 6800 XT: the world is reached. + To install Rust, use rustup (`winget install --id Rustlang.Rustup -e`, or the installer from https://rustup.rs). The first `cargo` command in this repository then fetches the pinned toolchain. Building needs the MSVC C++ diff --git a/apps/victory/build.rs b/apps/victory/build.rs new file mode 100644 index 0000000000..75a9c1b0a9 --- /dev/null +++ b/apps/victory/build.rs @@ -0,0 +1,13 @@ +//! Exports the Agility SDK's `D3D12SDKVersion` and `D3D12SDKPath` (see +//! `src/main.rs`) from the executable, where the Direct3D 12 loader looks +//! for them. + +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let windows = std::env::var("CARGO_CFG_TARGET_OS").is_ok_and(|os| os == "windows"); + let msvc = std::env::var("CARGO_CFG_TARGET_ENV").is_ok_and(|env| env == "msvc"); + if windows && msvc { + println!("cargo:rustc-link-arg-bins=/EXPORT:D3D12SDKVersion,DATA"); + println!("cargo:rustc-link-arg-bins=/EXPORT:D3D12SDKPath,DATA"); + } +} diff --git a/apps/victory/src/main.rs b/apps/victory/src/main.rs index 5c8749f723..0458d6680f 100644 --- a/apps/victory/src/main.rs +++ b/apps/victory/src/main.rs @@ -15,6 +15,27 @@ use std::path::PathBuf; use anyhow::Result; use clap::{Parser, Subcommand, ValueEnum}; +/// Agility SDK: the Direct3D 12 runtime in `D3D12\` next to the executable +/// (`D3D12Core.dll`, from the user's own download of the +/// Microsoft.Direct3D.D3D12 package of this version) instead of the +/// system's, whose shader model may be too low (Windows 10: SM 6.5 on +/// hardware, 6.2 on WARP; the title's pipelines need 6.6). Without that +/// folder, or on a system whose runtime is newer, the system's is used. +/// Exported by `build.rs`. +// The names the Direct3D 12 loader looks up. +#[cfg(windows)] +#[allow(non_upper_case_globals)] +#[unsafe(no_mangle)] +#[used] +pub static D3D12SDKVersion: u32 = 614; + +/// The folder of [`D3D12SDKVersion`]'s runtime, relative to the executable. +#[cfg(windows)] +#[allow(non_upper_case_globals)] +#[unsafe(no_mangle)] +#[used] +pub static D3D12SDKPath: &[u8; 9] = b".\\D3D12\\\0"; + #[derive(Parser)] #[command( name = "victory",