Series S upscale on NVIDIA: DLSS (or a stretch) in place of the title's FidelityFX passes, opt-in #203

Open
github-bot wants to merge 3 commits from github-bot/gh-203 into main AGit
Owner

@⁠YeokiNoewChi on GitHub · 2026-11-26 11:29 UTC · original
YeokiNoewChi:nvidia-dlss-upscale → main · +1053 −1 · 12 files · 3 commits · open

On NVIDIA cards the title's own FidelityFX upscaler is the most expensive thing in a Series S frame. This tree translates the upscaler DLL's passes (the ACCC/FSPX containers) and runs them, which is right on RDNA, but on a 32-lane card they come out slow: a VICTORY_GPU_TIMING=1 run on an RTX 3070 Ti put about 150-250 ms of card time a frame in ten compute programs that are not in shaders.rpf (the four largest 8cbd7f5b9ce7530c 15x270x1, f46117391dd81461 15x540x1, f7fc6c984427fef3 15x540x1, 47d8c225abfcb246 1013x1x1). Skipping them is fast but leaves the upscaler half-run: ghost trails.

This takes the upscale dispatch in Series S and does it another way, off by default.

What it does

  • VICTORY_UPSCALE=stretch|dlss (Series S only; unset = the title's own upscaler, as now). The exe's import of ffxDispatch from amd_fidelityfx_loader_xbox.dll is bound to victory_hle::modules::ffx; an upscale description (FFX_API_DISPATCH_DESC_TYPE_UPSCALE) is handled here, every other dispatch goes on to the title's DLL. The hook and the stretch pass are CuteBooty/victory-8gb's (ffx.rs, over.rs there); the struct is extended to the whole ffxDispatchDescUpscale (offsets tested).
  • stretch: a bilinear compute stretch of the colour input over the output (victory_gpu::stretch). Fast, soft, nothing from outside the repository.
  • dlss: NVIDIA DLSS (victory_gpu::dlss, behind a cargo feature dlss, off unless built with it). The title already gives everything DLSS takes: colour (RGBA16F, HDR), depth, motion vectors (RG16F, render size), jitter, reset, near/far. NGX is started on the host device at the first upscale, a super sampling feature is made per input/output size and flags (MV low-res + jittered, HDR by the colour format, depth inverted by near > far, auto exposure when no exposure texture is given), and evaluated on the list in place of the title's passes. Any failure (no SDK DLL, an older driver, a refused feature) falls back to the stretch, logged once.
  • With VICTORY_THIN=1 the upscale is a call of the written-down stream like the others (a new op UPSCALE, its arguments as 11 words: list::Upscale), recorded by the translating thread. Without that the hook found no host list at the call and the title's upscaler ran; the stretch alone crashed before the world.
  • VICTORY_UPSCALE_PROBE=1 logs what the title gives each upscale (sizes and formats of every input, jitter, motion scale, reset, near/far, fov, flags), the first 12 and then one in 300.

Building with DLSS

No NVIDIA files are added to the repository, and none are needed for a normal build. To build with it, check out the DLSS SDK (github.com/NVIDIA/DLSS: include and lib/Windows_x86_64) somewhere outside the tree and:

$env:VICTORY_DLSS_SDK = 'D:\sdk\DLSS'
cargo build --profile diag -p victory --features "diagnostics dlss"
$env:VICTORY_UPSCALE = 'dlss'
$env:VICTORY_DLSS_DIR = 'D:\sdk\DLSS\lib\Windows_x86_64\rel'   # where nvngx_dlss.dll is

build.rs links nvsdk_ngx_d.lib (static, dynamic CRT) from VICTORY_DLSS_SDK only when the feature is on. The DLSS SDK is under NVIDIA's own licence, so a build with the feature should be kept for one's own use and not passed around as a binary; the source here only calls its C API.

Tuning switches, all read once: VICTORY_DLSS_QUALITY (0..2, 5 = DLAA; 2), VICTORY_DLSS_SHARPNESS, VICTORY_DLSS_MV_SIGN=-1, VICTORY_DLSS_JITTER_SIGN=-1, VICTORY_DLSS_HDR=0|1, VICTORY_DLSS_DEPTH_INVERTED=0|1. None was needed here.

Where it does nothing

Case Result
VICTORY_UPSCALE unset unchanged: the title's own upscaler
Series X unchanged (the hook is taken in Series S only; not tried there)
dlss without the feature, or on AMD/Intel the stretch
A dispatch that is not an upscale the title's DLL, as before

Measured

RTX 3070 Ti 8 GB, Ryzen 5 5600X, 64 GB, Windows 11 26300, Series S, the first boat mission standing (autotest boat checkpoint), warm cache, with this tree's play.ps1-style switches plus VICTORY_LEVELS_ON_DEMAND=1 VICTORY_CARD_BUFFERS_MB=768 VICTORY_TEXTURE_BUDGET_MB=1800 (to stay inside an 8 GB card's budget). Medians of the 5-second frame lines with no shader being made and over 2,000 draws:

