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

Open
YeokiNoewChi wants to merge 3 commits from upstream-pr/203 into main
YeokiNoewChi commented 2026-11-26 11:29:10 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by YeokiNoewChi on 2026-11-26T11:29:10Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6625690255 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/203). Originally posted by [YeokiNoewChi](https://github.com/YeokiNoewChi) on 2026-11-26T11:29:10Z. --- 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)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/203:upstream-pr/203'
git switch 'upstream-pr/203'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/203'
git switch 'upstream-pr/203'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/203'
git switch 'upstream-pr/203'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/203'
git switch 'main'
git merge --squash 'upstream-pr/203'
git switch 'main'
git merge --ff-only 'upstream-pr/203'
git switch 'main'
git merge 'upstream-pr/203'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
avatarmanz/VIctory-7900XTX!203
No description provided.