feat(framegen): AMD FSR 4 and AMD FSR 3.1 as Frame generation by choices #2665

Open
notquiteog wants to merge 1 commit from notquiteog/feat/framegen-by-amd into main
notquiteog commented 2026-11-12 04:48:49 +00:00 (Migrated from github.com)

The Frame generation by row offers Auto and Built-in only: a player with an AMD card has no way to pick AMD's own frame generation from the menu, and FSR 3.1's interpolation is reachable only through RX_VK_FSR_FG=1. This adds both as choices of the row. It is the "FidelityFX FSR 4 fallback as a small, separate PR" asked for when #1831 was closed.

The AMD FSR 4 half has not been run: AMD's runtime is Windows DLLs and this PC is Linux with an NVIDIA card. It is up for review as it is, with that said plainly; it needs a run on Windows with an AMD card before it merges, and I would be glad of one (testing wanted).

What it does

Row value What makes the frames Where
0 Auto as today (DLSS Frame Generation where it runs, else the renderer's own)
1 Built-in as today
2 AMD FSR 4 AMD's frame generation through AMD's runtime (vk_ffx.cpp), from the scene's depth, motion and camera; every made frame of a set in one dispatch Windows, built with --fsr, AMD's DLLs beside the game
3 AMD FSR 3.1 the interpolation already in the tree (vk_fsr3fi.cpp), chosen in the menu at 2x wherever it can run
  • framegen_methods.h is the choice, pure and tested: a value that does not run on this PC is stepped over by the arrows and shown as Auto when it comes from a saved file, and a set a method cannot make whole goes to the renderer's own, never to nothing. DLSS Frame Generation reads the row as it is shown (framegen_by_auto), so a saved AMD value on an NVIDIA PC still gets DLSS-G.
  • vk_ffx.cpp hands AMD's runtime our own images on our own command buffer (its "manual" dispatch, no swapchain of AMD's): Hookshot keeps presenting and pacing. A present it did not make is told to it as a reset. A context that cannot be made turns the choice off for the run and the row goes back to Auto.
  • camera_vectors.h: the camera's position and axes in the world from the projection and view-projection, which AMD's runtime takes.
  • The three frame generation headers are added to third_party/fidelityfx beside the four already there (MIT, same pinned SDK; the README there says which). AMD's frame generation DLL is not fetched by scripts/ffx_sdk.py yet: the readme says to put it beside the loader.
  • No change to vk_api.h.

