framegen: ML frame generation from the driver (opt-in, VICTORY_FIDELITYFX_FRAMEGEN=4) #376

Manually merged
github merged 72 commits from github-bot/gh-376 into main 2026-12-04 20:05:12 +00:00 AGit
Owner

@⁠coil111 on GitHub · 2026-12-03 21:09 UTC · original
coil111:fidelityfx-framegen-ml → main · +584 −55 · 11 files · 4 commits · merged 2026-12-04 20:01 UTC

Builds on the direct path from #253. VICTORY_FIDELITYFX_FRAMEGEN=4 uses AMD's ML frame generation (FSR Frame Generation 4.x) from the driver's amdxcffx64.dll, the same file ./setup.sh fsr4 already installs for FSR 4, instead of the analytical 3.1.6 generator. The visible difference is in disoccluded areas: at our low base frame rates, 3.1.6 leaves a smeared trail behind the driven car and dark, blurry screen edges when the camera turns. With ML the trail is gone. Mode 1 is unchanged, and the proxy stays the default for mode 1.

How it works

  • Direct path only. Mode 4 always takes the #253 path (plain swap chain, generator dispatched into the present's list, real frame slotted into the next frame), whatever VICTORY_FIDELITYFX_FRAMEGEN_DIRECT says. The driver's own 4.0.0 swap chain is never used: it relies on driver-assisted frame pacing in the Windows display driver, and like the 3.1.7 proxy it would put a second DIRECT queue on RADV's single graphics queue.
  • Provider. The SDK lists the driver's providers when it is queried with the real device. Here that gives generator 4.0.2 and 3.1.6, plus swap chain 3.1.7. The generator is created with a version override to the 4.x id and ffxCreateContextDescFrameGenerationVersion chained on. The provider that actually gets bound is read back and checked.
  • No swap chain. The 4.x generator accepts FFX_FRAMEGENERATION_FLAG_NO_SWAPCHAIN_CONTEXT_NOTIFY, the same as 3.1.6. AMD's docs don't mention it for ML, so this was the open question. It works.
  • Camera. ML refuses to run without the camera position and up/right/forward vectors in PrepareV2. The title doesn't pass them to FSR, so framegen/camera.rs takes them from its fullscreen velocity pass. That pass is identified by its two shader hashes. Its 480-byte constant buffer holds the view rotation and its inverse, the camera position and the projection jitter. The buffer is read at submission through defer_host_read, validated (orthonormal axes and fixed projection words), and matched to the upscale by viewport == render size and projection offset ≈ FSR jitter. A frame without exactly one match isn't generated at all, so Configure → PrepareV2 → Dispatch always run together, as AMD's ML docs require. Near, far and fov come from the title's FSR dispatch. Its viewSpaceToMetersFactor of 0 is passed as 1.0, which is how the SDK reads it anyway.
  • Fallback. If ML can't be used, mode 4 logs one warning with the reason and continues as mode 1 on the direct path with the built-in 3.1.6. That happens when the device offers no 4.x generator, when a different provider gets bound, when creating the context fails, or when a new context's first configure is refused. The HUD shows FG:ML only while ML is live and FG:DIRECT otherwise.
  • Windows 11. The driver only offers ML frame generation when the prefix reports Windows 11. ./setup.sh win11 sets that once, as an opt-in step (it does nothing if the prefix already reports a build ≥ 22000). The no-4.x warning points to it.
  • Logs. In mode 4 each provider is logged once at startup. stats: fg_direct gains pose / no_pose counters. After 60 upscales without a camera match, a warning says so: the shader pair was checked on one build of the title.

Numbers

RX 9070 XT, Ryzen 7 9800X3D, Wine 11.22, Mesa 26.3.1, 1440p display, 3840x2160 output from 1920x1080 render, the same route each run. GPU time of the generator dispatch (GPU timestamps, median): 3.1.6 0.95 ms, ML 4.0.2 1.45 ms, so ML costs about 0.5 ms more per real frame. Real fps with FG on, medians of 1 s windows: ML 19.7 (p10–p90 14.5–24.4) vs 3.1.6 21.5 (18.3–28.3). These were single short runs with RT on, so treat the gap as noisy; the GPU time difference alone would predict ~1%. Camera matching held for 3440 of 3441 generated frames, and the generated frame count equalled the real frame count.

AMD lists ~410 MB of memory for ML FG at 4K (360 MB aliasable), so on cards that are already short on VRAM it may show up as more texture streaming fallback.

Requirements and caveats

  • RDNA 4 (native FP8). RDNA 3 might work through vkd3d-proton's FP8 emulation like FSR 4 does, but I haven't tested it.
  • ./setup.sh fsr4 and ./setup.sh win11. The amdxc64.dll shim must carry the MLFG patch (it calls UpdateFfxApiProviderEx on amdxcffx64; without it the driver only lists 3.1.6). ./setup.sh fsr4 now prefers such a shim from an installed GE-Proton 11, Proton-EM 10.0-33+ or proton-cachyos (or PROTON=), and warns if it only finds the older one, such as Proton Experimental's.
  • The velocity-pass shader hashes and constant-buffer layout were verified on one build of the title. If they don't match, the warning above fires and frames stay real. Nothing falls back silently in that case.
  • Known gap: on the direct path, four failure exits in present_direct (texture or buffer allocation failing, composer draw failing) can leave a PrepareV2 without its Dispatch for that frame. The next frame resets.

