The default of scripts\play-nvidia.ps1 changes: the game renders its own 720p and DLSS takes it to 1080p (Series S), in place of the half render scale and the title's upscaler. -Resolution still reaches the older path. - Renderer: codec-d/cool_fox f4b48ad (GPL-3.0) with this fork's NVIDIA fixes on top (residency.rs, stretch.rs, the ffx upscale dispatch). - DLSS for the title's upscale, from avatarmanz/VIctory-7900XTX pull request 203 (feature `dlss`, VICTORY_UPSCALE=dlss), with VICTORY_DLSS_PRESET and a live sharpness setting. - F1 settings menu in the game (host/menu.rs): saved to victory-settings.txt, applied by the launcher at the next start, "save and restart" from the menu. F3: the panel, now with the generated frame rate beside the real one. - DLSS frame generation through NVIDIA Streamline (streamline.rs, fg.rs), 2x to 6x, the amount changed while playing. Constants and the depth and motion vector tags are handed over at each present. - VICTORY_FPS_CAP: the title's own 30 frames a second can be lifted (60, 120, none), live from the menu. - Real ray tracing as an option (-RayTracing, VICTORY_BVH_BUILDER=1): on this renderer the structure builder runs on NVIDIA. Frame generation is left off with it: the two together run at about 0.1 fps, cause not found. - VICTORY_HEAP_RECHECK_EVERY: textures picked by index looked at again for the whole run (a test against the posterized look). - Get-NVIDIA-DLSS.cmd / scripts\get-nvidia-sdks.ps1: fetch the few NVIDIA files DLSS and frame generation need (about 70 MB) from NVIDIA's GitHub into nvidia-sdk\ (git-ignored). They are NVIDIA's, under NVIDIA's licences, and are not part of this repository. Without them the picture is stretched and there is no frame generation. - scripts\build-nvidia.ps1; the launcher builds the layer when it is not built, and again with DLSS once those files are there. Measured on an RTX 5070 (Series S, DLSS, opening rooms): about 15-17 fps without ray tracing, 13-15 with it, before generated frames. What is known to be wrong is in the README's new section. Co-Authored-By: Claude Fable 5.2 <[email protected]>
55 lines
2.2 KiB
Rust
55 lines
2.2 KiB
Rust
//! Fingerprints the shader translator, so that cached translations
|
|
//! (`src/shader_cache.rs`) last until the translator itself changes and not
|
|
//! only until the next build of anything.
|
|
|
|
use std::path::{Path, PathBuf};
|
|
|
|
fn files(dir: &Path, out: &mut Vec<PathBuf>) {
|
|
for entry in std::fs::read_dir(dir).into_iter().flatten().flatten() {
|
|
let path = entry.path();
|
|
if path.is_dir() {
|
|
files(&path, out);
|
|
} else {
|
|
out.push(path);
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let here = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap_or_default());
|
|
let crates = here.join("..");
|
|
let root = crates.join("..");
|
|
// The translator, what it is built from, and the form entries are kept in.
|
|
let mut all = vec![
|
|
crates.join("victory-shader/Cargo.toml"),
|
|
here.join("src/shader_cache.rs"),
|
|
root.join("Cargo.lock"),
|
|
root.join("rust-toolchain.toml"),
|
|
];
|
|
let source = crates.join("victory-shader/src");
|
|
println!("cargo:rerun-if-changed={}", source.display());
|
|
files(&source, &mut all);
|
|
all.sort();
|
|
let mut hash = blake3::Hasher::new();
|
|
for path in &all {
|
|
println!("cargo:rerun-if-changed={}", path.display());
|
|
// Names and line endings as they are in every checkout.
|
|
let name = path.file_name().unwrap_or_default().to_string_lossy().into_owned();
|
|
let bytes: Vec<u8> = std::fs::read(path).unwrap_or_default().into_iter().filter(|&b| b != 13).collect();
|
|
hash.update(name.as_bytes());
|
|
hash.update(&(bytes.len() as u64).to_le_bytes());
|
|
hash.update(&bytes);
|
|
}
|
|
println!("cargo:rerun-if-changed=build.rs");
|
|
println!("cargo:rustc-env=VICTORY_TRANSLATOR={}", hash.finalize().to_hex());
|
|
// The `dlss` feature links the DLSS SDK's loader (`nvsdk_ngx_d.lib`, the
|
|
// dynamic-CRT one) from `VICTORY_DLSS_SDK`.
|
|
println!("cargo:rerun-if-env-changed=VICTORY_DLSS_SDK");
|
|
if std::env::var_os("CARGO_FEATURE_DLSS").is_some() {
|
|
let sdk = std::env::var_os("VICTORY_DLSS_SDK")
|
|
.map(PathBuf::from)
|
|
.expect("the dlss feature needs VICTORY_DLSS_SDK (the NVIDIA/DLSS checkout)");
|
|
println!("cargo:rustc-link-search=native={}", sdk.join("lib/Windows_x86_64/x64").display());
|
|
}
|
|
}
|