How it was tested

  • tests/run_all.py (Linux), with main at 65a4d874 merged in: 500 passed, 2 failed, 22 skipped. Two checks fail on this branch exactly as they fail on main at 65a4d874 without it: test_readme_menu_rows (the Skip opening row has no readme line; #2857 is open for it) and test_program_cache_one_variant (its fixture lacks the zstd cache's names since #1630). New: test_framegen_methods, test_camera_vectors.
  • The Vulkan back end builds on Linux (clang, with NGX and --fsr). vk_ffx.cpp's Windows side and the other touched files pass clang++ --target=x86_64-w64-mingw32 -fsyntax-only with -DHOOKSHOT_FSR.
  • In the game with this branch's back end in a game built from main at 65a4d874 (run again after that merge): RTX 5060 Ti 16 GB, driver 615.71.09, Linux (COSMIC, Wayland), Kokiri Forest, 2048x1152 output, DLSS, V-Sync Off, 50 to 60 fps of game frames, no error or lost device in the log.
    • Auto at 2x: 600 of 600 presents made by DLSS-G.
    • AMD FSR 3.1 at 2x: fsr3fi: 600 of the last 600 made frames by FSR 3.1, 0 without its inputs; at 3x the renderer's own makes the set and the scene's inputs are no longer kept.
    • AMD FSR 4 asked on this PC: the row steps over it to Built-in.
    • Back to Auto: DLSS-G's feature is made again, 599 of 600.

Not tested

  • AMD FSR 4's frame generation at run time: loading AMD's DLLs, the provider query, the context, the dispatches, the image layouts, how the made frames look and how they pace. Compiled and read only.
  • Windows at all, AMD and Intel cards.
  • HDR with either AMD method.

Known and left

  • RX_VK_FG_METHOD=fsr3 does not start FSR 3.1 by itself (fsr3fi::asked() reads the row, and RX_VK_FSR_FG goes over both); the row does.
  • ffx::shutdown() is not called at exit.
  • The two new hints are English in all 13 menu languages.
  • As #1635 found, FSR 3.1's interpolation has no HUD-less colour here, so the HUD moves with the scene at 2x: that is why it stays a choice and not Auto's.

🤖 Generated with Claude Code

The Frame generation by row offers Auto and Built-in only: a player with an AMD card has no way to pick AMD's own frame generation from the menu, and FSR 3.1's interpolation is reachable only through `RX_VK_FSR_FG=1`. This adds both as choices of the row. It is the "FidelityFX FSR 4 fallback as a small, separate PR" asked for when #1831 was closed. **The AMD FSR 4 half has not been run**: AMD's runtime is Windows DLLs and this PC is Linux with an NVIDIA card. It is up for review as it is, with that said plainly; it needs a run on Windows with an AMD card before it merges, and I would be glad of one (`testing wanted`). ## What it does | Row value | What makes the frames | Where | |---|---|---| | 0 Auto | as today (DLSS Frame Generation where it runs, else the renderer's own) | | | 1 Built-in | as today | | | 2 AMD FSR 4 | AMD's frame generation through AMD's runtime (`vk_ffx.cpp`), from the scene's depth, motion and camera; every made frame of a set in one dispatch | Windows, built with `--fsr`, AMD's DLLs beside the game | | 3 AMD FSR 3.1 | the interpolation already in the tree (`vk_fsr3fi.cpp`), chosen in the menu at 2x | wherever it can run | - `framegen_methods.h` is the choice, pure and tested: a value that does not run on this PC is stepped over by the arrows and shown as Auto when it comes from a saved file, and a set a method cannot make whole goes to the renderer's own, never to nothing. DLSS Frame Generation reads the row as it is shown (`framegen_by_auto`), so a saved AMD value on an NVIDIA PC still gets DLSS-G. - `vk_ffx.cpp` hands AMD's runtime our own images on our own command buffer (its "manual" dispatch, no swapchain of AMD's): Hookshot keeps presenting and pacing. A present it did not make is told to it as a reset. A context that cannot be made turns the choice off for the run and the row goes back to Auto. - `camera_vectors.h`: the camera's position and axes in the world from the projection and view-projection, which AMD's runtime takes. - The three frame generation headers are added to `third_party/fidelityfx` beside the four already there (MIT, same pinned SDK; the README there says which). AMD's frame generation DLL is not fetched by `scripts/ffx_sdk.py` yet: the readme says to put it beside the loader. - No change to `vk_api.h`. ## How it was tested - `tests/run_all.py` (Linux), with main at 65a4d874 merged in: 500 passed, 2 failed, 22 skipped. Two checks fail on this branch exactly as they fail on main at 65a4d874 without it: `test_readme_menu_rows` (the Skip opening row has no readme line; #2857 is open for it) and `test_program_cache_one_variant` (its fixture lacks the zstd cache's names since #1630). New: `test_framegen_methods`, `test_camera_vectors`. - The Vulkan back end builds on Linux (clang, with NGX and `--fsr`). `vk_ffx.cpp`'s Windows side and the other touched files pass `clang++ --target=x86_64-w64-mingw32 -fsyntax-only` with `-DHOOKSHOT_FSR`. - In the game with this branch's back end in a game built from main at 65a4d874 (run again after that merge): RTX 5060 Ti 16 GB, driver 615.71.09, Linux (COSMIC, Wayland), Kokiri Forest, 2048x1152 output, DLSS, V-Sync Off, 50 to 60 fps of game frames, no error or lost device in the log. - Auto at 2x: 600 of 600 presents made by DLSS-G. - AMD FSR 3.1 at 2x: `fsr3fi: 600 of the last 600 made frames by FSR 3.1, 0 without its inputs`; at 3x the renderer's own makes the set and the scene's inputs are no longer kept. - AMD FSR 4 asked on this PC: the row steps over it to Built-in. - Back to Auto: DLSS-G's feature is made again, 599 of 600. ## Not tested - **AMD FSR 4's frame generation at run time**: loading AMD's DLLs, the provider query, the context, the dispatches, the image layouts, how the made frames look and how they pace. Compiled and read only. - Windows at all, AMD and Intel cards. - HDR with either AMD method. ## Known and left - `RX_VK_FG_METHOD=fsr3` does not start FSR 3.1 by itself (`fsr3fi::asked()` reads the row, and `RX_VK_FSR_FG` goes over both); the row does. - `ffx::shutdown()` is not called at exit. - The two new hints are English in all 13 menu languages. - As #1635 found, FSR 3.1's interpolation has no HUD-less colour here, so the HUD moves with the scene at 2x: that is why it stays a choice and not Auto's. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-sync changed title from WIP: feat(framegen): AMD FSR 4 and AMD FSR 3.1 as Frame generation by choices to feat(framegen): AMD FSR 4 and AMD FSR 3.1 as Frame generation by choices 2026-11-12 06:24:03 +00:00
Owner

@nullifyshot commented on GitHub · 2026-11-12 18:19 UTC · original

Hi, I know this isn't part of your PR, but I recommend changing "Auto" to DLSS, and move it over so 0 becomes Built-In and 1 becomes DLSS. We had discussions about it w/ the person who implemented DLSS, and that's what we like to do. We would like to basically hit two birds with one stone in this case. Thank you!

> [@nullifyshot](https://github.com/nullifyshot) commented on GitHub · 2026-11-12 18:19 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2665#issuecomment-6832138939) Hi, I know this isn't part of your PR, but I recommend changing "Auto" to DLSS, and move it over so 0 becomes Built-In and 1 becomes DLSS. We had discussions about it w/ the person who implemented DLSS, and that's what we like to do. We would like to basically hit two birds with one stone in this case. Thank you! <!-- github-sync:c:6832138939 -->
Commenting is not possible because the repository is archived.
No description provided.