FidelityFX frame generation on the -Fsr4K path (-FrameGen) #361

Open
github-bot wants to merge 2 commits from github-bot/gh-361 into a-publier AGit
Owner

@⁠tightfall on GitHub · 2026-11-26 21:59 UTC · original
tightfall:belobug-framegen → a-publier · +1164 −1 · 7 files · 2 commits · open

AMD frame generation between the frames the PC FSR 4.1.2 upscales on the -Fsr4K path: scripts\play.ps1 -Fsr4K quality -FrameGen (or VICTORY_FIDELITYFX_FRAMEGEN=1, diagnostics builds).

Where it comes from: the frame generation of avatarmanz/VIctory-7900XTX#53 by @⁠AwkGrep256. framegen.rs and framegen/camera.rs are taken as they are there, plus the presenter's proxy swap chain in host.rs. Credit for the hard part is theirs. What I changed is only the glue to this tree's FidelityFX module (the one from DexNom ab34a8b2):

  • When the PC upscaler is selected (use_host_dir), VICTORY_FIDELITYFX_FRAMEGEN=1 loads amd_fidelityfx_framegeneration_dx12.dll from the same FidelityFX folder, and the presenter's swap chain becomes its proxy.
  • After each successful host upscale (record_dispatch), the depth and motion textures (the title's, saved before they are swapped for host textures) and the dispatch's constants go to frame generation through a new Recording::frame_generation_inputs, inside the recording. So the host list is the one the upscale went into, also under VICTORY_THIN.
  • play.ps1 -FrameGen.

Limits: only the analytical mode (1). #53's mode 4 (the title's camera from its velocity pass) needs its camera trace in draw.rs, which I left out to keep this small. The UI is interpolated with the scene (no HUD-less colour).

Tested on an RX 9070, Windows 11, Adrenalin 26.11.2 (diag build of a-publier cd8dfc0 + this; my run also carried the RDNA 4 record-count fix from avatarmanz/VIctory-7900XTX#55 and had VICTORY_PORT_DESCRIPTORS=0, see #353). -Fsr4K quality, renderer ports 1, 5, 6 and 7:

  • The log shows the proxy (provider="3.1.7"), the generator (3.1.6, render 2560x1440, screen 3840x2160) and rendered=3 generated=3 presents=6.
  • Rendered frames: 11.8 fps median at ~6,900 draws, against 11.6 fps at ~7,100 draws in the same setup without it, so it costs about nothing on the CPU side. You see twice that.
  • No frame-generation warnings in ~7 minutes of play.
  • cargo check passes with and without --features diagnostics. I did not run the test suite.

Made with AI assistance (Claude Code).

**@⁠tightfall** on GitHub · 2026-11-26 21:59 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/361) `tightfall:belobug-framegen` → `a-publier` · +1164 −1 · 7 files · 2 commits · open AMD frame generation between the frames the PC FSR 4.1.2 upscales on the `-Fsr4K` path: `scripts\play.ps1 -Fsr4K quality -FrameGen` (or `VICTORY_FIDELITYFX_FRAMEGEN=1`, diagnostics builds). **Where it comes from:** the frame generation of avatarmanz/VIctory-7900XTX#53 by @⁠AwkGrep256. `framegen.rs` and `framegen/camera.rs` are taken as they are there, plus the presenter's proxy swap chain in `host.rs`. Credit for the hard part is theirs. What I changed is only the glue to this tree's FidelityFX module (the one from DexNom ab34a8b2): - When the PC upscaler is selected (`use_host_dir`), `VICTORY_FIDELITYFX_FRAMEGEN=1` loads `amd_fidelityfx_framegeneration_dx12.dll` from the same FidelityFX folder, and the presenter's swap chain becomes its proxy. - After each successful host upscale (`record_dispatch`), the depth and motion textures (the title's, saved before they are swapped for host textures) and the dispatch's constants go to frame generation through a new `Recording::frame_generation_inputs`, inside the recording. So the host list is the one the upscale went into, also under `VICTORY_THIN`. - `play.ps1 -FrameGen`. **Limits:** only the analytical mode (`1`). #53's mode 4 (the title's camera from its velocity pass) needs its camera trace in `draw.rs`, which I left out to keep this small. The UI is interpolated with the scene (no HUD-less colour). **Tested** on an RX 9070, Windows 11, Adrenalin 26.11.2 (diag build of `a-publier` `cd8dfc0` + this; my run also carried the RDNA 4 record-count fix from avatarmanz/VIctory-7900XTX#55 and had `VICTORY_PORT_DESCRIPTORS=0`, see #353). `-Fsr4K quality`, renderer ports 1, 5, 6 and 7: - The log shows the proxy (`provider="3.1.7"`), the generator (`3.1.6`, render 2560x1440, screen 3840x2160) and `rendered=3 generated=3 presents=6`. - Rendered frames: 11.8 fps median at ~6,900 draws, against 11.6 fps at ~7,100 draws in the same setup without it, so it costs about nothing on the CPU side. You see twice that. - No frame-generation warnings in ~7 minutes of play. - `cargo check` passes with and without `--features diagnostics`. I did not run the test suite. Made with AI assistance (Claude Code).
AMD frame generation between the frames the PC FSR 4.1.2 upscales, from
avatarmanz/VIctory-7900XTX#53 by AwkGrep256 (crates/victory-gpu/src/framegen.rs
and framegen/camera.rs as they are there, the presenter's proxy swap chain
in host.rs), fitted to this tree's FidelityFX module:

