Add experimental PC FSR upscaling #1284

Closed
github-bot wants to merge 4 commits from gh-pr/1284/head into gh-pr/1284/base
Owner

@⁠AwkGrep256 on GitHub · 2026-11-24 17:07 UTC · original
AwkGrep256:pc-fsr → main · +1396 −27 · 13 files · 4 commits · closed without merging

Adds AMD’s PC FidelityFX upscaler to VIctory’s D3D12 path. Set VICTORY_FFX_DIR to the SDK 2.4 Kits\FidelityFX\signedbin directory to enable it. Series S selects FSR by default. For Series X title 1.0.2.1, use a diagnostics build with VICTORY_UPSCALER=7E93F0 and VICTORY_FFX_SCALE=0.5 for 1080p → 4K.

PC FSR progress

Area Status Evidence
Native Windows context and render scale ✅ Verified Series X creates a 1920×1080 → 3840×2160 context. Series S creates a 1280×720 → 1920×1080 context.
Native Windows upscale dispatch ✅ Verified on RX 9070 XT FSR 4.1.2 accepted in-game dispatches on Series X and Series S. The host uses native RGB9E5 (format=67, packed=false).
Slot 6 fallback ✅ GPU regression passed When the host lacks writable RGB9E5, FSR writes into an FP16 scratch texture. VIctory packs and copies the result back into the title’s RGB9E5 output. A second shader read back the expected HDR colors in the synthetic test.
Windows 10 / RTX 4070 SUPER ⏳ Retest pending Bittertea’s earlier build stopped before SDK dispatch because slot 6 had no host texture. The fallback is in bea3a58 and needs an in-game retest on that setup. Original report · Retest request
In-game image 🔍 First frame measured A native Windows Series S run on the companion branch (#1287), with framegen off, captured the first FSR dispatch and the next present. The input was already nearly black, the FSR output was nearly black, and the presented frame was black. The run reached the 145-second cutoff without a GPU reset.
Windows checks ✅ Passed Workspace tests (343 passed, 6 ignored), both Clippy configurations, asset policy, and the diagnostics GPU regression.

Next I’ll compare later Series S world frames to see whether the lit HDR input ever contains the scene, then trace the passes that write it if it stays dark. The first captured frame establishes where that frame was already dark. Image quality and the RTX fallback still need in-game validation.

Related discussion: #730. Frame generation and first-dispatch capture diagnostics are in #1287.

**@⁠AwkGrep256** on GitHub · 2026-11-24 17:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/1284) `AwkGrep256:pc-fsr` → `main` · +1396 −27 · 13 files · 4 commits · closed without merging Adds AMD’s PC FidelityFX upscaler to VIctory’s D3D12 path. Set `VICTORY_FFX_DIR` to the SDK 2.4 `Kits\FidelityFX\signedbin` directory to enable it. Series S selects FSR by default. For Series X title 1.0.2.1, use a diagnostics build with `VICTORY_UPSCALER=7E93F0` and `VICTORY_FFX_SCALE=0.5` for 1080p → 4K. ## PC FSR progress | Area | Status | Evidence | | --- | --- | --- | | Native Windows context and render scale | ✅ Verified | Series X creates a 1920×1080 → 3840×2160 context. Series S creates a 1280×720 → 1920×1080 context. | | Native Windows upscale dispatch | ✅ Verified on RX 9070 XT | FSR 4.1.2 accepted in-game dispatches on Series X and Series S. The host uses native RGB9E5 (`format=67`, `packed=false`). | | Slot 6 fallback | ✅ GPU regression passed | When the host lacks writable RGB9E5, FSR writes into an FP16 scratch texture. VIctory packs and copies the result back into the title’s RGB9E5 output. A second shader read back the expected HDR colors in the synthetic test. | | Windows 10 / RTX 4070 SUPER | ⏳ Retest pending | Bittertea’s earlier build stopped before SDK dispatch because slot 6 had no host texture. The fallback is in `bea3a58` and needs an in-game retest on that setup. [Original report](https://git.gtahub.st/github/Marvisak--VIctory/issues/730) · [Retest request](https://git.gtahub.st/github/Marvisak--VIctory/issues/730) | | In-game image | 🔍 First frame measured | A native Windows Series S run on the companion branch (#1287), with framegen off, captured the first FSR dispatch and the next present. The input was already nearly black, the FSR output was nearly black, and the presented frame was black. The run reached the 145-second cutoff without a GPU reset. | | Windows checks | ✅ Passed | Workspace tests (343 passed, 6 ignored), both Clippy configurations, asset policy, and the diagnostics GPU regression. | Next I’ll compare later Series S world frames to see whether the lit HDR input ever contains the scene, then trace the passes that write it if it stays dark. The first captured frame establishes where that frame was already dark. Image quality and the RTX fallback still need in-game validation. Related discussion: #730. Frame generation and first-dispatch capture diagnostics are in #1287.
With VICTORY_FFX_DIR pointing at the FidelityFX SDK's signedbin, the five
ffx* exports of amd_fidelityfx_loader_xbox.dll and
amd_fidelityfx_upscaler_xbox.dll are served by AMD's PC loader for D3D12
on the host device. The console structures have the PC layouts; the
backend description, command list and textures are swapped for the
host's, and the list's cached bindings are dropped after the upscaler
records.

The console upscaler only has the fixed 1920x1080 Quality tables, so a
Series X configuration that picks it (3840x2160) fails at context
creation. The PC upscaler takes any size.

Diagnostics: VICTORY_UPSCALER=<rva>[,<kind>] makes the title's upscaler
picker return <kind> (1.0.2.1: 7E93F0, 4 direct calls; 7 is FSR, 6 the
title's own).
The title's FSR render-size method (1.0.2.1: 28EF680) takes 2/3 on
Series S and 1.0 on Series X, so Series X with FSR forced on renders at
full 4K and overflows its memory plan (a 32 MiB surface in its third
graphics pool, then the transient heap). With VICTORY_FFX_SCALE=0.6667
it renders 2560x1440 and FSR upscales to 3840x2160; 0.5 gives 1080p.

Both scale loads of that method are pointed at our constant in the
padding after it, after checking the code there.
The create-description walk and the render-scale patch are split out so
they can be tested on synthetic data: the upscale description is taken
only beside the console backend description, and both scale loads end
up pointing at the constant, with other code left alone.

README: VICTORY_FFX_DIR under getting started, VICTORY_UPSCALER and
VICTORY_FFX_SCALE in the diagnostics table.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:26:21 +00:00
github-bot closed this pull request 2026-11-26 04:26:21 +00:00
Author
Owner

@⁠marquezinii on GitHub · 2026-11-24 20:55 UTC · original

Native Windows on NVIDIA, without the title. RTX 5070 (Blackwell), driver 621.40, Windows 11 26300, head bea3a58. AMD's signed DLLs from SDK v2.4.0 Kits/FidelityFX/signedbin.

  • cargo test -p victory-gpu --features diagnostics --locked: 55 passed, 1 ignored, including packs_hdr_pixels_into_a_sampleable_rgb9e5_texture.
  • RGB9E5 on this card: the format support query for DXGI_FORMAT_R9G9B9E5_SHAREDEXP gives Support1=0x8013f0, Support2=0x200: no render target, no typed UAV, no typed UAV store. So on NVIDIA the slot 6 fallback is the path that runs, and its test passes here.
  • Context creation: a throwaway test (not pushed) called this branch's ffxCreateContext with the title's chain shape (the upscale description, then the console backend). Series X sizes (1920x1080 → 3840x2160) and Series S sizes (1280x720 → 1920x1080) both return 0 with a context. The loader's version query on this card lists upscalers 3.1.6 and 2.3.4 and no FSR 4, so NVIDIA gets FSR 3.1.6.

Not checked: a dispatch with real inputs, and anything in game; I have no copy of the title.

**@⁠marquezinii** on GitHub · 2026-11-24 20:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/1284#issuecomment-7144234041) Native Windows on NVIDIA, without the title. RTX 5070 (Blackwell), driver 621.40, Windows 11 26300, head `bea3a58`. AMD's signed DLLs from SDK v2.4.0 `Kits/FidelityFX/signedbin`. - `cargo test -p victory-gpu --features diagnostics --locked`: 55 passed, 1 ignored, including `packs_hdr_pixels_into_a_sampleable_rgb9e5_texture`. - **RGB9E5 on this card:** the format support query for `DXGI_FORMAT_R9G9B9E5_SHAREDEXP` gives `Support1=0x8013f0`, `Support2=0x200`: no render target, no typed UAV, no typed UAV store. So on NVIDIA the slot 6 fallback is the path that runs, and its test passes here. - **Context creation:** a throwaway test (not pushed) called this branch's `ffxCreateContext` with the title's chain shape (the upscale description, then the console backend). Series X sizes (1920x1080 → 3840x2160) and Series S sizes (1280x720 → 1920x1080) both return `0` with a context. The loader's version query on this card lists upscalers `3.1.6` and `2.3.4` and no FSR 4, so NVIDIA gets FSR 3.1.6. Not checked: a dispatch with real inputs, and anything in game; I have no copy of the title.
Author
Owner

@⁠AwkGrep256 on GitHub · 2026-11-24 22:41 UTC · original

Main now does the core of this PR (0b35b7f), so I reworked the parts it doesn't have on top of main's fidelityfx module in #1793: the Series X switches and the RGB9E5 output. Leaving this one open until it's clear which way the maintainer wants it, since #1704 and #1715 are stacked on it.

**@⁠AwkGrep256** on GitHub · 2026-11-24 22:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/1284#issuecomment-7146522762) Main now does the core of this PR (0b35b7f), so I reworked the parts it doesn't have on top of main's `fidelityfx` module in #1793: the Series X switches and the RGB9E5 output. Leaving this one open until it's clear which way the maintainer wants it, since #1704 and #1715 are stacked on it.
Author
Owner

@⁠marquezinii on GitHub · 2026-11-24 23:43 UTC · original

@⁠AwkGrep256 thanks for the note. #1704 and #1715 are now rebuilt on main's fidelityfx module and no longer depend on this PR. #1704 routes to DLSS from the same place main routes to AMD's DLL, and it writes the title's RGB9E5 output through an FP16 texture and a packing pass where the host can't store RGB9E5 through a UAV (NVIDIA: the title-shaped test there passes on an RTX 5070). Nothing keeps this one open on our side.

**@⁠marquezinii** on GitHub · 2026-11-24 23:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/1284#issuecomment-7147727164) @⁠AwkGrep256 thanks for the note. #1704 and #1715 are now rebuilt on `main`'s `fidelityfx` module and no longer depend on this PR. #1704 routes to DLSS from the same place `main` routes to AMD's DLL, and it writes the title's RGB9E5 output through an FP16 texture and a packing pass where the host can't store RGB9E5 through a UAV (NVIDIA: the title-shaped test there passes on an RTX 5070). Nothing keeps this one open on our side.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:36 UTC · original

Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

Main serves the title's FidelityFX calls with the PC upscaler DLL already (victory-hle modules/fidelityfx.rs, VICTORY_FIDELITYFX_DIR, decision of 2026-11-24).

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/1284#issuecomment-7148692685) Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. Main serves the title's FidelityFX calls with the PC upscaler DLL already (victory-hle modules/fidelityfx.rs, VICTORY_FIDELITYFX_DIR, decision of 2026-11-24). If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Author
Owner

@⁠AwkGrep256 on GitHub · 2026-11-25 00:40 UTC · original

What was missed: the Series X part. On Series X the title's upscaler picker returns its own upscaler, so VICTORY_FIDELITYFX_DIR alone does nothing there, and with FidelityFX forced on it renders native 4K and overflows its memory plan. #1284's VICTORY_UPSCALER and VICTORY_FFX_SCALE cover that, and main has neither. Closing this is right otherwise. The Series X part is reworked onto main's fidelityfx module in #1793, verified in the title on an RX 9070 XT (FSR 4.1.2, 1080p to 4K, Series X).

**@⁠AwkGrep256** on GitHub · 2026-11-25 00:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/1284#issuecomment-7148764003) What was missed: the Series X part. On Series X the title's upscaler picker returns its own upscaler, so `VICTORY_FIDELITYFX_DIR` alone does nothing there, and with FidelityFX forced on it renders native 4K and overflows its memory plan. #1284's `VICTORY_UPSCALER` and `VICTORY_FFX_SCALE` cover that, and main has neither. Closing this is right otherwise. The Series X part is reworked onto main's `fidelityfx` module in #1793, verified in the title on an RX 9070 XT (FSR 4.1.2, 1080p to 4K, Series X).
Author
Owner

@⁠RobertAndreiGit on GitHub · 2026-11-26 13:31 UTC · original · edited 2026-11-26 13:59 UTC

RTX 3060 Ti / Proton, Series S: the PC provider reached a world frame at 720p → 1080p. This was a downstream port of the host FidelityFX path, not a build of this PR head. codec-d/cool_fox base f4b48ad766dd, local temporal commit 4d8e5728a3df. Ryzen 5 5600, 32 GB, 8 GB RTX 3060 Ti, NVIDIA 615.78.08, CachyOS Proton, vkd3d-proton 3.2.0 (2576c0b4adfae4a).

On the console path, twelve timed compute shaders matched the title’s upscaler DLL. Their median combined cost was 309.36 ms/frame, 79% of the 390.8 ms in timed guest commands across 15 world intervals. Instrumentation slowed that build to 712 ms/frame; these numbers should not be subtracted from release frame times.

Both replacement paths passed a synthetic GPU pixel readback under Proton. In release gameplay:

Path Pipeline wait Qualifying world intervals Median frame time Median FPS Draws / dropped without a pipeline
PC temporal, provider 3.1.6 500 ms 15 455.8 ms 2.2 3,560 / 363
Same executable and save 24 ms 15 288.4 ms 3.5 4,376 / 292
Single-pass bilinear comparison 500 ms 6 652.7 ms 1.55 3,561 / 349

Settings: 1080p output, Series S, material cap 512, sparse mips off. On temporal, both the context and first successful dispatch reported 1280×720 → 1920×1080; the output used the fork’s FP16 substitute. The spatial comparison logged one early console fallback and at least 128 successful host dispatches; it exited before the 15-interval target.

The user could follow the action on the console-path visual reference. Pixel readback and dispatch logs establish that the replacements wrote an output; nobody confirmed equivalent world/UI rendering on these runs. The save is not a replay: we used the first 15 intervals with 3,000–6,000 draws/frame and ≤15 pending pipelines. The 3.5 FPS result is a measurement of the combination, not a standalone speedup attributable to this PR.

Follow-up with someone watching the 24 ms temporal configuration: a fresh control reproduced 3.5 FPS / 282.4 ms across 15 qualifying world intervals (3,903 draws/frame; 308 dropped). The player described it as visibly smoother and better overall than the earlier runs, but saw backgrounds load a little later and suspected some shading was missing. The scene was visible; the cause of the shading difference and full visual equivalence remain unverified. Provider 3.1.6 and the first 720p → 1080p dispatch were confirmed again.

**@⁠RobertAndreiGit** on GitHub · 2026-11-26 13:31 UTC · [original](https://github.com/Marvisak/VIctory/pull/1284#issuecomment-7193465629) · edited 2026-11-26 13:59 UTC <!-- cool-fox-world-3060ti-20261126:victory-1284.md --> **RTX 3060 Ti / Proton, Series S: the PC provider reached a world frame at 720p → 1080p.** This was a downstream port of the host FidelityFX path, not a build of this PR head. `codec-d/cool_fox` base `f4b48ad766dd`, local temporal commit `4d8e5728a3df`. Ryzen 5 5600, 32 GB, 8 GB RTX 3060 Ti, NVIDIA 615.78.08, CachyOS Proton, vkd3d-proton 3.2.0 (`2576c0b4adfae4a`). On the **console** path, twelve timed compute shaders matched the title’s upscaler DLL. Their median combined cost was **309.36 ms/frame**, 79% of the 390.8 ms in timed guest commands across 15 world intervals. Instrumentation slowed that build to 712 ms/frame; these numbers should not be subtracted from release frame times. Both replacement paths passed a synthetic GPU pixel readback under Proton. In release gameplay: | Path | Pipeline wait | Qualifying world intervals | Median frame time | Median FPS | Draws / dropped without a pipeline | |---|---:|---:|---:|---:|---:| | PC temporal, provider `3.1.6` | 500 ms | 15 | 455.8 ms | 2.2 | 3,560 / 363 | | Same executable and save | 24 ms | 15 | 288.4 ms | 3.5 | 4,376 / 292 | | Single-pass bilinear comparison | 500 ms | 6 | 652.7 ms | 1.55 | 3,561 / 349 | Settings: 1080p output, Series S, material cap 512, sparse mips off. On temporal, both the context and first successful dispatch reported `1280×720 → 1920×1080`; the output used the fork’s FP16 substitute. The spatial comparison logged one early console fallback and at least 128 successful host dispatches; it exited before the 15-interval target. The user could follow the action on the console-path visual reference. Pixel readback and dispatch logs establish that the replacements wrote an output; nobody confirmed equivalent world/UI rendering on these runs. The save is not a replay: we used the first 15 intervals with 3,000–6,000 draws/frame and ≤15 pending pipelines. The 3.5 FPS result is a measurement of the combination, not a standalone speedup attributable to this PR. **Follow-up with someone watching the 24 ms temporal configuration:** a fresh control reproduced **3.5 FPS / 282.4 ms** across 15 qualifying world intervals (3,903 draws/frame; 308 dropped). The player described it as visibly smoother and better overall than the earlier runs, but saw backgrounds load a little later and suspected some shading was missing. The scene was visible; the cause of the shading difference and full visual equivalence remain unverified. Provider `3.1.6` and the first 720p → 1080p dispatch were confirmed again.
Author
Owner

@⁠AwkGrep256 on GitHub · 2026-11-26 13:45 UTC · original

@⁠RobertAndreiGit Thanks for testing this on Proton and sharing the numbers. The successful FSR 3.1.6 dispatch at 720p → 1080p on a 3060 Ti is a useful NVIDIA datapoint. I appreciate you separating the pipeline-wait change from the FSR result.

For anyone following this closed PR, the PC SDK port for fxceless is in #86, and the upstream Series X controls are in #1793. If you have a link to the cool_fox diff, I’d be interested in seeing how you handled the FP16 output.

**@⁠AwkGrep256** on GitHub · 2026-11-26 13:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/1284#issuecomment-7193783977) @⁠RobertAndreiGit Thanks for testing this on Proton and sharing the numbers. The successful FSR 3.1.6 dispatch at 720p → 1080p on a 3060 Ti is a useful NVIDIA datapoint. I appreciate you separating the pipeline-wait change from the FSR result. For anyone following this closed PR, the [PC SDK port for fxceless is in #86](https://github.com/fxceless/victory-fork/pull/86), and the [upstream Series X controls are in #1793](https://git.gtahub.st/github/Marvisak--VIctory/pulls/1793). If you have a link to the `cool_fox` diff, I’d be interested in seeing how you handled the FP16 output.
Author
Owner

@⁠RobertAndreiGit on GitHub · 2026-11-26 14:11 UTC · original

@⁠AwkGrep256 Thanks! Here’s the exact cool_fox diff and two-frame readback test, based on upstream 0b35b7f.

The RGB9E5 → FP16 allocation was already in the fork. The change on the SDK side is in fidelityfx.rs: just before dispatch we read GetDesc().Format on the actual host texture. If it’s DXGI_FORMAT_R16G16B16A16_FLOAT (10), we set the matching FFX resource description to FFX_API_SURFACE_FORMAT_R16G16B16A16_FLOAT (4) and pass that texture to the SDK. It writes straight into the FP16 target; there’s no pack-back to RGB9E5 in the bridge.

On the 3060 Ti under Proton, the synthetic test requested RGB9E5, got host format 10, and checked every output pixel against a known colour after two dispatches with provider 3.1.6. The first in-game 720p → 1080p dispatch also reported output format 10.

**@⁠RobertAndreiGit** on GitHub · 2026-11-26 14:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/1284#issuecomment-7194398687) @⁠AwkGrep256 Thanks! Here’s the [exact `cool_fox` diff and two-frame readback test](https://gist.github.com/RobertAndreiGit/691cb38635bb073a94c6b5eb2b81ea96#file-temporal-from-material-baseline-patch), based on upstream `0b35b7f`. The RGB9E5 → FP16 allocation was already in the fork. The change on the SDK side is in `fidelityfx.rs`: just before dispatch we read `GetDesc().Format` on the **actual host texture**. If it’s `DXGI_FORMAT_R16G16B16A16_FLOAT` (`10`), we set the matching FFX resource description to `FFX_API_SURFACE_FORMAT_R16G16B16A16_FLOAT` (`4`) and pass that texture to the SDK. It writes straight into the FP16 target; there’s no pack-back to RGB9E5 in the bridge. On the 3060 Ti under Proton, the synthetic test requested RGB9E5, got host format `10`, and checked every output pixel against a known colour after two dispatches with provider `3.1.6`. The first in-game 720p → 1080p dispatch also reported output format `10`.
Author
Owner

@⁠AwkGrep256 on GitHub · 2026-11-26 14:55 UTC · original

@⁠RobertAndreiGit Thanks for sharing the exact diff and the pixel test. I pushed the same host-format check to fxceless #86. When D3D12 gives us an FP16 texture, we now describe it as FP16 to the SDK. The existing packed RGB9E5 path is still there for targets that need it. The descriptor regression and build checks passed. Your Proton readback is the end-to-end evidence we have so far.

**@⁠AwkGrep256** on GitHub · 2026-11-26 14:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/1284#issuecomment-7195524126) @⁠RobertAndreiGit Thanks for sharing the exact diff and the pixel test. I pushed the same host-format check to [fxceless #86](https://github.com/fxceless/victory-fork/pull/86). When D3D12 gives us an FP16 texture, we now describe it as FP16 to the SDK. The existing packed RGB9E5 path is still there for targets that need it. The descriptor regression and build checks passed. Your Proton readback is the end-to-end evidence we have so far.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1284
No description provided.