Skip to content

Add experimental PC FSR upscaling - #86

Open
AwkGrep256 wants to merge 2 commits into
fxceless:mainfrom
AwkGrep256:pc-fsr
Open

AwkGrep256 wants to merge 2 commits into
fxceless:mainfrom
AwkGrep256:pc-fsr

Conversation

@AwkGrep256

@AwkGrep256 AwkGrep256 commented Nov 24, 2026 •

Copy link
Copy Markdown

Important

Bring the PC FidelityFX SDK upscaler to this fork. The fork’s main lacks the Windows D3D12 SDK path. With VICTORY_FFX_DIR set, #86 lets the title use AMD’s PC upscaler. Upstream Marvisak/VIctory#1793 adds Series X controls to upstream’s existing host implementation.

✅ On Windows with an RTX 4060 Ti, #86 + #32 produced a real SDK dispatch and a visible Series S world. That setup needed #32 to reach the first frame. Independent test report

How this fits with #188: #188 adds menus and HUD through second-plane presentation and provides a plain stretch for ffxDispatch. Both PRs add the same hook. A combined test branch exercised PC FSR when configured and the plain stretch otherwise.

Ports Marvisak/VIctory#1284 to this fork, rebased on c96b4f2. It lets the title call AMD’s PC FidelityFX upscaler on the host D3D12 device. Set VICTORY_FFX_DIR to Kits/FidelityFX/signedbin from AMD’s FidelityFX SDK 2.4 to enable it.

The port keeps this fork’s lazy host texture allocation. Where the device cannot write RGB9E5 directly, the SDK can write RGBA16F and the compatibility layer packs that result into the title’s sampleable RGB9E5 texture. This covers the SDK output path. The title’s own RGB9E5 render-target writes are discussed in #13 and #32.

Validation

  • Both workspace clippy builds and the locked workspace tests passed locally on the rebased branch. The branch includes a separate one-line build guard for the diagnostics helper that caused default clippy to fail on the fork’s base.

  • Windows diagnostics build passed with cargo build --locked --offline --profile diag -p victory --features diagnostics.

  • Both focused FidelityFX tests passed, including the RGB9E5 pack-and-sample test on WARP.

  • An independent Windows run on an RTX 4060 Ti with 4e17478 + GPU: 16-bit float RGBA stands in for R9G9B9E5 render targets #32 + this PR confirmed a real SDK dispatch and a visible Series S world. On that setup, GPU: 16-bit float RGBA stands in for R9G9B9E5 render targets #32 was required to reach the first frame. Test report

@rocobalt1

Copy link
Copy Markdown

The two things the description lists as still needing validation both work on this machine: the SDK dispatch happens, and a frame is visible in the title.

Setup: Windows 11, RTX 4060 Ti 8 GB, driver 32.0.16.1656, Ryzen 9 5900X, 64 GB. Build is 4e17478 + #32 + this PR (merge 7f700a6), cargo build --profile diag -p victory --features diagnostics. VICTORY_FFX_DIR points at signedbin from FidelityFX-SDK v2.4.0 (amd_fidelityfx_loader_dx12.dll 38 KB, amd_fidelityfx_upscaler_dx12.dll 55 MB, both PE). Fresh VICTORY_DATA_DIR, VICTORY_NO_WATCHDOG=1, VICTORY_SHADER_LOOP_LIMIT=32, VICTORY_D3D12_DRED=1, no VICTORY_DISPLAY_MODE, --console series-s. TdrDelay=60/TdrDdiDelay=60 are set machine-wide here, so the times below are upper bounds.

The context and the dispatch:

ffx: ffxCreateContext with description type 0x1000b
ffx: upscale context on the host GPU render=[1280, 720] upscale=[1920, 1080] flags=41 result=0 provider="3.1.6"
ffx: jitter phase count r=0 q.render_width=1280 q.display_width=1920 count=Some(18)
ffx: first upscale recorded on the host GPU render=[1280, 720] upscale=[1920, 1080] result=0

What that changes on this profile: before this PR, --console series-s never showed the world. The title asked for FFX_FSR4_PASS_0..26/RCAS/SPD_AUTOEXPOSURE (29 DeserializeComputePipelineStateX failures, hr=0x80004001) and one millisecond later 20 compute pipelines were refused with converter shader.dxil v1: malformed shader: no DXIL part, every one of whose hashes is absent from shaders.rpf, packs.rpf and core_bvh4.rpf (VICTORY_TRANSLATE_ONLY selects 0 of 26 531 programs). The frame stayed black from the first world frame to the last.