Testing

./setup.sh win11
VICTORY_FIDELITYFX_FRAMEGEN=4

VICTORY_FIDELITYFX_FRAMEGEN_DIRECT isn't needed: mode 4 always uses the direct path.

The log should show generator for the upscaled frames provider="4.0.2" and (direct): on, without the proxy swap chain ... ml=true, and the HUD should show FG:ML. If you see the "4.x unavailable" warning, check ./setup.sh fsr4's output for the shim warning first, then post it along with your GPU and Mesa versions.

**@⁠coil111** on GitHub · 2026-12-03 21:09 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376) `coil111:fidelityfx-framegen-ml` → `main` · +584 −55 · 11 files · 4 commits · merged 2026-12-04 20:01 UTC Builds on the direct path from #253. `VICTORY_FIDELITYFX_FRAMEGEN=4` uses AMD's ML frame generation (FSR Frame Generation 4.x) from the driver's `amdxcffx64.dll`, the same file `./setup.sh fsr4` already installs for FSR 4, instead of the analytical 3.1.6 generator. The visible difference is in disoccluded areas: at our low base frame rates, 3.1.6 leaves a smeared trail behind the driven car and dark, blurry screen edges when the camera turns. With ML the trail is gone. Mode 1 is unchanged, and the proxy stays the default for mode 1. ## How it works - **Direct path only.** Mode 4 always takes the #253 path (plain swap chain, generator dispatched into the present's list, real frame slotted into the next frame), whatever `VICTORY_FIDELITYFX_FRAMEGEN_DIRECT` says. The driver's own 4.0.0 swap chain is never used: it relies on driver-assisted frame pacing in the Windows display driver, and like the 3.1.7 proxy it would put a second DIRECT queue on RADV's single graphics queue. - **Provider.** The SDK lists the driver's providers when it is queried with the real device. Here that gives generator `4.0.2` and `3.1.6`, plus swap chain `3.1.7`. The generator is created with a version override to the 4.x id and `ffxCreateContextDescFrameGenerationVersion` chained on. The provider that actually gets bound is read back and checked. - **No swap chain.** The 4.x generator accepts `FFX_FRAMEGENERATION_FLAG_NO_SWAPCHAIN_CONTEXT_NOTIFY`, the same as 3.1.6. AMD's docs don't mention it for ML, so this was the open question. It works. - **Camera.** ML refuses to run without the camera position and up/right/forward vectors in `PrepareV2`. The title doesn't pass them to FSR, so `framegen/camera.rs` takes them from its fullscreen velocity pass. That pass is identified by its two shader hashes. Its 480-byte constant buffer holds the view rotation and its inverse, the camera position and the projection jitter. The buffer is read at submission through `defer_host_read`, validated (orthonormal axes and fixed projection words), and matched to the upscale by viewport == render size and projection offset ≈ FSR jitter. A frame without exactly one match isn't generated at all, so Configure → PrepareV2 → Dispatch always run together, as AMD's ML docs require. Near, far and fov come from the title's FSR dispatch. Its `viewSpaceToMetersFactor` of 0 is passed as 1.0, which is how the SDK reads it anyway. - **Fallback.** If ML can't be used, mode 4 logs one warning with the reason and continues as mode 1 on the direct path with the built-in 3.1.6. That happens when the device offers no 4.x generator, when a different provider gets bound, when creating the context fails, or when a new context's first configure is refused. The HUD shows `FG:ML` only while ML is live and `FG:DIRECT` otherwise. - **Windows 11.** The driver only offers ML frame generation when the prefix reports Windows 11. `./setup.sh win11` sets that once, as an opt-in step (it does nothing if the prefix already reports a build ≥ 22000). The no-4.x warning points to it. - **Logs.** In mode 4 each provider is logged once at startup. `stats: fg_direct` gains `pose` / `no_pose` counters. After 60 upscales without a camera match, a warning says so: the shader pair was checked on one build of the title. ## Numbers RX 9070 XT, Ryzen 7 9800X3D, Wine 11.22, Mesa 26.3.1, 1440p display, 3840x2160 output from 1920x1080 render, the same route each run. GPU time of the generator dispatch (GPU timestamps, median): 3.1.6 0.95 ms, ML 4.0.2 1.45 ms, so ML costs about 0.5 ms more per real frame. Real fps with FG on, medians of 1 s windows: ML 19.7 (p10–p90 14.5–24.4) vs 3.1.6 21.5 (18.3–28.3). These were single short runs with RT on, so treat the gap as noisy; the GPU time difference alone would predict ~1%. Camera matching held for 3440 of 3441 generated frames, and the generated frame count equalled the real frame count. AMD lists ~410 MB of memory for ML FG at 4K (360 MB aliasable), so on cards that are already short on VRAM it may show up as more texture streaming fallback. ## Requirements and caveats - RDNA 4 (native FP8). RDNA 3 might work through vkd3d-proton's FP8 emulation like FSR 4 does, but I haven't tested it. - `./setup.sh fsr4` and `./setup.sh win11`. The `amdxc64.dll` shim must carry the MLFG patch (it calls `UpdateFfxApiProviderEx` on amdxcffx64; without it the driver only lists 3.1.6). `./setup.sh fsr4` now prefers such a shim from an installed GE-Proton 11, Proton-EM 10.0-33+ or proton-cachyos (or `PROTON=`), and warns if it only finds the older one, such as Proton Experimental's. - The velocity-pass shader hashes and constant-buffer layout were verified on one build of the title. If they don't match, the warning above fires and frames stay real. Nothing falls back silently in that case. - Known gap: on the direct path, four failure exits in `present_direct` (texture or buffer allocation failing, composer draw failing) can leave a PrepareV2 without its Dispatch for that frame. The next frame resets. ## Testing ``` ./setup.sh win11 VICTORY_FIDELITYFX_FRAMEGEN=4 ``` `VICTORY_FIDELITYFX_FRAMEGEN_DIRECT` isn't needed: mode 4 always uses the direct path. The log should show `generator for the upscaled frames provider="4.0.2"` and `(direct): on, without the proxy swap chain ... ml=true`, and the HUD should show `FG:ML`. If you see the "4.x unavailable" warning, check `./setup.sh fsr4`'s output for the shim warning first, then post it along with your GPU and Mesa versions.
Mode 4 runs AMD's driver ML frame generation (4.x, from amdxcffx64) on the
direct path (no proxy swap chain), with the world camera decoded from the
title's velocity pass for PrepareV2. Falls back to the built-in 3.x
generator on the direct path when ML is unavailable. ./setup.sh win11 makes
the prefix report Windows 11, which the driver provider requires.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 21:10:46 +00:00
Author
Owner