upscale median frame card per frame picture
the title's own FidelityFX 297 ms ~240 ms right
its ten programs skipped 102 ms ~20 ms ghost trails
dlss 87.9 ms ~17 ms sharp, no trails
The rows above were taken on codec-d/cool_fox's tree (pareto-residency, parts of which this tree merged) with the same commits. A 35-minute driving run there with dlss (forward throttle every 90 s): no crash, nothing refused, median 101.7 ms at 3,400-6,800 draws, VRAM steady.

On this branch (9576c45f + these commits), same scene and switches, DLSS starts and runs (DLSS: feature made input=(1280, 720) output=(1920, 1080) hdr=true depth_inverted=true auto_exposure=true), no crash, but the frame is limited by something else here: the pass over the heap's views took 132 ms a frame looking at slots (19 ms on the cool_fox tree), 100 ms with VICTORY_PORT_CONSTANTS=1 VICTORY_PORT_DESCRIPTORS=1; medians 310 and 223 ms. That is independent of the upscale; I have not looked into it further, so treat the cool_fox rows as the measure of what the upscale itself saves.

Credits

The ffxDispatch hook and the stretch pass are CuteBooty/victory-8gb's. The finding that the upscaler is the cost on NVIDIA came from codec-d/cool_fox, whose tree runs the title's upscaler. Written with Claude Code.

🤖 Generated with Claude Code

