CGBJ's renderer, DLSS, an F1 settings menu, frame generation, ray tracing switch

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]>
This commit is contained in:
trustno1-coderandClaude Fable 5.2 committed 2026-11-26 17:56:14 -08:00
1 parent 9e7ab9d9a2
commit 63957271cd
55 files changed
+8030 -1313

No files matched your search

+3
View File
@@ -12,6 +12,7 @@ victory-core.workspace = true
victory-pe.workspace = true
victory-loader.workspace = true
victory-hle.workspace = true
victory-gpu.workspace = true
victory-shader = { workspace = true, features = ["host"] }
victory-game.workspace = true
anyhow.workspace = true
@@ -21,6 +22,8 @@ clap.workspace = true
walkdir.workspace = true
[features]
# NVIDIA DLSS for the title's upscale (VICTORY_UPSCALE=dlss); needs VICTORY_DLSS_SDK.
dlss = ["victory-gpu/dlss"]
# Debug-level logs and the debugging switches (frame capture, stack dumps,
# the host debug layer, scripted keys). Off in a plain release build.
diagnostics = [
+30 -1
View File
@@ -108,6 +108,11 @@ pub fn run(
println!("console {}", victory_hle::console::current().name());
let dlls = victory_loader::load_title_dlls(image.info(), title_dir, &images, &wanted)?;
for (name, dll) in &dlls {
if name.eq_ignore_ascii_case(victory_hle::modules::ffx::LOADER)
&& let Some(real) = dll.export("ffxDispatch")
{
victory_hle::modules::ffx::set_real_dispatch(real);
}
println!("title dll {name} at {:#x}", dll.base());
victory_hle::runtime::set_image_path(dll.base(), &title_dir.join(name));
}
@@ -162,7 +167,31 @@ pub fn run(
show(name, dll.bind_imports(&with_dlls, policy)?);
}
let exe_name = exe.file_name().unwrap_or_default().to_string_lossy();
show(&exe_name, image.bind_imports(&with_dlls, policy)?);
// `VICTORY_UPSCALE=stretch` (Series S): the upscale dispatch is ours
// (`victory_hle::modules::ffx`, a plain stretch) instead of the title's
// own FidelityFX passes, which are slow translated on 32-lane hosts; the
// rest of that DLL stays the title's. Unset: the title's own, as before.
struct TakeDispatch<'a>(&'a dyn victory_loader::ImportResolver, bool);
impl victory_loader::ImportResolver for TakeDispatch<'_> {
fn resolve(&self, dll: &str, symbol: &victory_pe::ImportSymbol) -> victory_loader::Resolution {
let ours = self.1
&& dll.eq_ignore_ascii_case(victory_hle::modules::ffx::LOADER)
&& matches!(symbol, victory_pe::ImportSymbol::Name { name, .. } if name == "ffxDispatch");
if ours {
return victory_loader::Resolution::Found {
address: victory_hle::modules::ffx::dispatch_address(),
provenance: victory_loader::Provenance::Hle,
};
}
self.0.resolve(dll, symbol)
}
}
let take = victory_hle::console::current() == victory_hle::console::Console::SeriesS
&& std::env::var_os("VICTORY_UPSCALE").is_some_and(|v| v == "stretch" || v == "dlss");
if take {
println!("upscale the title's ffxDispatch is ours (VICTORY_UPSCALE=stretch|dlss)");
}
show(&exe_name, image.bind_imports(&TakeDispatch(&with_dlls, take), policy)?);
if execute {
let size = image.info().size_of_image as usize;
// SAFETY: the image stays mapped, and nothing of it has run yet.