@⁠joaowtrdev on GitHub · 2026-12-03 23:23 UTC · original

Tried b83a373 here, and mode 4 falls back to 3.1.6 because the device offers no 4.x generator, even after ./setup.sh win11.

Ryzen 7 5700X3D, RX 9070 XT, CachyOS, system Wine 11.22 (USE_SYSTEM_WINE=1, /usr/bin/wine), the repo's patched Mesa and vkd3d-proton. 4K output, FSR 4 Performance (1920x1080 render). Merged on current main together with #354, #364 and #382. Run with VICTORY_FIDELITYFX_FRAMEGEN=4 LSFGVK_PROFILE= (lsfg-vk off).

What I checked:

  • ./setup.sh win11 printed setting the prefix to Windows 11. The prefix's system.reg then has CurrentBuild / CurrentBuildNumber 22000, CurrentMajorVersionNumber 10 and ProductName Microsoft Windows 11. There is only one prefix, and the game runs in it.
  • amdxcffx64.dll is the one ./setup.sh fsr4 fetches (the v4.1.1 file, FileVersion 2.3.0.2913), and the copy in the prefix's system32 is identical to the one in deps/fsr4/system32.

The log at startup:

FidelityFX frame generation provider effect="generator" on="device" id=0xf600000000c01006 version="3.1.6"
FidelityFX frame generation provider effect="swap chain" on="device" id=0xf65cdd1200c01007 version="3.1.7"
FidelityFX frame generation (ML): the driver's 4.x generator is unavailable; the built-in 3.x generator on the direct path instead why="the device offers none; the prefix must report Windows 11 (./setup.sh win11)"
FidelityFX frame generation (direct): on, without the proxy swap chain; ... ml=false

So the device lists 3.1.6 and 3.1.7 only, where your description has 4.0.2 as well. The fallback itself works: the HUD shows FG:DIRECT and frames are generated as with mode 1.

Is there anything else the driver checks besides the version? For example a build newer than 22000, or something your Wine reports and system Wine 11.22 does not. I'm glad to try another build number, run with a log switch, or test a newer commit.

