Skip to content

Add experimental AMD frame generation test path - #1287

Closed
AwkGrep256 wants to merge 18 commits into
Marvisak:mainfrom
AwkGrep256:pc-fsr-framegen-test
Closed

AwkGrep256 wants to merge 18 commits into
Marvisak:mainfrom
AwkGrep256:pc-fsr-framegen-test

Conversation

@AwkGrep256

Copy link
Copy Markdown

I got AMD frame generation to run in-game on an RX 9070 XT with Proton Experimental. I tested both Series S and Series X. Both used FSR 4.1.1 for upscaling and 3.1.6 for frame generation.

Once the game sent depth and motion data, three rendered frames produced three extra frames. The swapchain counted six presents in each run. The intro stayed at 30 rendered FPS. The world was still mostly black, and Series X hit a GPU reset after about 114 seconds.

This branch includes the PC FSR path and Series S presentation changes. Native Windows testing is still in progress.

To test on Windows, build with diagnostics, set VICTORY_FFX_DIR to AMD’s FidelityFX SDK Kits\FidelityFX\signedbin directory, set VICTORY_FFX_FRAMEGEN=1, and launch with --console series-s. Look for ffx framegen: generated game frames after world loading.

Related discussion: #944

For Series X, the README includes the additional upscaler and scale settings used in testing.

LaunchDoesntCode and others added 18 commits November 23, 2026 19:16
The clamp was HLSL compiled at run time by the system's D3DCompile. Wine's
d3dcompiler_47 rejects it (no Load on RWByteAddressBuffer, no store to a
structured buffer, and the RootSignature attribute is ignored), so under
Wine and Proton clamp() failed and every indirect execution was dropped.

The same shader is now emitted as DXIL by the shader crate
(emit::clamp::argument_clamp) and its root signature is made from a
description, so no shader compiler is needed on any host. For that the
shader builder learns root UAVs (raw buffers), beside root CBVs and SRVs.

Two GPU tests run the clamp over records of each kind and compare with
the bounds written out in Rust, and check that records past the list's
budget run empty.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ld 1.0.2.1)

The title ends the process on purpose when its main thread has not advanced
for about 30 one-second ticks (a write to address 0 at +0x23cf683, with a
second one at +0x2215c35 right after the handler call). On a host much slower
than the console a long load can exceed that window.

With VICTORY_NO_WATCHDOG=1 the loader jumps over the abort site and makes the
handler's fault a NOP. Each patch is applied only if the original BLAKE3
starts with the 1.0.2.1 identity and the exact original bytes are at the
offset; otherwise it logs a warning and does nothing. Off by default.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A root SRV is a bare GPU address: nothing bounds what a shader reads
through it. Vertex fetch reads its stream through a root SRV with no
record limit, and a mesh shader read past the end of the buffer's host
copy into memory the host had already freed (the "inside freed texture"
device removal after the fix for Marvisak#59: the fault lay just past the copy's
end, in the gap where released textures had been).

Each root SRV is now a one-descriptor table holding a raw view of the
host copy from the root address to the copy's end, made once per address
per list in the heap's dynamic slots; reads past the end return zero, as
for any bounded view. A root SRV the title did not set, or one with no
host copy, gets a null raw view (an unset table is undefined). Addresses
not on 16 bytes, which a raw view cannot start at, read zeros and are
logged once. VICTORY_ROOT_SRV_DIRECT=1 restores root descriptors.
A diagnostics switch for 32-lane hosts: VICTORY_SKIP_WAVE64=mesh,compute
drops draws and dispatches whose pipeline has a program of a listed stage
written for 64-lane waves, so testers can tell whether those programs
cause a GPU hang without listing shader hashes one by one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(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).
Use the AMD DX12 proxy swapchain when diagnostics opt in. Feed it the depth and motion vectors from the latest submitted title upscale, and log generated frames alongside completed presentation counts. Report the actual upscaler provider and send the PC SDK version description.
…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.
Record the diagnostics build, console profiles, and the presentation counts Windows and Linux testers can compare.
@marquezinii

