gpu, hle: AMD frame generation on the host-upscaled frames (VICTORY_FIDELITYFX_FRAMEGEN) #68

Closed
github-bot wants to merge 1 commit from github-bot/gh-68 into main AGit
Owner

@⁠coil111 on GitHub · 2026-12-01 13:44 UTC · original
coil111:fidelityfx-framegen → main · +1198 −13 · 9 files · 1 commits · closed without merging

Off by default. With VICTORY_FSR_4K and VICTORY_FIDELITYFX_FRAMEGEN=1, the presenter's swap chain is AMD's frame generation proxy, and every frame the title renders gets a generated one in between. In play it makes the game much smoother.

Important

For the best result this wants #63 plus the small FSR addition proposed there (already commited by pr author) (comment), with VICTORY_UI_PLANE=3840x2160. That puts the HUD on a plane of its own, which this composes over every frame. Without it the PR works on its own, but the HUD is interpolated with the scene and shakes against the world.

How

  • DLL. amd_fidelityfx_framegeneration_dx12.dll from the FidelityFX SDK v2.4.0 signedbin, the same release ./setup.sh fsr4 already pins for the upscaler; fsr4 now fetches it too (sha256 pinned). Its built-in 3.x provider is selected by version, so no driver ML path is needed.
  • Inputs. The title asks for no frame generation. Each host upscale (the HLE FidelityFX module, record_dispatch) passes its depth, motion vectors and constants (jitter, motion-vector scale, frame time, reset, camera) to the next present through Recording::frame_generation_inputs. The present prepares the generator in its own list.
  • Lifetimes. The depth and motion host copies are held with that present's list until it has run (the presenter's ahead slots carry them), and a generator is only replaced (new size or flags) after the presents that name it have settled. HostList::move_copy is split out of transition for this: it moves a held host copy without its title resource.
  • Fallback. Without the switch, without the DLL, for a non-RGBA8 swap chain, or if the SDK refuses the proxy, the plain swap chain is made exactly as before.

Interface and F3 panel