**@⁠joaowtrdev** on GitHub · 2026-12-03 23:23 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376#issuecomment-7395479991) Tried `b83a373` here, and mode 4 falls back to 3.1.6 because the device offers no 4.x generator, even after `./setup.sh win11`. Ryzen 7 5700X3D, RX 9070 XT, CachyOS, system Wine 11.22 (`USE_SYSTEM_WINE=1`, `/usr/bin/wine`), the repo's patched Mesa and vkd3d-proton. 4K output, FSR 4 Performance (1920x1080 render). Merged on current `main` together with #354, #364 and #382. Run with `VICTORY_FIDELITYFX_FRAMEGEN=4 LSFGVK_PROFILE=` (lsfg-vk off). What I checked: - `./setup.sh win11` printed `setting the prefix to Windows 11`. The prefix's `system.reg` then has `CurrentBuild` / `CurrentBuildNumber` `22000`, `CurrentMajorVersionNumber` 10 and `ProductName` `Microsoft Windows 11`. There is only one prefix, and the game runs in it. - `amdxcffx64.dll` is the one `./setup.sh fsr4` fetches (the `v4.1.1` file, FileVersion `2.3.0.2913`), and the copy in the prefix's `system32` is identical to the one in `deps/fsr4/system32`. The log at startup: ``` FidelityFX frame generation provider effect="generator" on="device" id=0xf600000000c01006 version="3.1.6" FidelityFX frame generation provider effect="swap chain" on="device" id=0xf65cdd1200c01007 version="3.1.7" FidelityFX frame generation (ML): the driver's 4.x generator is unavailable; the built-in 3.x generator on the direct path instead why="the device offers none; the prefix must report Windows 11 (./setup.sh win11)" FidelityFX frame generation (direct): on, without the proxy swap chain; ... ml=false ``` So the device lists `3.1.6` and `3.1.7` only, where your description has `4.0.2` as well. The fallback itself works: the HUD shows `FG:DIRECT` and frames are generated as with mode 1. Is there anything else the driver checks besides the version? For example a build newer than 22000, or something your Wine reports and system Wine 11.22 does not. I'm glad to try another build number, run with a log switch, or test a newer commit.
Author
Owner

@⁠coil111 on GitHub · 2026-12-03 23:33 UTC · original

Tried b83a373 here, and mode 4 falls back to 3.1.6 because the device offers no 4.x generator, even after ./setup.sh win11.

Ryzen 7 5700X3D, RX 9070 XT, CachyOS, system Wine 11.22 (USE_SYSTEM_WINE=1, /usr/bin/wine), the repo's patched Mesa and vkd3d-proton. 4K output, FSR 4 Performance (1920x1080 render). Merged on current main together with #354, #364 and #382. Run with VICTORY_FIDELITYFX_FRAMEGEN=4 LSFGVK_PROFILE= (lsfg-vk off).

What I checked:

* `./setup.sh win11` printed `setting the prefix to Windows 11`. The prefix's `system.reg` then has `CurrentBuild` / `CurrentBuildNumber` `22000`, `CurrentMajorVersionNumber` 10 and `ProductName` `Microsoft Windows 11`. There is only one prefix, and the game runs in it.

* `amdxcffx64.dll` is the one `./setup.sh fsr4` fetches (the `v4.1.1` file, FileVersion `2.3.0.2913`), and the copy in the prefix's `system32` is identical to the one in `deps/fsr4/system32`.

The log at startup:

FidelityFX frame generation provider effect="generator" on="device" id=0xf600000000c01006 version="3.1.6"
FidelityFX frame generation provider effect="swap chain" on="device" id=0xf65cdd1200c01007 version="3.1.7"
FidelityFX frame generation (ML): the driver's 4.x generator is unavailable; the built-in 3.x generator on the direct path instead why="the device offers none; the prefix must report Windows 11 (./setup.sh win11)"
FidelityFX frame generation (direct): on, without the proxy swap chain; ... ml=false

So the device lists 3.1.6 and 3.1.7 only, where your description has 4.0.2 as well. The fallback itself works: the HUD shows FG:DIRECT and frames are generated as with mode 1.

Is there anything else the driver checks besides the version? For example a build newer than 22000, or something your Wine reports and system Wine 11.22 does not. I'm glad to try another build number, run with a log switch, or test a newer commit.

Thanks, that's very useful. I think the difference is amdxc64.dll, not the Windows version. My runs apparently used GE-Proton11-9's shim (144028 bytes, exports AmdExtD3DDevice8_CheckExtFeatureSupport), which ended up in my prefix by accident. The one ./setup.sh fsr4 installs is an older stub that only handles the FSR4 upscaler. Could you post sha256sum and size of /drive_c/windows/system32/amdxc64.dll? If it's the small stub, please try copying files/lib/wine/x86_64-windows/amdxc64.dll from GE-Proton 11-x into the prefix's system32 and run again. I'll fix setup.sh to pick the newer shim.