**@⁠YeokiNoewChi** on GitHub · 2026-11-26 11:29 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/203) `YeokiNoewChi:nvidia-dlss-upscale` → `main` · +1053 −1 · 12 files · 3 commits · open On NVIDIA cards the title's own FidelityFX upscaler is the most expensive thing in a Series S frame. This tree translates the upscaler DLL's passes (the `ACCC`/`FSPX` containers) and runs them, which is right on RDNA, but on a 32-lane card they come out slow: a `VICTORY_GPU_TIMING=1` run on an RTX 3070 Ti put about **150-250 ms of card time a frame** in ten compute programs that are not in `shaders.rpf` (the four largest `8cbd7f5b9ce7530c` 15x270x1, `f46117391dd81461` 15x540x1, `f7fc6c984427fef3` 15x540x1, `47d8c225abfcb246` 1013x1x1). Skipping them is fast but leaves the upscaler half-run: ghost trails. This takes the upscale dispatch in Series S and does it another way, off by default. ## What it does - `VICTORY_UPSCALE=stretch|dlss` (Series S only; unset = the title's own upscaler, as now). The exe's import of `ffxDispatch` from `amd_fidelityfx_loader_xbox.dll` is bound to `victory_hle::modules::ffx`; an upscale description (`FFX_API_DISPATCH_DESC_TYPE_UPSCALE`) is handled here, every other dispatch goes on to the title's DLL. The hook and the stretch pass are CuteBooty/victory-8gb's (`ffx.rs`, `over.rs` there); the struct is extended to the whole `ffxDispatchDescUpscale` (offsets tested). - `stretch`: a bilinear compute stretch of the colour input over the output (`victory_gpu::stretch`). Fast, soft, nothing from outside the repository. - `dlss`: NVIDIA DLSS (`victory_gpu::dlss`, behind a cargo feature `dlss`, off unless built with it). The title already gives everything DLSS takes: colour (RGBA16F, HDR), depth, motion vectors (RG16F, render size), jitter, reset, near/far. NGX is started on the host device at the first upscale, a super sampling feature is made per input/output size and flags (MV low-res + jittered, HDR by the colour format, depth inverted by near > far, auto exposure when no exposure texture is given), and evaluated on the list in place of the title's passes. Any failure (no SDK DLL, an older driver, a refused feature) falls back to the stretch, logged once. - With `VICTORY_THIN=1` the upscale is a call of the written-down stream like the others (a new op `UPSCALE`, its arguments as 11 words: `list::Upscale`), recorded by the translating thread. Without that the hook found no host list at the call and the title's upscaler ran; the stretch alone crashed before the world. - `VICTORY_UPSCALE_PROBE=1` logs what the title gives each upscale (sizes and formats of every input, jitter, motion scale, reset, near/far, fov, flags), the first 12 and then one in 300. ## Building with DLSS No NVIDIA files are added to the repository, and none are needed for a normal build. To build with it, check out the DLSS SDK (github.com/NVIDIA/DLSS: `include` and `lib/Windows_x86_64`) somewhere outside the tree and: ```powershell $env:VICTORY_DLSS_SDK = 'D:\sdk\DLSS' cargo build --profile diag -p victory --features "diagnostics dlss" $env:VICTORY_UPSCALE = 'dlss' $env:VICTORY_DLSS_DIR = 'D:\sdk\DLSS\lib\Windows_x86_64\rel' # where nvngx_dlss.dll is ``` `build.rs` links `nvsdk_ngx_d.lib` (static, dynamic CRT) from `VICTORY_DLSS_SDK` only when the feature is on. The DLSS SDK is under NVIDIA's own licence, so a build with the feature should be kept for one's own use and not passed around as a binary; the source here only calls its C API. Tuning switches, all read once: `VICTORY_DLSS_QUALITY` (0..2, 5 = DLAA; 2), `VICTORY_DLSS_SHARPNESS`, `VICTORY_DLSS_MV_SIGN=-1`, `VICTORY_DLSS_JITTER_SIGN=-1`, `VICTORY_DLSS_HDR=0|1`, `VICTORY_DLSS_DEPTH_INVERTED=0|1`. None was needed here. ## Where it does nothing | Case | Result | |---|---| | `VICTORY_UPSCALE` unset | unchanged: the title's own upscaler | | Series X | unchanged (the hook is taken in Series S only; not tried there) | | `dlss` without the feature, or on AMD/Intel | the stretch | | A dispatch that is not an upscale | the title's DLL, as before | ## Measured RTX 3070 Ti 8 GB, Ryzen 5 5600X, 64 GB, Windows 11 26300, Series S, the first boat mission standing (`autotest` boat checkpoint), warm cache, with this tree's `play.ps1`-style switches plus `VICTORY_LEVELS_ON_DEMAND=1 VICTORY_CARD_BUFFERS_MB=768 VICTORY_TEXTURE_BUDGET_MB=1800` (to stay inside an 8 GB card's budget). Medians of the 5-second frame lines with no shader being made and over 2,000 draws: | upscale | median frame | card per frame | picture | |---|---|---|---| | the title's own FidelityFX | 297 ms | ~240 ms | right | | its ten programs skipped | 102 ms | ~20 ms | ghost trails | | `dlss` | **87.9 ms** | ~17 ms | sharp, no trails | The rows above were taken on codec-d/cool_fox's tree (pareto-residency, parts of which this tree merged) with the same commits. A 35-minute driving run there with `dlss` (forward throttle every 90 s): no crash, nothing refused, median 101.7 ms at 3,400-6,800 draws, VRAM steady. On this branch (9576c45f + these commits), same scene and switches, DLSS starts and runs (`DLSS: feature made input=(1280, 720) output=(1920, 1080) hdr=true depth_inverted=true auto_exposure=true`), no crash, but the frame is limited by something else here: the pass over the heap's views took 132 ms a frame looking at slots (19 ms on the cool_fox tree), 100 ms with `VICTORY_PORT_CONSTANTS=1 VICTORY_PORT_DESCRIPTORS=1`; medians 310 and 223 ms. That is independent of the upscale; I have not looked into it further, so treat the cool_fox rows as the measure of what the upscale itself saves. ## Credits The `ffxDispatch` hook and the stretch pass are CuteBooty/victory-8gb's. The finding that the upscaler is the cost on NVIDIA came from codec-d/cool_fox, whose tree runs the title's upscaler. Written with Claude Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cool_fox runs the title's own FidelityFX upscaler, translating its ACCC passes. On an RTX 3070 Ti
those passes (ten compute programs not in shaders.rpf, e.g. 8cbd7f5b 15x270, f4611739 15x540)
cost about 145-200 ms of card time a frame in a timing run; skipping them left ghosting.