- VICTORY_FIDELITYFX_FRAMEGEN=1 (diagnostics builds) loads
  amd_fidelityfx_framegeneration_dx12.dll from the FidelityFX folder when
  the PC upscaler is selected; the presenter's swap chain becomes its proxy.
- After each successful host upscale, its depth and motion textures and the
  dispatch's constants go to frame generation from inside the recording
  (Recording::frame_generation_inputs), so it also holds under VICTORY_THIN.
- scripts\play.ps1 -FrameGen sets it.

Only the analytical mode (1). Mode 4 (the title's camera from its velocity
pass) needs #53's camera trace in draw.rs, which is not part of this.

Co-Authored-By: AwkGrep256 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
With frame generation the present waited for its one list to run, as #53
has it. That wait was 11-49 ms a frame on an RX 9070 (0 without frame
generation). VICTORY_FRAMEGEN_AHEAD=1 sends it ahead like any other present:
14.3 fps rendered instead of 13.3 in the same setup, 10+ minutes without a
fault. Off by default: a present sent ahead crashed a run in #53 once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:58:31 +00:00
Author
Owner

@⁠tightfall on GitHub · 2026-11-26 22:26 UTC · original

Added one commit: VICTORY_FRAMEGEN_AHEAD=1 (off by default) lets frame generation's present go in a list sent ahead like any other present.

As in #53, the present with frame generation waited for its one list to run. On the RX 9070 that wait was 11-49 ms a frame (the settles ... a synchronous submission or present line), and 0 without frame generation. With the switch:

rendered fps (median) sync wait
frame generation, present waits 13.3 (7,300 draws) 11 ms
frame generation + VICTORY_FRAMEGEN_AHEAD=1 14.3 (7,400 draws) 0 ms

About 28 fps on screen. 10+ minutes in the world without a fault so far. It stays off by default because #53 notes that a present sent ahead crashed a run there once after 4 minutes; longer runs would tell.

**@⁠tightfall** on GitHub · 2026-11-26 22:26 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/361#issuecomment-7204685034) Added one commit: `VICTORY_FRAMEGEN_AHEAD=1` (off by default) lets frame generation's present go in a list sent ahead like any other present. As in #53, the present with frame generation waited for its one list to run. On the RX 9070 that wait was 11-49 ms a frame (the `settles ... a synchronous submission or present` line), and 0 without frame generation. With the switch: | | rendered fps (median) | sync wait | |---|---|---| | frame generation, present waits | 13.3 (7,300 draws) | 11 ms | | frame generation + `VICTORY_FRAMEGEN_AHEAD=1` | 14.3 (7,400 draws) | 0 ms | About 28 fps on screen. 10+ minutes in the world without a fault so far. It stays off by default because #53 notes that a present sent ahead crashed a run there once after 4 minutes; longer runs would tell.
Author
Owner

@⁠AwkGrep256 on GitHub · 2026-11-26 23:00 UTC · original

Thanks @⁠tightfall for testing this and sharing both the wait time and the rendered FPS. Going from 11 ms of synchronous wait to 0 ms is interesting. The move from 13.3 to 14.3 rendered FPS gives us a sense of how much it helped in that run.

Keeping VICTORY_FRAMEGEN_AHEAD opt-in sounds right to me. With the present queued ahead, we need to make sure the previous frame's textures and command-list resources stay alive until the GPU finishes using them, even when the game stalls or changes scenes. Our earlier ahead-path crash happened during cleanup, so I'd want a longer same-route on/off test with a loading transition before making it the default. If you already plan to run it again, frame pacing and any crash log would be great to see.

For comparison, @⁠thejacte's run on our refresh branch reproduced FG3 compass and tree flicker at 1440p → 4K, while FG4 looked clean in the same scene. We're working on the FG3 flicker separately. Thanks again for getting the port running here.

**@⁠AwkGrep256** on GitHub · 2026-11-26 23:00 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/361#issuecomment-7205172451) Thanks @⁠tightfall for testing this and sharing both the wait time and the rendered FPS. Going from 11 ms of synchronous wait to 0 ms is interesting. The move from 13.3 to 14.3 rendered FPS gives us a sense of how much it helped in that run. Keeping `VICTORY_FRAMEGEN_AHEAD` opt-in sounds right to me. With the present queued ahead, we need to make sure the previous frame's textures and command-list resources stay alive until the GPU finishes using them, even when the game stalls or changes scenes. Our earlier ahead-path crash happened during cleanup, so I'd want a longer same-route on/off test with a loading transition before making it the default. If you already plan to run it again, frame pacing and any crash log would be great to see. For comparison, [@⁠thejacte's run on our refresh branch](https://git.gtahub.st/github/Belobug--VIctory-Belobug-AMD/pulls/118) reproduced FG3 compass and tree flicker at 1440p → 4K, while FG4 looked clean in the same scene. We're working on the FG3 flicker separately. Thanks again for getting the port running here.
This pull request has changes conflicting with the target branch.
  • scripts/play.ps1
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.
git fetch -u origin '+refs/pull/361/head:github-bot/gh-361'
git switch 'github-bot/gh-361'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-361'
git switch 'github-bot/gh-361'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-361'
git switch 'github-bot/gh-361'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-361'
git switch 'a-publier'
git merge --squash 'github-bot/gh-361'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-361'
git switch 'a-publier'
git merge 'github-bot/gh-361'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.