**@⁠coil111** on GitHub · 2026-12-03 23:33 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376#issuecomment-7395711994) > Tried `b83a373` here, and mode 4 falls back to 3.1.6 because the device offers no 4.x generator, even after `./setup.sh win11`. > > Ryzen 7 5700X3D, RX 9070 XT, CachyOS, system Wine 11.22 (`USE_SYSTEM_WINE=1`, `/usr/bin/wine`), the repo's patched Mesa and vkd3d-proton. 4K output, FSR 4 Performance (1920x1080 render). Merged on current `main` together with #354, #364 and #382. Run with `VICTORY_FIDELITYFX_FRAMEGEN=4 LSFGVK_PROFILE=` (lsfg-vk off). > > What I checked: > > * `./setup.sh win11` printed `setting the prefix to Windows 11`. The prefix's `system.reg` then has `CurrentBuild` / `CurrentBuildNumber` `22000`, `CurrentMajorVersionNumber` 10 and `ProductName` `Microsoft Windows 11`. There is only one prefix, and the game runs in it. > > * `amdxcffx64.dll` is the one `./setup.sh fsr4` fetches (the `v4.1.1` file, FileVersion `2.3.0.2913`), and the copy in the prefix's `system32` is identical to the one in `deps/fsr4/system32`. > > > The log at startup: > > ``` > FidelityFX frame generation provider effect="generator" on="device" id=0xf600000000c01006 version="3.1.6" > FidelityFX frame generation provider effect="swap chain" on="device" id=0xf65cdd1200c01007 version="3.1.7" > FidelityFX frame generation (ML): the driver's 4.x generator is unavailable; the built-in 3.x generator on the direct path instead why="the device offers none; the prefix must report Windows 11 (./setup.sh win11)" > FidelityFX frame generation (direct): on, without the proxy swap chain; ... ml=false > ``` > > So the device lists `3.1.6` and `3.1.7` only, where your description has `4.0.2` as well. The fallback itself works: the HUD shows `FG:DIRECT` and frames are generated as with mode 1. > > Is there anything else the driver checks besides the version? For example a build newer than 22000, or something your Wine reports and system Wine 11.22 does not. I'm glad to try another build number, run with a log switch, or test a newer commit. Thanks, that's very useful. I think the difference is amdxc64.dll, not the Windows version. My runs apparently used GE-Proton11-9's shim (144028 bytes, exports AmdExtD3DDevice8_CheckExtFeatureSupport), which ended up in my prefix by accident. The one ./setup.sh fsr4 installs is an older stub that only handles the FSR4 upscaler. Could you post sha256sum and size of <prefix>/drive_c/windows/system32/amdxc64.dll? If it's the small stub, please try copying files/lib/wine/x86_64-windows/amdxc64.dll from GE-Proton 11-x into the prefix's system32 and run again. I'll fix setup.sh to pick the newer shim.
Author
Owner

@⁠coil111 on GitHub · 2026-12-03 23:55 UTC · original

ML frame generation needs a shim with the MLFG patch and ours is not that.
./setup.sh fsr4 now also searches compatibilitytools.d (newest first) and prefers a shim that has UpdateFfxApiProviderEx. It prints which file it took and warns if only the old stub is found. PROTON=/path/to/proton still overrides the search. The fallback warning and the docs now name this requirement.
It's kind of a shitty handling but since we are opt-in and its still in experimental i guess we can live with this.

Basically this means you need to have GE-Proton 11, Proton-EM 10.0-33+ or proton-cachyos installed

**@⁠coil111** on GitHub · 2026-12-03 23:55 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376#issuecomment-7396160429) ML frame generation needs a shim with the MLFG patch and ours is not that. ./setup.sh fsr4 now also searches compatibilitytools.d (newest first) and prefers a shim that has UpdateFfxApiProviderEx. It prints which file it took and warns if only the old stub is found. PROTON=/path/to/proton still overrides the search. The fallback warning and the docs now name this requirement. It's kind of a shitty handling but since we are opt-in and its still in experimental i guess we can live with this. Basically this means you need to have GE-Proton 11, Proton-EM 10.0-33+ or proton-cachyos installed
Author
Owner

@⁠joaowtrdev on GitHub · 2026-12-04 00:04 UTC · original

That was it, thanks. The shim I had was Proton Experimental's: 120286 bytes, sha256 ef82c8f92abfbb0ab5826723842715b0c7562a52501b3e95e8081cdc56e2fe62, without AmdExtD3DDevice8_CheckExtFeatureSupport.

With 8fbbc45, ./setup.sh fsr4 picked the shim from CachyOS's proton-cachyos-slr package (/usr/share/steam/compatibilitytools.d/proton-cachyos-slr, 145228 bytes, has UpdateFfxApiProviderEx) with no PROTON= needed. Then mode 4 works:

FidelityFX frame generation provider effect="generator" on="device" id=0xf600000001000002 version="4.0.2"
FidelityFX frame generation: generator for the upscaled frames provider="4.0.2" ...
FidelityFX frame generation (direct): on, ... ml=true

The HUD showed FG:ML the whole run. Over 358 s of stats: fg_direct: 21.6 real and 21.6 generated per second, pose 7947 and no_pose 1, fg_interp_ms 1.63.

Same machine as before (RX 9070 XT, 4K output, FSR 4 Performance, RT on), against my usual lsfg-vk 2x on the same build and route:

driving lsfg-vk 2x mode 4 (ML)
real fps, median 21.8 20.8
real frames ≥ 100 ms (long frame), per min 78.7 38.3

The trail behind the driven car is gone, the screen edges stay clean when the camera turns, and the HUD is fine. I'm not sure why the long frames halved, so take that as one run. It felt much smoother here, and I've switched to mode 4 for daily play.

