Repository navigation
Add experimental PC FSR upscaling - #1284
AwkGrep256 wants to merge 4 commits into
Conversation
…(D3D12) 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).
…R path 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.
Series S: BTP 6 runs AMD's FidelityFX upscaler (FSR4), whose console compute programs XTP cannot translate (20 refused, "no DXIL part"); with its DLLs refused the title divides by zero at title+0x28f03e8. xtp-hle `ffx` stands in for amd_fidelityfx_loader_xbox.dll and amd_fidelityfx_upscaler_xbox.dll unless XTP_FSR4=1. From the title's own calls (title+0x28ef2cc, +0x28ef30f, +0x28ef625, +0x28f03db, +0x28f0651): - create (upscale 0x10000 + console backend + version chain): a context; - query 0x10004: the jitter phase count, 8 x (display / render)^2, 18 for 720p -> 1080p (the divisor at title+0x28f03e8); - query 0x10005: AMD's Halton (2, 3) jitter offsets, written into the title's uninitialised locals; - query 0x10008: the upscaler's GPU memory, 0 (the title adds it to a memory total, again from uninitialised locals); - dispatch 0x10001: xtp_gpu::list::upscale, a bilinear compute pass of XTP's own from the colour input to the output, the jitter taken back as FidelityFX places its samples, clamped to the rendered region. No AMD code runs. xtp-gpu list slots 0x1a8/0x1b0, ClearUnorderedAccessViewUint/Float. The two handles are console descriptor slots holding XTP's view records; the host gets its own descriptors of the same view: a dynamic slot of XTP's view heap (bound for the clear) and a CPU-only slot. Texture views move to unordered access, buffer views write their host copy, copied back to title memory after the submission. Float clears of raw and structured buffer views are refused, as the host would (#948's review). Outside the task's files, granted by the orchestrator: - draw.rs: State::forget_host, so the title's pipeline, root signature and heaps go back on the host list after the upscale or a clear; - descriptor/host.rs: make_view (a view into a CPU-only heap) and make_at says whether it made the view. Mechanical: modules/mod.rs, the `ffx` module line and its registration. Tests: phase count, Halton offsets, the three queries and the create chain as the title lays them out, a dispatch description read at the title's offsets; on WARP, the upscale (bilinear, jitter, regions) and UAV clears of a texture and a buffer through console handles. Ported from Marvisak/VIctory#1284 (head f96ad82) by AwkGrep256: the module standing in for both DLLs, its exports, the description layouts, unknown types logged once. Not taken: its passing on to AMD's PC loader, the picker and scale patches (Series X diagnostics). UAV clears after Marvisak/VIctory#948 (head 35802af) by Sakura-Byte, reimplemented on XTP's descriptors; the handle translation is the idea of xcl-dev/xcl#1291 (GPL-2.0-only, no code taken). Co-authored-by: AwkGrep256 <AwkGrep256@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Native Windows on NVIDIA, without the title. RTX 5070 (Blackwell), driver 621.40, Windows 11 26300, head
Not checked: a dispatch with real inputs, and anything in game; I have no copy of the title. |
|
@AwkGrep256 thanks for the note. #1704 and #1715 are now rebuilt on |
|
Automated triage for the maintainers. Closing because this change is already in 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. |
|
What was missed: the Series X part. On Series X the title's upscaler picker returns its own upscaler, so |
The host FidelityFX path (VICTORY_FIDELITYFX_DIR) only runs when the title picks FidelityFX, which it does on Series S. Two diagnostics switches make Series X use it too: - VICTORY_UPSCALER=<rva>[,<kind>] makes the title's upscaler picker return kind (default 7, FidelityFX). In 1.0.2.1 the picker is at 7E93F0, reached by 4 direct calls; it returns 6 (the title's own upscaler) outside Series S. - VICTORY_FFX_SCALE=<scale>[,<rva>] sets the render scale of that path. Its method (1.0.2.1: 28EF680) takes 2/3 on Series S and 1.0 on Series X, so Series X with FidelityFX renders at native 4K and overflows its memory plan. 0.5 renders 1080p, 0.6667 1440p. Both check the code first and leave other builds alone: the picker must have direct calls, the scale method its two vmovss loads and its int3 padding where the constant goes. They live in title_patch.rs with shared helpers; VirtualProtect failures are reported instead of ignored. Reworked from Marvisak#1284 onto main's fidelityfx module.
The host FidelityFX path (VICTORY_FIDELITYFX_DIR) only runs when the title picks FidelityFX, which it does on Series S. Two diagnostics switches make Series X use it too: - VICTORY_UPSCALER=<rva>[,<kind>] makes the title's upscaler picker return kind (default 7, FidelityFX). In 1.0.2.1 the picker is at 7E93F0, reached by 4 direct calls; it returns 6 (the title's own upscaler) outside Series S. - VICTORY_FFX_SCALE=<scale>[,<rva>] sets the render scale of that path. Its method (1.0.2.1: 28EF680) takes 2/3 on Series S and 1.0 on Series X, so Series X with FidelityFX renders at native 4K and overflows its memory plan. 0.5 renders 1080p, 0.6667 1440p. Both check the code first and leave other builds alone: the picker must have direct calls, the scale method its two vmovss loads and its int3 padding where the constant goes. They live in title_patch.rs with shared helpers; VirtualProtect failures are reported instead of ignored. Reworked from Marvisak#1284 onto main's fidelityfx module.
The host FidelityFX path (VICTORY_FIDELITYFX_DIR) only runs when the title picks FidelityFX, which it does on Series S. Two diagnostics switches make Series X use it too: - VICTORY_UPSCALER=<rva>[,<kind>] makes the title's upscaler picker return kind (default 7, FidelityFX). In 1.0.2.1 the picker is at 7E93F0, reached by 4 direct calls; it returns 6 (the title's own upscaler) outside Series S. - VICTORY_FFX_SCALE=<scale>[,<rva>] sets the render scale of that path. Its method (1.0.2.1: 28EF680) takes 2/3 on Series S and 1.0 on Series X, so Series X with FidelityFX renders at native 4K and overflows its memory plan. 0.5 renders 1080p, 0.6667 1440p. Both check the code first and leave other builds alone: the picker must have direct calls, the scale method its two vmovss loads and its int3 padding where the constant goes. They live in title_patch.rs with shared helpers; VirtualProtect failures are reported instead of ignored. Reworked from Marvisak#1284 onto main's fidelityfx module.
Port Marvisak/VIctory#1284 (bea3a58) and keep lazy host texture allocation.
The host FidelityFX path (VICTORY_FIDELITYFX_DIR) only runs when the title picks FidelityFX, which it does on Series S. Two diagnostics switches make Series X use it too: - VICTORY_UPSCALER=<kind> makes the title's upscaler picker return kind (7, FidelityFX); on Series X it picks the title's own upscaler. - VICTORY_FFX_SCALE=<scale> sets the render scale of that path, 1.0 on Series X, which with FidelityFX forced on is more than the title's memory plan allows. 0.5 renders 1080p for a 4K output. No title address is kept: each finds its code by a byte pattern, call and RIP-relative offsets left open, that must match exactly once in the title's executable sections; a build where it does not is left alone. In Grand Theft Auto VI 1.0.2.1 each matches once. The write itself is LoadedImage::write_code in victory-loader (diagnostics builds only), an unsafe fn for code that has not run yet. It writes only inside one region VirtualQuery reports as committed, executable image pages with one protection, so the protection put back is right for every page; then it restores the protection and flushes the instruction cache, and reports a failure of either after writing as an error. No Cargo.toml or Cargo.lock change: the loader already has the Win32 features. In the app: - The patches run first in the diagnostics setup, before the stack dump, audio capture, watch and poke threads start, and before the title's TLS callbacks and entry point. - With both switches set, both are found before either is written and the scale goes first: the picker alone would render at full size. An error after writing, or only the scale taking, stops the launch. Reworked from Marvisak#1284 onto main's fidelityfx module.
Port Marvisak/VIctory#1284 (bea3a58) and keep lazy host texture allocation.
Port Marvisak/VIctory#1284 (bea3a58) and keep lazy host texture allocation. (cherry picked from commit f2ba7f512fe7bf07a3ae9e68e1bb91909c772441) Onto feat/render, merged as 12cfac7a did with the Series S stand-in dispatch: with VICTORY_FFX_DIR set the HLE module serves both FidelityFX DLLs; without it the plain stretch is bound as before. Left out: the RGB9E5 output packing (ffx/rgb9e5.rs, the resource.rs fallback and the render-target guards in draw.rs and list.rs that went with it). Here an R9G9B9E5 target's host copy is 16-bit float RGBA with unordered access (resource::target_format), so the upscaler writes the output directly. README conflict: ours kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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. 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:
Settings: 1080p output, Series S, material cap 512, sparse mips off. On temporal, both the context and first successful dispatch reported 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 |
|
@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 |
|
@AwkGrep256 Thanks! Here’s the exact The RGB9E5 → FP16 allocation was already in the fork. The change on the SDK side is in On the 3060 Ti under Proton, the synthetic test requested RGB9E5, got host format |
|
@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. |
Adds AMD’s PC FidelityFX upscaler to VIctory’s D3D12 path. Set
VICTORY_FFX_DIRto the SDK 2.4Kits\FidelityFX\signedbindirectory to enable it. Series S selects FSR by default. For Series X title 1.0.2.1, use a diagnostics build withVICTORY_UPSCALER=7E93F0andVICTORY_FFX_SCALE=0.5for 1080p → 4K.PC FSR progress
format=67,packed=false).bea3a58and needs an in-game retest on that setup. Original report · Retest requestNext 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.