Copy link
Copy Markdown
Contributor

Native Windows on NVIDIA, without the title. RTX 5070 (Blackwell), driver 621.40, Windows 11 26300, head 7566b6d. AMD's signed DLLs from SDK v2.4.0 Kits/FidelityFX/signedbin. The upscaler side is in my note on #1284: the tests pass and the RGB9E5 fallback is the NVIDIA path.

  • cargo test -p victory-gpu --features diagnostics --locked: 54 passed, 1 ignored.
  • Versions on this card: upscalers 3.1.6 and 2.3.4, frame generation 3.1.6; no FSR 4. With a throwaway test (not pushed), this branch's ffxCreateContext asks for upscaler 4.1.2 and gets provider 3.1.6 with result=0, for Series X and Series S sizes. Calling the loader directly with the 4.1.2 version description and without it gives the same. So the fixed SDK_UPSCALER_VERSION is harmless on NVIDIA, and retry_legacy is not reached.
  • Frame generation swapchain: framegen::Presentation::create with VICTORY_FFX_FRAMEGEN=1, on a hidden 1920x1080 window with the host's queue (RGBA8, 2 buffers, flip discard), returns the proxy swapchain. It asks for swapchain version 4.0 while the card only has 3.1.6.

Not checked: generated frames with real depth and motion vectors, and anything in game; I have no copy of the title.

AwkGrep256 added a commit to AwkGrep256/VIctory that referenced this pull request Nov 25, 2026
The title asks for no frame generation, and main's host FidelityFX module
refuses it. A diagnostics switch now generates frames on the host from
the title's upscale, as Marvisak#1287 did on its own FidelityFX path:

- With VICTORY_FIDELITYFX_FRAMEGEN=1 beside VICTORY_FIDELITYFX_DIR,
  amd_fidelityfx_framegeneration_dx12.dll is loaded from the same folder
  and the presenter's swap chain becomes its proxy (RGBA8 only).
- At each host upscale, the HLE module hands the upscale's depth, motion
  vectors and constants to victory_gpu::external::frame_generation_inputs;
  they feed the next present once the list has run (HostList::defer_after,
  so no change to submission or reset).
- Before each present the generator is configured and given those inputs
  in the presenter's copy list; the proxy inserts the generated frames
  during Present.

It uses the provider that works from depth and motion vectors (FSR 3
frame generation): frame generation 4 wants view matrices the upscale
does not carry. No HUD-less colour is given, so the UI is interpolated
with the scene.
@AwkGrep256

Copy link
Copy Markdown
Author

Superseded by #1917, which adds the opt-in frame-generation path to the current host FidelityFX module. The new PR includes the Windows verification results.

@AwkGrep256 AwkGrep256 closed this Nov 25, 2026
AwkGrep256 added a commit to AwkGrep256/VIctory that referenced this pull request Nov 25, 2026
The title asks for no frame generation, and main's host FidelityFX module
refuses it. A diagnostics switch now generates frames on the host from
the title's upscale, as Marvisak#1287 did on its own FidelityFX path:

- With VICTORY_FIDELITYFX_FRAMEGEN=1 beside VICTORY_FIDELITYFX_DIR,
  amd_fidelityfx_framegeneration_dx12.dll is loaded from the same folder
  and the presenter's swap chain becomes its proxy (RGBA8 only).
- At each host upscale, the HLE module hands the upscale's depth, motion
  vectors and constants to victory_gpu::external::frame_generation_inputs;
  they feed the next present once the list has run (HostList::defer_after,
  so no change to submission or reset).
- Before each present the generator is configured and given those inputs
  in the presenter's copy list; the proxy inserts the generated frames
  during Present.

It uses the provider that works from depth and motion vectors (FSR 3
frame generation): frame generation 4 wants view matrices the upscale
does not carry. No HUD-less colour is given, so the UI is interpolated
with the scene.
@AwkGrep256

Copy link
Copy Markdown
Author

Reworked onto main's fidelityfx module in #1917, with only the frame generation change (this branch also carried other people's commits).

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.

8 participants