**@⁠joaowtrdev** on GitHub · 2026-12-04 00:04 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376#issuecomment-7396343016) That was it, thanks. The shim I had was Proton Experimental's: 120286 bytes, sha256 `ef82c8f92abfbb0ab5826723842715b0c7562a52501b3e95e8081cdc56e2fe62`, without `AmdExtD3DDevice8_CheckExtFeatureSupport`. With `8fbbc45`, `./setup.sh fsr4` picked the shim from CachyOS's `proton-cachyos-slr` package (`/usr/share/steam/compatibilitytools.d/proton-cachyos-slr`, 145228 bytes, has `UpdateFfxApiProviderEx`) with no `PROTON=` needed. Then mode 4 works: ``` FidelityFX frame generation provider effect="generator" on="device" id=0xf600000001000002 version="4.0.2" FidelityFX frame generation: generator for the upscaled frames provider="4.0.2" ... FidelityFX frame generation (direct): on, ... ml=true ``` The HUD showed `FG:ML` the whole run. Over 358 s of `stats: fg_direct`: 21.6 real and 21.6 generated per second, `pose` 7947 and `no_pose` 1, `fg_interp_ms` 1.63. Same machine as before (RX 9070 XT, 4K output, FSR 4 Performance, RT on), against my usual lsfg-vk 2x on the same build and route: | driving | lsfg-vk 2x | mode 4 (ML) | |---|---|---| | real fps, median | 21.8 | 20.8 | | real frames ≥ 100 ms (`long frame`), per min | 78.7 | 38.3 | The trail behind the driven car is gone, the screen edges stay clean when the camera turns, and the HUD is fine. I'm not sure why the long frames halved, so take that as one run. It felt much smoother here, and I've switched to mode 4 for daily play.
Author
Owner

@⁠joaowtrdev on GitHub · 2026-12-04 00:37 UTC · original

A follow-up on the long frames: a second mode 4 run on the same route gave 52.8 per minute of long frame ≥ 100 ms, against 39 to 79 in my four lsfg-vk runs on this build. So the halving in my first run was mostly route noise, not mode 4. Real fps was 21.6, in line with the lsfg-vk runs, and ML stayed on for the whole run (393 s, 21.5 real and 21.5 generated per second, no_pose 1). The image gain holds, and I'm staying on mode 4.

**@⁠joaowtrdev** on GitHub · 2026-12-04 00:37 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376#issuecomment-7396989678) A follow-up on the long frames: a second mode 4 run on the same route gave 52.8 per minute of `long frame` ≥ 100 ms, against 39 to 79 in my four lsfg-vk runs on this build. So the halving in my first run was mostly route noise, not mode 4. Real fps was 21.6, in line with the lsfg-vk runs, and ML stayed on for the whole run (393 s, 21.5 real and 21.5 generated per second, `no_pose` 1). The image gain holds, and I'm staying on mode 4.
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-12-04 00:56 UTC · original

wonderful idea!

**@⁠maple-quartz18** on GitHub · 2026-12-04 00:56 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376#issuecomment-7397309760) wonderful idea!
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-12-04 01:00 UTC · original

Additional information: I inspected the fsr4.1.2-igpu-cyboman-rdna3-2026-11-22 DLL variants. Their binaries contain these version strings:
HLX FSR 4 (4.1.2)
4.1.2-exact-igpu-r3-cyboman
4.1.2-lossy-igpu-r3-cyboman
4.1.2l-exact-igpu-r3-cyboman
4.1.2l-lossy-igpu-r3-cyboman

**@⁠maple-quartz18** on GitHub · 2026-12-04 01:00 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376#issuecomment-7397379945) Additional information: I inspected the fsr4.1.2-igpu-cyboman-rdna3-2026-11-22 DLL variants. Their binaries contain these version strings: HLX FSR 4 (4.1.2) 4.1.2-exact-igpu-r3-cyboman 4.1.2-lossy-igpu-r3-cyboman 4.1.2l-exact-igpu-r3-cyboman 4.1.2l-lossy-igpu-r3-cyboman
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 12:03 UTC · original

This is the only PR in this batch that adds a capability rather than saving microseconds, and the direct path already shipped — so it deserves the review time. Five things before it lands.

  1. Split the setup.sh half out. setup.sh:230-237 runs winecfg -v win11, which changes what the whole prefix reports as Windows, for one opt-in frame-generation mode. Nothing documents how to undo it and docs/BUILD.md:49 says only "run once". As its own commit it can be reverted without taking ML with it, and the revert belongs in BUILD.md.
  2. The camera pairing is welded to one title build: draw.rs:5377 (has("4adcfeaa24ae6450") && has("9ab96b7a002d6ac8")), draw.rs:5383 (table.checked_add(8 * 4)) and framegen/camera.rs:22 BUFFER_SIZE = 480. Your own warning says so (framegen.rs:1063). That is acceptable for an opt-in mode, but the failure is silent — it degrades to real frames only.
  3. And the HUD then still advertises ML: hud_tag() returns "FG:ML" on ml_active() && armed (framegen.rs:404) while the present path bails out to real frames whenever input.pose is None (framegen.rs:1075-1080). Gate the tag on recent pose hits, or make the miss visible.
  4. No measurement of the feature itself: no fps, no GPU cost, no artefact note, only POSE/NO_POSE counters. For something needing RDNA 4 + a Win11 prefix + a patched Proton shim, one real run's numbers in the commit message (the way #382 does it) is what a reader cannot reconstruct.
  5. The ml_camera() unit test is good — keep that shape for whatever else gets added.