Interpolated together with the scene, the HUD shakes against the world (it moves with the scene's motion vectors in every generated frame), and the F3 panel is interpolated too.

When the title presents its interface on a plane of its own, this keeps both out of the interpolation: the scene alone goes to the swap chain; the interface plane is copied each frame into a texture of ours (in a fixed state, so whatever state the title left its plane in does not matter), the F3 panel is drawn into it, and the plane is registered with the proxy (premultiplied alpha, like compose; double buffered, since the title redraws its plane while the proxy still composes it). The proxy then composes it over every real and generated frame. The panel stays above the HUD, as it is without frame generation.

With one plane (current main at VICTORY_FSR_4K), the interface stays in the scene and is interpolated with it. #63 gives the title its separate plane; with the small addition proposed there (the plane on the FSR 4K path too), the HUD and panel stay still.

The panel badge shows FG:OFF / FG:IDLE / FG:ON in place of the fixed FG:OFF.

Tested

RX 9070 XT, Ryzen 7 9800X3D, Gentoo Linux 7.3.4, Wine 11.22, Series X, VICTORY_FSR_4K=performance (1920x1080 render to 3840x2160):

  • log: proxy swap chain provider="3.1.7", generator for the upscaled frames provider="3.1.6", generated frames;
  • much smoother in play than the same run without the switch;
  • with #63 + the FSR plane addition (VICTORY_UI_PLANE=3840x2160): the interface plane is composed over every frame; HUD and panel steady, panel above the healthbar;
  • without the switch: no change in behaviour.
  • cargo clippy clean in the touched files; framegen unit tests pass under Wine (2: no DLL keeps it off; the built-in 3.x providers are picked).

Known artifacts

At the base frame rates this runs at today (about 18–30 fps at 4K performance, lower while driving), the analytical generator shows its usual weak spots:

  • Behind a followed vehicle, the road the car uncovers each frame exists in only one of the two frames being blended, so that strip repeats or smears, like a trail behind the car.
  • Screen edges while turning the camera: the strip coming into view is filled from one frame and looks like a dark, blurry corner.
  • Smoke, exhaust and other see-through effects carry no motion vectors and ghost.

AMD's debug view (dispatch flag FFX_FRAMEGENERATION_FLAG_DRAW_DEBUG_VIEW) shows the inputs are right: the vehicle has no motion on screen, the road expands from the centre, and depth matches the scene. Only the uncovered areas are flagged, and the artifacts are there. A frame-pairing check over a driving session found every upscale's inputs reaching its own present. The artifacts shrink as the base frame rate rises; ML frame generation (see below) is the better fix for them.

Not covered

  • ML frame generation (FSR "Redstone", generator 4.0.2 through the driver's provider) is left for a follow-up PR. It shares this PR's plumbing (same DLL, proxy swap chain, present path) but differs where it matters:

    • It needs the camera's world pose, which the title never gives FidelityFX. The only source found so far is the constant buffer of the title's velocity pass, recognised by its shader pair and read at a fixed root slot and layout: specific to one title build, unlike the inputs here, which come from any FidelityFX upscale.
    • It isn't verified under Wine yet. It is reported working on Linux through Proton-EM (10.0-33+) and Proton-CachyOS (MLFG_UPGRADE), with the same amdxcffx64.dll 4.1.1 and amdxc64.dll bridge that ./setup.sh fsr4 installs, but the driver reportedly offers it only when the prefix reports Windows 11 (this repo's prefix reports Windows 10 today).
    • Hardware: RDNA4 natively (FP8); RDNA3 only through FP8 emulation, reportedly at some cost. The analytical generator here runs on any card vkd3d-proton supports.

    The plan is a separate PR on top of this one: the camera-pose read, the driver-provider path behind VICTORY_FIDELITYFX_FRAMEGEN=4, and a Windows 11 prefix. Mode 1 stays as it is.

  • RGBA8 swap chains only (what Series X and the two-plane path present).

  • The interface plane must match the output size; otherwise it is composed into the scene as before (logged once).

**@⁠coil111** on GitHub · 2026-12-01 13:44 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/68) `coil111:fidelityfx-framegen` → `main` · +1198 −13 · 9 files · 1 commits · closed without merging Off by default. With `VICTORY_FSR_4K` and `VICTORY_FIDELITYFX_FRAMEGEN=1`, the presenter's swap chain is AMD's frame generation proxy, and every frame the title renders gets a generated one in between. In play it makes the game much smoother. > [!IMPORTANT] > **For the best result this wants #63** plus the small FSR addition proposed there (already commited by pr author) ([comment](https://git.gtahub.st/github/lobomfz--VIctory-xmem/pulls/63)), with `VICTORY_UI_PLANE=3840x2160`. That puts the HUD on a plane of its own, which this composes over every frame. Without it the PR works on its own, but the HUD is interpolated with the scene and shakes against the world. ## How - **DLL.** `amd_fidelityfx_framegeneration_dx12.dll` from the FidelityFX SDK v2.4.0 `signedbin`, the same release `./setup.sh fsr4` already pins for the upscaler; `fsr4` now fetches it too (sha256 pinned). Its built-in 3.x provider is selected by version, so no driver ML path is needed. - **Inputs.** The title asks for no frame generation. Each host upscale (the HLE FidelityFX module, `record_dispatch`) passes its depth, motion vectors and constants (jitter, motion-vector scale, frame time, reset, camera) to the next present through `Recording::frame_generation_inputs`. The present prepares the generator in its own list. - **Lifetimes.** The depth and motion host copies are held with that present's list until it has run (the presenter's `ahead` slots carry them), and a generator is only replaced (new size or flags) after the presents that name it have settled. `HostList::move_copy` is split out of `transition` for this: it moves a held host copy without its title resource. - **Fallback.** Without the switch, without the DLL, for a non-RGBA8 swap chain, or if the SDK refuses the proxy, the plain swap chain is made exactly as before. ## Interface and F3 panel Interpolated together with the scene, the HUD shakes against the world (it moves with the scene's motion vectors in every generated frame), and the F3 panel is interpolated too. When the title presents its interface on a plane of its own, this keeps both out of the interpolation: the scene alone goes to the swap chain; the interface plane is copied each frame into a texture of ours (in a fixed state, so whatever state the title left its plane in does not matter), the F3 panel is drawn into it, and the plane is registered with the proxy (premultiplied alpha, like `compose`; double buffered, since the title redraws its plane while the proxy still composes it). The proxy then composes it over every real and generated frame. The panel stays above the HUD, as it is without frame generation. With one plane (current `main` at `VICTORY_FSR_4K`), the interface stays in the scene and is interpolated with it. #63 gives the title its separate plane; with the small addition proposed there (the plane on the FSR 4K path too), the HUD and panel stay still. The panel badge shows `FG:OFF` / `FG:IDLE` / `FG:ON` in place of the fixed `FG:OFF`. ## Tested RX 9070 XT, Ryzen 7 9800X3D, Gentoo Linux 7.3.4, Wine 11.22, Series X, `VICTORY_FSR_4K=performance` (1920x1080 render to 3840x2160): - log: `proxy swap chain provider="3.1.7"`, `generator for the upscaled frames provider="3.1.6"`, `generated frames`; - much smoother in play than the same run without the switch; - with #63 + the FSR plane addition (`VICTORY_UI_PLANE=3840x2160`): `the interface plane is composed over every frame`; HUD and panel steady, panel above the healthbar; - without the switch: no change in behaviour. - `cargo clippy` clean in the touched files; `framegen` unit tests pass under Wine (2: no DLL keeps it off; the built-in 3.x providers are picked). ## Known artifacts At the base frame rates this runs at today (about 18–30 fps at 4K performance, lower while driving), the analytical generator shows its usual weak spots: - **Behind a followed vehicle**, the road the car uncovers each frame exists in only one of the two frames being blended, so that strip repeats or smears, like a trail behind the car. - **Screen edges while turning the camera**: the strip coming into view is filled from one frame and looks like a dark, blurry corner. - **Smoke, exhaust and other see-through effects** carry no motion vectors and ghost. AMD's debug view (dispatch flag `FFX_FRAMEGENERATION_FLAG_DRAW_DEBUG_VIEW`) shows the inputs are right: the vehicle has no motion on screen, the road expands from the centre, and depth matches the scene. Only the uncovered areas are flagged, and the artifacts are there. A frame-pairing check over a driving session found every upscale's inputs reaching its own present. The artifacts shrink as the base frame rate rises; ML frame generation (see below) is the better fix for them. ## Not covered - **ML frame generation (FSR "Redstone", generator 4.0.2 through the driver's provider) is left for a follow-up PR.** It shares this PR's plumbing (same DLL, proxy swap chain, present path) but differs where it matters: - **It needs the camera's world pose**, which the title never gives FidelityFX. The only source found so far is the constant buffer of the title's velocity pass, recognised by its shader pair and read at a fixed root slot and layout: specific to one title build, unlike the inputs here, which come from any FidelityFX upscale. - **It isn't verified under Wine yet.** It is reported working on Linux through Proton-EM (10.0-33+) and Proton-CachyOS (`MLFG_UPGRADE`), with the same `amdxcffx64.dll` 4.1.1 and `amdxc64.dll` bridge that `./setup.sh fsr4` installs, but the driver reportedly offers it only when the prefix reports Windows 11 (this repo's prefix reports Windows 10 today). - **Hardware:** RDNA4 natively (FP8); RDNA3 only through FP8 emulation, reportedly at some cost. The analytical generator here runs on any card vkd3d-proton supports. The plan is a separate PR on top of this one: the camera-pose read, the driver-provider path behind `VICTORY_FIDELITYFX_FRAMEGEN=4`, and a Windows 11 prefix. Mode `1` stays as it is. - RGBA8 swap chains only (what Series X and the two-plane path present). - The interface plane must match the output size; otherwise it is composed into the scene as before (logged once).
With VICTORY_FSR_4K and VICTORY_FIDELITYFX_FRAMEGEN=1 the presenter's swap
chain is AMD's frame generation proxy (amd_fidelityfx_framegeneration_dx12.dll
from the FidelityFX SDK v2.4.0, its built-in 3.x provider; ./setup.sh fsr4
fetches it). The title asks for no frame generation: each host upscale hands
its depth, motion vectors and constants to the next present
(Recording::frame_generation_inputs), which prepares the generator in its own
list. The depth and motion copies are held with that list until it has run,
and a generator is only replaced after the presents that name it have
settled. Without the switch, or when the proxy is refused, the plain swap
chain is made as before.