With VICTORY_UPSCALE=stretch in Series S, the exe's import of ffxDispatch binds to
victory_hle::modules::ffx (from CuteBooty/victory-8gb): an upscale dispatch becomes a plain
bilinear stretch of the colour input over the output (victory_gpu::stretch, from its over.rs),
other dispatches go to the title's DLL. Unset: the title's own upscaler, as before.

VICTORY_UPSCALE_PROBE=1 logs every input the title gives the upscale (sizes and formats of
colour, depth, motion vectors, exposure, reactive, composition, output; jitter, motion scale,
reset, near/far, fov, flags), groundwork for a temporal upscaler (DLSS) in place of the stretch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The title's ffxDispatch gives colour (RGBA16F, HDR), depth, motion vectors (RG16F, render size),
jitter and reset: what DLSS takes. victory_gpu::dlss (feature `dlss`, links the DLSS SDK's
nvsdk_ngx_d.lib from VICTORY_DLSS_SDK; nvngx_dlss.dll from VICTORY_DLSS_DIR) starts NGX on the
host device, makes the super sampling feature per input/output size (MV low-res and jittered, HDR
by the colour format, depth inverted by near > far, auto exposure without an exposure texture)
and evaluates it on the list in place of the title's passes; on any failure the upscale is the
plain stretch.

Under VICTORY_THIN=1 list calls are written down and recorded later: the upscale is now a call of
that stream too (list::Upscale as 11 words, thin op UPSCALE, list::upscale_now), which also makes
VICTORY_UPSCALE=stretch work there (it crashed before the world without).

Measured on an RTX 3070 Ti 8 GB / Ryzen 5 5600X, Series S, the boat mission, with the cool_fox
launcher's switches + VICTORY_CARD_BUFFERS_MB=768 VICTORY_TEXTURE_BUDGET_MB=1800, no skip list:
median 87.9 ms over 87 warm lines (shots 84-90 ms), card 16.7 ms; the title's own FSR passes
had cost about 150-250 ms of card time (297 ms median). Picture: sharp, no speckling.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:30:50 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-hle/src/modules/mod.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/203/head:github-bot/gh-203'
git switch 'github-bot/gh-203'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-203'
git switch 'github-bot/gh-203'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-203'
git switch 'github-bot/gh-203'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-203'
git switch 'main'
git merge --squash 'github-bot/gh-203'
git switch 'main'
git merge --ff-only 'github-bot/gh-203'
git switch 'main'
git merge 'github-bot/gh-203'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.