**@⁠Luxuride** on GitHub · 2026-12-04 12:03 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376#issuecomment-7410924985) This is the only PR in this batch that adds a capability rather than saving microseconds, and the direct path already shipped — so it deserves the review time. Five things before it lands. 1. Split the `setup.sh` half out. `setup.sh:230-237` runs `winecfg -v win11`, which changes what the *whole prefix* reports as Windows, for one opt-in frame-generation mode. Nothing documents how to undo it and `docs/BUILD.md:49` says only "run once". As its own commit it can be reverted without taking ML with it, and the revert belongs in BUILD.md. 2. The camera pairing is welded to one title build: `draw.rs:5377` (`has("4adcfeaa24ae6450") && has("9ab96b7a002d6ac8")`), `draw.rs:5383` (`table.checked_add(8 * 4)`) and `framegen/camera.rs:22 BUFFER_SIZE = 480`. Your own warning says so (`framegen.rs:1063`). That is acceptable for an opt-in mode, but the failure is silent — it degrades to real frames only. 3. And the HUD then still advertises ML: `hud_tag()` returns `"FG:ML"` on `ml_active() && armed` (`framegen.rs:404`) while the present path bails out to real frames whenever `input.pose` is `None` (`framegen.rs:1075-1080`). Gate the tag on recent pose hits, or make the miss visible. 4. No measurement of the feature itself: no fps, no GPU cost, no artefact note, only `POSE`/`NO_POSE` counters. For something needing RDNA 4 + a Win11 prefix + a patched Proton shim, one real run's numbers in the commit message (the way #382 does it) is what a reader cannot reconstruct. 5. The `ml_camera()` unit test is good — keep that shape for whatever else gets added.
github-bot force-pushed github-bot/gh-376 from 8fbbc454c9 to 5dfc07d156 2026-12-04 16:16:49 +00:00 Compare
Author
Owner

@⁠coil111 on GitHub · 2026-12-04 16:14 UTC · original

Thanks for the review. I pushed a reworked branch:

  1. win11 is now its own commit (setup: optional win11 step ...), first in the series, so it can be reverted on its own. BUILD.md now says it changes the version for the whole prefix and how to undo it (winecfg -v win10). I also checked that the step is really needed, since the shim turned out to be the cause of the earlier failure. Same machine and shim, only the prefix version changed:

    Windows 10 (19045): generator "4.0.1 *" id=0xf600000081000001 -> creating its context failed with code 6
    Windows 11 (22000): generator "4.0.2"   id=0xf600000001000002 -> ML runs
    

    That's in the commit message too. The create-failure warning now names both requirements, so a Windows 10 prefix no longer leaves just a bare code 6.

  2. Shader pair tied to one build: agreed, that's intended for an opt-in mode. It isn't silent, though. After 60 upscales without a match it logs a warning (framegen.rs:1070) and says how to get the matching details. The HUD part was the real gap, see 3.

  3. HUD: when ML is on but the last frame had no matching camera (so it was shown as a real frame only, nothing generated), the tag now reads FG:ML-NOCAM. With a match it stays FG:ML.

  4. Numbers: the PR description already had them (generator GPU time 0.95 vs 1.45 ms, fps p10–p90, camera matched for 3440 of 3441 frames, VRAM note), and joaowtrdev posted two more runs above. I've now put them in the feature commit's message as well.

**@⁠coil111** on GitHub · 2026-12-04 16:14 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376#issuecomment-7417105134) Thanks for the review. I pushed a reworked branch: 1. **win11 is now its own commit** (`setup: optional win11 step ...`), first in the series, so it can be reverted on its own. BUILD.md now says it changes the version for the whole prefix and how to undo it (`winecfg -v win10`). I also checked that the step is really needed, since the shim turned out to be the cause of the earlier failure. Same machine and shim, only the prefix version changed: ``` Windows 10 (19045): generator "4.0.1 *" id=0xf600000081000001 -> creating its context failed with code 6 Windows 11 (22000): generator "4.0.2" id=0xf600000001000002 -> ML runs ``` That's in the commit message too. The create-failure warning now names both requirements, so a Windows 10 prefix no longer leaves just a bare `code 6`. 2. **Shader pair tied to one build:** agreed, that's intended for an opt-in mode. It isn't silent, though. After 60 upscales without a match it logs a warning (`framegen.rs:1070`) and says how to get the matching details. The HUD part was the real gap, see 3. 3. **HUD:** when ML is on but the last frame had no matching camera (so it was shown as a real frame only, nothing generated), the tag now reads `FG:ML-NOCAM`. With a match it stays `FG:ML`. 4. **Numbers:** the PR description already had them (generator GPU time 0.95 vs 1.45 ms, fps p10–p90, camera matched for 3440 of 3441 frames, VRAM note), and joaowtrdev posted two more runs above. I've now put them in the feature commit's message as well.
github-bot force-pushed github-bot/gh-376 from 5dfc07d156 to 9d833fef35 2026-12-04 20:05:11 +00:00 Compare
github manually merged commit e015c66a38 into main 2026-12-04 20:05:12 +00:00
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-12-05 04:52 UTC · original

