Add experimental PC FSR upscaling #86
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!86
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-86"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@AwkGrep256 on GitHub · 2026-11-24 21:22 UTC · original
AwkGrep256:pc-fsr→main· +1429 −19 · 13 files · 4 commits · openPorts Marvisak/VIctory#1284 to this fork, rebased on
c96b4f2. It lets the title call AMD’s PC FidelityFX upscaler on the host D3D12 device. SetVICTORY_FFX_DIRtoKits/FidelityFX/signedbinfrom 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+ #32 + this PR confirmed a real SDK dispatch and a visible Series S world. On that setup, #32 was required to reach the first frame. Test report@rocobalt1 on GitHub · 2026-11-24 21:32 UTC · original
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 (merge7f700a6),cargo build --profile diag -p victory --features diagnostics.VICTORY_FFX_DIRpoints atsignedbinfrom FidelityFX-SDK v2.4.0 (amd_fidelityfx_loader_dx12.dll38 KB,amd_fidelityfx_upscaler_dx12.dll55 MB, both PE). FreshVICTORY_DATA_DIR,VICTORY_NO_WATCHDOG=1,VICTORY_SHADER_LOOP_LIMIT=32,VICTORY_D3D12_DRED=1, noVICTORY_DISPLAY_MODE,--console series-s.TdrDelay=60/TdrDdiDelay=60are set machine-wide here, so the times below are upper bounds.The context and the dispatch:
What that changes on this profile: before this PR,
--console series-snever showed the world. The title asked forFFX_FSR4_PASS_0..26/RCAS/SPD_AUTOEXPOSURE(29DeserializeComputePipelineStateXfailures,hr=0x80004001) and one millisecond later 20 compute pipelines were refused withconverter shader.dxil v1: malformed shader: no DXIL part, every one of whose hashes is absent fromshaders.rpf,packs.rpfandcore_bvh4.rpf(VICTORY_TRANSLATE_ONLYselects 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 partcount is 0, 15 shader refusals in the whole run (the ordinary pack ones:PS_PuddleDetect6, three water programs,PS_DeferredTextured3,CS_ShadowRenderTiledCascadesAlphaCBPPPC1), 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:
series-sloses the device ~90 s in, before the first frame, on format 67.No game data; counts, hashes and program names only.
@adriaespii on GitHub · 2026-11-24 21:44 UTC · original
Independent test run on commit
f2ba7f5(AMD RDNA4):x86_64-pc-windows-msvc)cargo clippy --workspace --all-targets -- -D warnings: 0 warningscargo test --workspace: 497 passed, 0 failed, 7 ignored (victory-gpu: 111 passed, 0 failed, 1 ignored;victory-shader: 210 passed, 0 failed, 2 ignored)AI use: Antigravity (Gemini 4 Neon) ran clippy/tests locally and wrote this report.
@rocobalt1 on GitHub · 2026-11-24 22:17 UTC · original
A regression this PR introduces on the
series-sprofile, which the description's validation list does not cover: the title's UI is invisible with the upscaler on, while the same build onseries-xshows it.Same machine: RTX 4060 Ti 8 GB, driver 32.0.16.1656, Windows 11; build
4e17478+ #32 + #86 + #77,VICTORY_FFX_DIRset,VICTORY_SHADER_LOOP_LIMIT=256,VICTORY_NO_WATCHDOG=1, freshVICTORY_DATA_DIR,TdrDelay=60machine-wide.series-xseries-s(this PR active)render=[1280,720] upscale=[1920,1080] result=0So 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
presentcounting planes, logged when the count changes:The same single plane, one resource, on both profiles. So the UI is not being composited into a plane that
presentignores - 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(itsuiResolution), FSR upscales1280x720 -> 1920x1080, and the window is 1920x1080. SettingVICTORY_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-xthe same build withVICTORY_FFX_DIRunset shows the UI, so whatever differs is inside the FSR path.Not a blocker for me - I went back to
series-xfor play - but it does mean theseries-sprofile 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.
@srcamarda on GitHub · 2026-11-24 22:26 UTC · original
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:
f2ba7f5+ #32, release build.VICTORY_FFX_DIRpoints 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.0signedbin.layout_…_xs.xml), run with--console series-s.What the log shows (5-minute run):
ERRORlines. Before #32, this profile lost the device here (#13).ffx: first upscale recorded: the title never gets to a dispatch.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:
VICTORY_FFX_DIR(title's upscaler DLL refused);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.
@AwkGrep256 on GitHub · 2026-11-24 22:38 UTC · original
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 on GitHub · 2026-11-24 22:44 UTC · original
Independent 6 GB VRAM
--console series-stest report on#86+#32(with multi-planePresentXcompositing fromMarvisak/VIctory#211), addressing@rocobalt1's invisible Series S UI comment,@srcamarda's DLL version note, and one#32+#86consistency note inffx.rs.Counts, source snippets, and runtime measurements only; no title code or title assets.
Setup
5,226 MB, 32-lane waves), driver596.210xFF), 32 GB RAM, Windows 11 Pro (build26300), native D3D12, default TDRVICTORY_FFX_DIR):amd_fidelityfx_loader_dx12.dll(39,184 B, git blobf1afee09dd3bcded005c722b1e94befb3ee3f9e6, PEFileVersion 2.3.0.4555, AuthenticodeValid) andamd_fidelityfx_upscaler_dx12.dll(57,664,272 B, git blob6d01d9f52c412fc336350f04e948eb1bee196a38, PEFileVersion 4.1.2.4555, AuthenticodeValid), byte-for-byte identical toGPUOpen-LibrariesAndSDKs/FidelityFX-SDKtagv2.4.0(Kits/FidelityFX/signedbin). (Note for@srcamarda: AMD's own v2.4.0signedbinDLLs carry those PEFileVersionnumbers while reportingprovider="3.1.6"on NVIDIA here.)diagbuilds with--features diagnostics, 330 s limit with forced exit after 25 s, scriptedEnterinputs at20, 40..100 s, no DRED):VICTORY_FFX_DIR, no#211):4e17478+#32+#86+ low-VRAM/stability stack (#42,#45,#47,#48,#51,#63,#67) + the watchdog hook fromMarvisak/VIctory#454(open), withVICTORY_NO_WATCHDOG=1set 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).#86FFX +#211compositing, multi-variable change): Run A tree + a local port ofMarvisak/VIctory#211(multi-planePresentXcompositing inqueue.rsandhost.rs, keepingslot = Nonewhenplanes.len() > 1) + 7 code lines (11 diff lines incl. comments) inffx.rs. Switched toVICTORY_FFX_DIR,VICTORY_CARD_BUFFERS=0,VICTORY_CAPTURE_WORLD=1+ capture on; host pipeline library grew388.8 MB -> 460.4 MB(662made).#86FFX +#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 MBpipeline library loaded.Results (Series S, 330 s runs)
#211, card buf512 MB)#86FFX +#211,CARD_BUFFERS=0, capture on)#86FFX +#211+ speed PRs,CARD_BUFFERS=0, no capture)000host.rs)1920x1080format=283840x2160format=283840x2160format=28no DXIL part/falling back to NewBE20/290/00/0112 s/38lines (218 s)99 s/31lines (229 s)69 s/44lines (263 s)0.70(0.80)0.20(0.41)0.50(0.53)prep/gpu/cb)1369 ms(594/309/195)4172 ms(2381/500/793)2024 ms(750/352/674)gpu_mem_mib)4801 MiB3271 MiB4777 MiB15.18 GB/9.17 GB14.88 GB/8.38 GB15.12 GB/9.69 GBframe-1..2048)frame-1..2287)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=falseOn
@rocobalt1's Series S UI reportBecause 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#86with FFX enabled and#211disabled, this comparison does not isolate#211alone. Three observed facts are worth noting alongside@rocobalt1's findings:PresentXcompositing rendered shell UI and in-world credits here: In Run B (with#211),Host::presentopened the swapchain at3840x2160(format=28) instead of Run A's1920x1080(becauseHost::presenttakes 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 presentsplanes=2,1920x1080scene +3840x2160UI/overlay, whereas Series X presents one plane) and#188.@rocobalt1'splanes=1observation: On@rocobalt1's setup (4e17478+#32+#86+#77), loggingpresentprintedframe=1 planes=1 counts=[1]while the world was visible and pause/shell UI was missing. We did not log per-frameplanescounts in our runs (beyond the3840x2160initial swapchain confirmingplanes >= 2at first present here), so our data does not resolve why@rocobalt1sawplanes=1atframe=1or whether an in-world pause menu uses plane 1 on their save.Enterup to100 s, so toggling and rendering the pause menu once inside the world was not tested here.Small
#32+#86consistency note (crates/victory-gpu/src/ffx.rs)When
#32stands inDXGI_FORMAT_R16G16B16A16_FLOAT(10) forDXGI_FORMAT_R9G9B9E5_SHAREDEXP(67),legal_state(..., HOST_UNORDERED_ACCESS) == HOST_UNORDERED_ACCESSholds on the host texture, soffxDispatchtakes the non-packed path (packed_output = None) rather than the RGB9E5 fallback. InffxDispatch, adding a 7-line format translation before settingr.resource = texture.as_raw()alignsFfxApiResource::description[1]with the host texture's actual DXGI format wheneverr.description[1]carries FFXR9G9B9E5_SHAREDEXP(29) alongside#32's DXGI stand-in (10, replacing DXGI67):Note:
@rocobalt1already observedresult=0without 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.
@ericomeehan on GitHub · 2026-11-25 00:22 UTC · original
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
ffxmodule (crates/victory-hle/src/modules/ffx.rs) that takes the title'sffxDispatch, 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 whenVICTORY_FFX_DIRis set, the stretch otherwise.Written with an AI assistant (Claude).
@sagouindupm on GitHub · 2026-11-25 00:46 UTC · original
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, branchseries-s-all=main(2119b0e) + #32 + #188 + this PR (merge off2ba7f5) +7e6e578of Marvisak/VIctory#1704 (DLSS) + #51.How the two fit: with
VICTORY_FFX_DIR(orVICTORY_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.4signedbin:ffx: upscale context on the host GPU render=[1280, 720] upscale=[1920, 1080] flags=41 result=0 provider="3.1.6", thenfirst upscale recorded ... result=0 ... format=10 packed=false.cargo test --release -p victory-gpu -p victory-hleon 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.
@AwkGrep256 on GitHub · 2026-11-24 22:49 UTC · original · edited 2026-11-25 00:56 UTC
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.
@HenriqueSBueno on GitHub · 2026-11-26 12:24 UTC · original
Notes from porting this PR onto an AMD-fork base (avatarmanz/MEHDImp4) and running Series S on an RTX 3080 — in case it is merged into a tree with those changes:
resource::target_format), so the upscaler's output is writable and the packed RGB9E5 path is not taken. The SDK resource still carried the title's description (RGB9E5), and the upscaled picture was black from the first frame. Describing a host RGBA16F texture asFFX_RGBA16_FLOATin the dispatch fixes it.VICTORY_THIN=1). A title list has no host list at the call there, soffxDispatchreturnedERROR_PARAMETERon every frame. Writing the dispatch down among the list's calls (a deferred call the translating thread makes on its own list) fixes it.E_INVALIDARG, debug layer id 528). Fix offered in avatarmanz/VIctory-7900XTX#237.Series S, boat save, 9 minutes: picture shows, median frame 80.9 ms with
VICTORY_THIN=0and 77.1 ms with thin lists after (2). The upscale context reported 1280×720 → 1920×1080 with the 3.1.6 provider.AI-assisted (Claude Code)
@AwkGrep256 on GitHub · 2026-11-26 13:18 UTC · original
@HenriqueSBueno Thanks for porting this and running it on the 3080. Glad to hear actual SDK FSR worked on that base. Could you share the branch or diff for the RGBA16F format fix and the deferred dispatch? I’d like to check which changes also apply to this fork, especially with
VICTORY_THIN=1. The debug-layer error you shared for the pool barrier helps narrow that one down too.@AwkGrep256 on GitHub · 2026-11-26 14:55 UTC · original
@HenriqueSBueno I pushed the host texture format fix to #86. It now uses the SDK's FP16 descriptor when the actual D3D12 texture is FP16. The regression passed, and I merged current main to clear the texture allocation conflict. I didn't find the thin-list or pooled aliasing paths you described in this base, so I kept those changes out of this PR. If you have the thin-list diff handy, it'd be useful for other ports.
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.Merge
Merge the changes and update on Forgejo.