Skip to content
Open
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
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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\<profile>\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++
Expand Down
13 changes: 13 additions & 0 deletions apps/victory/build.rs
Original file line number Diff line number Diff line change
@@ -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");
}
}
21 changes: 21 additions & 0 deletions apps/victory/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down