When the title presents its interface on a plane of its own, the plane is
copied each frame into a texture of ours, the F3 panel is drawn into it, and
the proxy composes it over every real and generated frame (premultiplied,
double buffered). Interpolated with the scene, the HUD shook against the
world and the healthbar covered the panel. With one plane the interface stays
in the scene and is interpolated with it.

The panel's badge shows FG:OFF / FG:IDLE / FG:ON instead of the fixed FG:OFF.

RX 9070 XT, Ryzen 7 9800X3D, Gentoo, Wine 11.22, Series X, FSR 4
performance to 3840x2160 (1920x1080 render): proxy 3.1.7, generator 3.1.6;
frame pacing visibly smooth; with the interface plane (VICTORY_UI_PLANE, #63)
the HUD and panel stay still and the panel sits over the HUD.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:46:51 +00:00
Author
Owner

@⁠Mylloon on GitHub · 2026-12-01 23:58 UTC · original

Heads up, resolve conflicts please!

**@⁠Mylloon** on GitHub · 2026-12-01 23:58 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/68#issuecomment-7329981570) Heads up, resolve conflicts please!
github-bot closed this pull request 2026-12-02 07:14:57 +00:00
Author
Owner

@⁠coil111 on GitHub · 2026-12-02 07:13 UTC · original

upd:
merged via train b76f277 / #83
closing. ml gen soon.

**@⁠coil111** on GitHub · 2026-12-02 07:13 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/68#issuecomment-7337931145) upd: merged via train b76f277 / #83 closing. ml gen soon.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.