With this PR the same profile draws a frame: no DXIL part count is 0, 15 shader refusals in the whole run (the ordinary pack ones: PS_PuddleDetect 6, three water programs, PS_DeferredTextured 3, CS_ShadowRenderTiledCascadesAlphaCBPPPC 1), and the prison cell, its objects, the barred window and the shadows on the floor are all visible. 1 733 - 5 760 draws per frame at 380 - 432 ms (2 - 3 fps).

Two notes, neither of them about this PR:

No game data; counts, hashes and program names only.

@adriaespii

Copy link
Copy Markdown

Independent test run on commit f2ba7f5 (AMD RDNA4):

  • Hardware: AMD Radeon RX 9070 (driver 32.0.32015.7029), AMD Ryzen 5 7600, Windows 11 Pro, Rust 1.98.1 (x86_64-pc-windows-msvc)
  • cargo clippy --workspace --all-targets -- -D warnings: 0 warnings
  • cargo test --workspace: 497 passed, 0 failed, 7 ignored (victory-gpu: 111 passed, 0 failed, 1 ignored; victory-shader: 210 passed, 0 failed, 2 ignored)
  • Not tested: live FSR upscaling with PC FidelityFX DLLs / game run (no game files on this machine)

AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.

@rocobalt1

Copy link
Copy Markdown

A regression this PR introduces on the series-s profile, which the description's validation list does not cover: the title's UI is invisible with the upscaler on, while the same build on series-x shows it.

Same machine: RTX 4060 Ti 8 GB, driver 32.0.16.1656, Windows 11; build 4e17478 + #32 + #86 + #77, VICTORY_FFX_DIR set, VICTORY_SHADER_LOOP_LIMIT=256, VICTORY_NO_WATCHDOG=1, fresh VICTORY_DATA_DIR, TdrDelay=60 machine-wide.

series-x series-s (this PR active)
world visible visible
hair (loop 256) visible, correct visible, correct
pause menu / shell UI visible nothing
draws a frame in the shell 22 - 45 22 - 45
upscale n/a render=[1280,720] upscale=[1920,1080] result=0

So the UI draws are issued (same counts on both profiles) but nothing reaches the screen. The title accepts input blind: you can open the pause menu, move the selection and resume, with an empty frame.

What it is not. I added a temporary log line in present counting planes, logged when the count changes:

PICTURE: planes presented frame=1 planes=1 counts=[1]

The same single plane, one resource, on both profiles. So the UI is not being composited into a plane that present ignores - it is in the frame the title hands over, and that frame's presented texture does not contain it.

Resolution is not it either. The title is told 3840x2160 (its uiResolution), FSR upscales 1280x720 -> 1920x1080, and the window is 1920x1080. Setting VICTORY_DISPLAY_MODE=1920x1080, so the title is told 1080p and the upscale target and the window agree at 1920x1080, changes nothing: still no UI.

One hypothesis, unverified: with the upscaler on, the title may render the UI into the output texture's own path (or a 4K UI target) that the SDK dispatch writes over, so the upscale result replaces the composition including the UI. On series-x the same build with VICTORY_FFX_DIR unset shows the UI, so whatever differs is inside the FSR path.

Not a blocker for me - I went back to series-x for play - but it does mean the series-s profile cannot be used as-is, and it is the profile that is ~30 % cheaper on this card (380 - 456 ms against 448 - 542 ms, same save).

If a log line or a capture of one frame's UI pass would help, say which pass to name and I will run it.

No game data; counts and log lines only.

Port Marvisak/VIctory#1284 (bea3a58) and keep lazy host texture allocation.
@srcamarda

Copy link
Copy Markdown

Series S on AMD RDNA3, with PC FidelityFX DLLs older than v2.4.0. The upscale context is created on the host GPU and there is no device removal. With a Series X package the Series S profile stops before the world, with or without the PC upscaler, so this run never reached a dispatch.

Setup:

  • Windows 11, RX 7800 XT (Adrenalin 32.0.32029.2010), Ryzen 5 5600G, 32 GB.
  • f2ba7f5 + GPU: 16-bit float RGBA stands in for R9G9B9E5 render targets #32, release build.
  • VICTORY_FFX_DIR points at an AMD-signed pair shipped with another PC title: loader 2.3.0, upscaler 4.1.2. These are not the SDK 2.4.0 signedbin.
  • Title 1.0.2.1, Series X package (layout_…_xs.xml), run with --console series-s.

What the log shows (5-minute run):

ffx: upscale context on the host GPU render=[1280, 720] upscale=[1920, 1080] flags=41 result=0 provider="4.1.2 *"
ffx: jitter phase count r=0 q.render_width=1280 q.display_width=1920 count=Some(18)

