Skip to content

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

Open
notquiteog wants to merge 3 commits into
NotRexed:mainfrom
notquiteog:feat/framegen-by-amd
Open

notquiteog wants to merge 3 commits into
NotRexed:mainfrom
notquiteog:feat/framegen-by-amd

Conversation

@notquiteog

@notquiteog notquiteog commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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 65a4d87 merged in: 500 passed, 2 failed, 22 skipped. Two checks fail on this branch exactly as they fail on main at 65a4d87 without it: test_readme_menu_rows (the Skip opening row has no readme line; docs(readme): the option table has the Skip opening row, so main's readme check passes #2857 is open for it) and test_program_cache_one_variant (its fixture lacks the zstd cache's names since perf(vk): compress the program cache with zstd (RX_VK_PROGRAM_CACHE_ZSTD) #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 65a4d87 (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 FrameGen and FSR causes blur and ghosting while moving #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 had Auto and Built-in. AMD's frame generation could only be
reached through RX_VK_FSR_FG=1 (FSR 3.1's interpolation), and FSR 4's not at all. The row
now shows two more values, each only where it runs on this PC:

- AMD FSR 4 (2): AMD's frame generation through AMD's runtime (gpu/vk/vk_ffx.cpp), Windows,
  in a build with AMD FSR 4 (HOOKSHOT_FSR, as vk_fsr4.cpp), with
  amd_fidelityfx_framegeneration_vk.dll beside AMD's loader. It is handed the scene's depth
  and motion (vk_fsr3_inputs.h's Frame now carries the images and the view-projections), the
  camera in the world (camera_vectors.h) and the presented picture, and its made frames are
  copied into the set. Every call into AMD's DLLs is guarded and asked once, at the start.
- AMD FSR 3.1 (3): the frame interpolation that is already here (vk_fsr3fi.cpp), chosen from
  the menu at 2x, the one set it makes.

The choice is gpu/vk/framegen_methods.h, plain functions: a saved method that does not run
here is shown and used as Auto (so NVIDIA DLSS Frame Generation still runs at Auto, vk_dlss.cpp
fg_asked through framegen_by_auto), and a set a method does not make whole, or a frame it
refuses, is the renderer's own. Neither of AMD's is ever Auto's: they are given the picture
with the HUD in it and can smear it. RX_VK_FG_METHOD picks the row's value for one run.

AMD's frame generation headers (FidelityFX SDK v2.4.0, MIT, unmodified) join the API headers
in third_party/fidelityfx; nothing of AMD's runtime is vendored or fetched for it.

Tests: tests/test_framegen_methods.py, tests/test_camera_vectors.py, and vk_ffx.cpp's
dispatches in tests/test_recorder_sync.py. Built on Linux (where vk_ffx.cpp is its stubs) and
its Windows side syntax-checked with llvm-mingw's target; AMD's runtime has not been run.

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

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@notquiteog
notquiteog marked this pull request as ready for review November 12, 2026 18:10
@nullifyshot

Copy link
Copy Markdown
Contributor

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!

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.

2 participants