ML frame generation is amazing

**@⁠maple-quartz18** on GitHub · 2026-12-05 04:52 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376#issuecomment-7432202693) ML frame generation is amazing
Author
Owner

@⁠fsrajner on GitHub · 2026-12-05 10:37 UTC · original

Data point for ML frame generation (VICTORY_FIDELITYFX_FRAMEGEN=4) on RDNA 4, measured after the merge.

Setup: RX 9070 XT 16 GB, Ryzen 7 7800X3D, CachyOS, repo-patched Mesa 26.3.1 RADV + vkd3d-proton. The prefix reports Windows 11 (22000), and amdxc64.dll comes from proton-cachyos-slr (it has UpdateFfxApiProviderEx). Build: main @ 8bf4878 plus LOCKhart07's rt-7-reuse (VICTORY_HW_RT=1, _LEAN_BUILDER=1, _REUSE=1). Series X profile, 4K output with FSR 4.1.2 Quality, RT on, headless gamescope. Same intro snapshot every run, 120 s after the first A press, 2 runs per arm, VICTORY_PRESENT_TIMING=1.

The log confirms the ML path: frame generation (direct): on ... ml=true. No fallback, no errors.

Arm rendered ms/frame 5 s windows > 40 ms worst window gpu_wait
no FG 44 (43 / 44) 83.3 % 68.0 ms 18.1 ms
FRAMEGEN=4 45 (45 / 45) 86.1 % 59.7 ms 29.6 ms
  • Cost on rendered frames: about 1-2 ms a frame, within noise. The number of presented frames roughly doubles.

  • Present pacing is bunched. This is from interval_us on the present-timing lines, over the last 3/4 of the presents after generation armed, about 3,200 per run; both runs agree:

    interval to the previous present share
    under 5 ms ~39 %
    40-60 ms ~30 %
    median 19 ms

    A generated frame and the following real one usually go out about 1-5 ms apart, so the cadence on screen is not an even ~22 ms.

  • This was headless gamescope with no display wait, so the bunching may come from that environment rather than from the pacing logic. I haven't checked it on a real display yet.

**@⁠fsrajner** on GitHub · 2026-12-05 10:37 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/376#issuecomment-7436581363) Data point for ML frame generation (`VICTORY_FIDELITYFX_FRAMEGEN=4`) on RDNA 4, measured after the merge. **Setup:** RX 9070 XT 16 GB, Ryzen 7 7800X3D, CachyOS, repo-patched Mesa 26.3.1 RADV + vkd3d-proton. The prefix reports Windows 11 (22000), and `amdxc64.dll` comes from proton-cachyos-slr (it has `UpdateFfxApiProviderEx`). Build: `main` @ `8bf4878` plus LOCKhart07's `rt-7-reuse` (`VICTORY_HW_RT=1`, `_LEAN_BUILDER=1`, `_REUSE=1`). Series X profile, 4K output with FSR 4.1.2 Quality, RT on, **headless gamescope**. Same intro snapshot every run, 120 s after the first A press, 2 runs per arm, `VICTORY_PRESENT_TIMING=1`. The log confirms the ML path: `frame generation (direct): on ... ml=true`. No fallback, no errors. | Arm | rendered ms/frame | 5 s windows > 40 ms | worst window | gpu_wait | |---|---|---|---|---| | no FG | 44 (43 / 44) | 83.3 % | 68.0 ms | 18.1 ms | | `FRAMEGEN=4` | 45 (45 / 45) | 86.1 % | 59.7 ms | 29.6 ms | - Cost on rendered frames: about 1-2 ms a frame, within noise. The number of presented frames roughly doubles. - **Present pacing is bunched.** This is from `interval_us` on the present-timing lines, over the last 3/4 of the presents after generation armed, about 3,200 per run; both runs agree: | interval to the previous present | share | |---|---| | under 5 ms | ~39 % | | 40-60 ms | ~30 % | | median | 19 ms | A generated frame and the following real one usually go out about 1-5 ms apart, so the cadence on screen is not an even ~22 ms. - This was headless gamescope with no display wait, so the bunching may come from that environment rather than from the pacing logic. I haven't checked it on a real display yet.
This discussion has been locked. Commenting is limited to contributors.
No description provided.