It is not this PR. On an earlier build with the same upscaler commits, the same Series S stall happened in each of these cases:

  • without VICTORY_FFX_DIR (title's upscaler DLL refused);
  • with scripted Enter presses;
  • after the EULA and seizure notice had been accepted.

On that build, the Series X profile reaches the world (3,000–4,000 draws/frame). My guess is that the Series S profile needs the Series S package's data rather than the Series X one, but I haven't confirmed it.

So this confirms context creation and the absence of a device loss on RDNA3 with a 2.3.0 loader. It does not confirm the dispatch or the RGB9E5 pack path. #86 already has a report of those working on a 4060 Ti.

AI-assisted (Claude Code). No game data attached.

The counter reader is only called by the diagnostics-only copystat module. Match its feature guard so default Windows clippy builds pass.
@AwkGrep256

Copy link
Copy Markdown
Author

Thanks for testing this, both of you.

@rocobalt1 the missing UI on series-s is a good catch, and I don't know the cause yet. I first suspected the RGB9E5 fallback in this PR (it makes the output texture without a render target flag, so the draw guard skips it), but with #32 merged that texture is already FP16 before it gets there, so that's not it.

Heads up on where this is going: upstream main now has its own host FidelityFX path (Marvisak/VIctory@0b35b7f), so I'm moving the parts it doesn't have on top of it. That's the Series X switches (VICTORY_UPSCALER / VICTORY_FFX_SCALE) and the RGB9E5 output, which now goes through an FP16 stand-in packed straight into the title's texture. Upstream makes RGB9E5 textures differently from this fork (a real castable RGB9E5 texture instead of #32's FP16 one), so the UI bug may or may not show up there. I'll post here when that branch is up. If you get a chance to open the pause menu on series-s with it, that would help a lot.

On my side (RX 9070 XT) the upstream version picked the FSR4 provider 4.1.2 on series-x at 1080p to 4K, and context creation and the first dispatch both went through.

@srcamarda thanks, good to know context creation works on RDNA3 too.

@EgoraWyn

Copy link
Copy Markdown

Independent 6 GB VRAM --console series-s test report on #86 + #32 (with multi-plane PresentX compositing from Marvisak/VIctory#211), addressing @rocobalt1's invisible Series S UI comment, @srcamarda's DLL version note, and one #32 + #86 consistency note in ffx.rs.

Counts, source snippets, and runtime measurements only; no title code or title assets.

Setup

  • GPU / driver: NVIDIA GeForce RTX 3060 Laptop GPU (6 GB VRAM, WDDM local budget 5,226 MB, 32-lane waves), driver 596.21
  • CPU / RAM / OS: 12th Gen Intel Core i5-12450H (pinned to 8 logical CPUs via affinity mask 0xFF), 32 GB RAM, Windows 11 Pro (build 26300), native D3D12, default TDR
  • PC FidelityFX SDK (VICTORY_FFX_DIR): amd_fidelityfx_loader_dx12.dll (39,184 B, git blob f1afee09dd3bcded005c722b1e94befb3ee3f9e6, PE FileVersion 2.3.0.4555, Authenticode Valid) and amd_fidelityfx_upscaler_dx12.dll (57,664,272 B, git blob 6d01d9f52c412fc336350f04e948eb1bee196a38, PE FileVersion 4.1.2.4555, Authenticode Valid), byte-for-byte identical to GPUOpen-LibrariesAndSDKs/FidelityFX-SDK tag v2.4.0 (Kits/FidelityFX/signedbin). (Note for @srcamarda: AMD's own v2.4.0 signedbin DLLs carry those PE FileVersion numbers while reporting provider="3.1.6" on NVIDIA here.)
  • Builds & runs (diag builds with --features diagnostics, 330 s limit with forced exit after 25 s, scripted Enter inputs at 20, 40..100 s, no DRED):
    • Run A (no VICTORY_FFX_DIR, no #211): 4e17478 + #32 + #86 + low-VRAM/stability stack (#42, #45, #47, #48, #51, #63, #67) + the watchdog hook from Marvisak/VIctory#454 (open), with VICTORY_NO_WATCHDOG=1 set in all three runs. Default card buffers (card_buffers_min_mb=16 card_buffers_max_mb=512), power-of-two frame capture on (frame-1..2048).
    • Run B (#86 FFX + #211 compositing, multi-variable change): Run A tree + a local port of Marvisak/VIctory#211 (multi-plane PresentX compositing in queue.rs and host.rs, keeping slot = None when planes.len() > 1) + 7 code lines (11 diff lines incl. comments) in ffx.rs. Switched to VICTORY_FFX_DIR, VICTORY_CARD_BUFFERS=0, VICTORY_CAPTURE_WORLD=1 + capture on; host pipeline library grew 388.8 MB -> 460.4 MB (662 made).
    • Run C (#86 FFX + #211 + speed PRs, warm cache, no capture): Run B tree + #38, #49, #71, #92, #95, #108, #141. VICTORY_FFX_DIR, VICTORY_CARD_BUFFERS=0, capture off, 460.4 MB pipeline library loaded.

Results (Series S, 330 s runs)

Metric Run A (no FFX, no #211, card buf 512 MB) Run B (#86 FFX + #211, CARD_BUFFERS=0, capture on) Run C (#86 FFX + #211 + speed PRs, CARD_BUFFERS=0, no capture)
Exit / device-removal lines 330 s limit (forced exit after 25 s) / 0 330 s limit (forced exit after 25 s) / 0 330 s limit (forced exit after 25 s) / 0
Window opened (host.rs) 1920x1080 format=28 3840x2160 format=28 3840x2160 format=28
no DXIL part / falling back to NewBE 20 / 29 0 / 0 0 / 0
World entry / world windows 112 s / 38 lines (218 s) 99 s / 31 lines (229 s) 69 s / 44 lines (263 s)
World fps, median (mean) 0.70 (0.80) 0.20 (0.41) 0.50 (0.53)
World frame median (prep / gpu / cb) 1369 ms (594 / 309 / 195) 4172 ms (2381 / 500 / 793) 2024 ms (750 / 352 / 674)
Max local VRAM (gpu_mem_mib) 4801 MiB 3271 MiB 4777 MiB
Max private / min free RAM 15.18 GB / 9.17 GB 14.88 GB / 8.38 GB 15.12 GB / 9.69 GB
Visual output All black (frame-1..2048) Shell UI, startup animation, loading art, title card, lit 3D opening + overlaid credits (frame-1..2287) Capture off (clean run)

In Runs B and C, PC FidelityFX initialized cleanly on the 6 GB card:

  • ffx: upscale context on the host GPU render=[1280, 720] upscale=[1920, 1080] flags=41 result=0 provider="3.1.6"
  • ffx: jitter phase count r=0 q.render_width=1280 q.display_width=1920 count=Some(18)
  • ffx: first upscale recorded on the host GPU render=[1280, 720] upscale=[1920, 1080] result=0 ... format=10 packed=false

On @rocobalt1's Series S UI report

Because Run B changed several things alongside Run A (VICTORY_FFX_DIR, #211, ffx.rs, VICTORY_CARD_BUFFERS=0, VICTORY_CAPTURE_WORLD=1) and we did not run #86 with FFX enabled and #211 disabled, this comparison does not isolate #211 alone. Three observed facts are worth noting alongside @rocobalt1's findings:

  1. Multi-plane PresentX compositing rendered shell UI and in-world credits here: In Run B (with #211), Host::present opened the swapchain at 3840x2160 (format=28) instead of Run A's 1920x1080 (because Host::present takes the maximum dimensions across all presented planes), and the captured frames show the front-end shell UI, startup screens, loading artwork, title card, lit 3D world, and overlaid pink credits. This matches #13 (@Sil3ntGam3r's observation that Series S presents planes=2, 1920x1080 scene + 3840x2160 UI/overlay, whereas Series X presents one plane) and #188.
  2. Difference vs @rocobalt1's planes=1 observation: On @rocobalt1's setup (4e17478 + #32 + #86 + #77), logging present printed frame=1 planes=1 counts=[1] while the world was visible and pause/shell UI was missing. We did not log per-frame planes counts in our runs (beyond the 3840x2160 initial swapchain confirming planes >= 2 at first present here), so our data does not resolve why @rocobalt1 saw planes=1 at frame=1 or whether an in-world pause menu uses plane 1 on their save.
  3. In-world pause menu untested: Our scripted inputs only pressed Enter up to 100 s, so toggling and rendering the pause menu once inside the world was not tested here.

Small #32 + #86 consistency note (crates/victory-gpu/src/ffx.rs)

When #32 stands in DXGI_FORMAT_R16G16B16A16_FLOAT (10) for DXGI_FORMAT_R9G9B9E5_SHAREDEXP (67), legal_state(..., HOST_UNORDERED_ACCESS) == HOST_UNORDERED_ACCESS holds on the host texture, so ffxDispatch takes the non-packed path (packed_output = None) rather than the RGB9E5 fallback. In ffxDispatch, adding a 7-line format translation before setting r.resource = texture.as_raw() aligns FfxApiResource::description[1] with the host texture's actual DXGI format whenever r.description[1] carries FFX R9G9B9E5_SHAREDEXP (29) alongside #32's DXGI stand-in (10, replacing DXGI 67):

const FFX_R16G16B16A16_FLOAT: u32 = 4;
const FFX_R9G9B9E5_SHAREDEXP: u32 = 29;
const DXGI_R16G16B16A16_FLOAT: i32 = 10;
let host_format = unsafe { texture.GetDesc() }.Format.0;
if r.description[1] == FFX_R9G9B9E5_SHAREDEXP && host_format == DXGI_R16G16B16A16_FLOAT {
    r.description[1] = FFX_R16G16B16A16_FLOAT;
}

Note: @rocobalt1 already observed result=0 without this check, and we did not run a dedicated A/B isolating these 7 lines from Run B; we report it as a descriptor-consistency safeguard that ran cleanly here (format=10 packed=false, result=0).

AI use: Antigravity (Gemini) built the local branches, executed the game runs, and drafted this report; Claude Code (Claude Opus 5.5) verified the figures and source/DLL details against the logs and source and posted this comment.

@AwkGrep256

AwkGrep256 commented Nov 24, 2026 •

Copy link
Copy Markdown
Author

Thanks @Ege-Mert, that lines up: the UI on Series S is the second PresentX plane, so it needs Marvisak/VIctory#211 rather than anything in the FSR path. Upstream main doesn't have #211 yet either.

The upstream rework I mentioned is up now: Marvisak/VIctory#1793. It's on top of main's own FidelityFX module and covers the Series X switches and the RGB9E5 output. Your description note is handled there by design: the upscaler writes an FP16 stand-in that's described as FP16, then it gets packed into the title's RGB9E5 texture. Game test on Series X coming next.

Edit: The current Marvisak/VIctory#1793 adds the Series X switches. The FP16 stand-in was removed after testing showed main’s host upscaler writes RGB9E5 directly. FSR 4.1.2 ran at 1080p to 4K on an RX 9070 XT.

@ericomeehan

Copy link
Copy Markdown

Thanks for the clear follow-up and for pointing to the rework in Marvisak/VIctory#1793.

A heads-up for whichever version goes forward: #188 (Series S present planes) also adds an HLE ffx module (crates/victory-hle/src/modules/ffx.rs) that takes the title's ffxDispatch, as a plain stretch of the colour input when no PC upscaler is used. The two don't merge textually there, and they hook the same import with different designs. So a PC-FSR path will probably need to sit behind the same hook: FSR when VICTORY_FFX_DIR is set, the stretch otherwise.

Written with an AI assistant (Claude).

@sagouindupm

Copy link
Copy Markdown

For anyone testing Series S with this PR and missing the menus and HUD (@rocobalt1, @Ege-Mert): #188 draws the present's second plane on this fork, and the two PRs conflict in one file (crates/victory-hle/src/modules/ffx.rs, both add it). I resolved that on a branch so they can be tested together:

sagouindupm/victory-fork, branch series-s-all = main (2119b0e) + #32 + #188 + this PR (merge of f2ba7f5) + 7e6e578 of Marvisak/VIctory#1704 (DLSS) + #51.

How the two fit: with VICTORY_FFX_DIR (or VICTORY_DLSS_DIR) set, this PR's module serves both FidelityFX DLLs as it does now; without either, #188's stand-in (a plain stretch of the colour input) answers the dispatch. The stand-in is bound only when the PC upscaler is off.

On an RTX 3050 8 GB, Windows 11, release build, --console series-s, SDK 2.4 signedbin:

  • ffx: upscale context on the host GPU render=[1280, 720] upscale=[1920, 1080] flags=41 result=0 provider="3.1.6", then first upscale recorded ... result=0 ... format=10 packed=false.
  • Menus, loading and the interface are visible (second plane), the world renders, no device removal in a 5-minute run.
  • Median frame time in the world 569 ms with FSR against 588 ms with the plain stretch on the same build (one run each), so the upscaler is not what the frame costs here. By eye FSR removes the grain and shimmer the stretch leaves.
  • cargo test --release -p victory-gpu -p victory-hle on the branch: 122 passed, 0 failed, 1 ignored; 97 passed, 0 failed.

Not tested: AMD cards, Series X with the picker override, runs longer than 5 minutes.

AI-assisted: Claude Code (Claude Fable 5.2) made the merge and the runs and wrote this comment.

JohnTWillemsen added a commit to JohnTWillemsen/victory-fork that referenced this pull request Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants