WIP: feat(vk): FSR 3.1 frame generation for everyone: FSR 3.1 FG on Frame generation by, any multiplier and Auto, the HUD kept still, actor motion, no see-through limbs #1103

Draft
HumanBean wants to merge 2 commits from HumanBean/Longshot:fsr3-fg-everyone into main
Owner

Type: feat · Risk: medium · Tested on: RTX 3090, Linux (NVIDIA driver; by hand before the smear fix, scripted runs since) · Needs: in-game runs on AMD (RDNA2/3), Intel and NVIDIA pre-RTX 40; Windows and Linux

Why

Frame generation on AMD, Intel and older NVIDIA cards is the renderer's own built-in maker: a 16×16 block match on the
finished picture. It ghosts badly (moving characters, edges, the HUD trailing the camera). AMD FSR 3.1's frame
interpolation was already compiled in and uses the scene's depth and motion, but it stayed opt-in (RX_VK_FSR_FG=1),
made only the 2x midpoint, got camera-only motion (no skinned characters), and moved the HUD with the scene (#1635 and
its duplicates). So almost nobody got it. This makes it good enough to be the default wherever DLSS Frame Generation
doesn't run, and a choice of its own on the Frame generation by row.

See #1075 (HUD artifacts with frame generation),
#1041 (the Frame generation by row, DLSS FG or Built-in
FG; this adds FSR 3.1 FG to it).

What changed

FSR 3.1 frame interpolation now makes the frames at every Frame generation setting (Auto, 2x to 8x), keeps the HUD
still, takes the temporal chain's motion with the skinned characters' own in it (with the game's own upscaler too),
shows a swinging limb once instead of twice see-through, and is a choice of its own on Frame generation by.

  • shaders: scripts/fsr3_shaders.py (FI_PATCHES, patched_fi_headers) compiles AMD's frame-interpolation passes from
    a patched copy of the SDK's GPU headers; third_party/ is unchanged. The made frame's place t comes from cbFI's
    padding word (_pad1 → fInterpolationT): the vector fields still keep half the motion, scaled where used (2t back
    to the frame before, 2(1−t) forward), the vector put at the pixel's place at t, the blend weighted t / 1−t. At
    t = 0.5 every scale is 1 and the passes are AMD's. The HUD: a pixel identical in both frames while the scene there
    moves is the current frame's pixel, and a sample landing on such a pixel takes the other frame's
    (LongshotStaticPixel, LongshotStaticSamples; dispatchFlags bit 16). The ten FI SPIR-V headers are regenerated.
  • gpu/vk/vk_fsr3fi.cpp: generate(cmd, in, times, count) makes count frames: the optical flow and
    reconstruct-and-dilate once a game frame, setup → interpolate → inpainting once a made frame, each with its own cbFI
    block. Made-frame images are allocated as a set asks (ensure_made), up to 7. asked(): on at Frame generation by
    FSR 3.1 FG, and at DLSS FG for what DLSS-G does not make (RX_VK_FSR_FG=0 never, =1 over the row).
  • gpu/vk/vk_framegen.cpp: fsr3fi_frames replaces fsr3fi_frame. Fixed multipliers: frames at k/m where DLSS-G
    made none. Auto rate: each refresh's t. FSR is fed every present it is asked (count 0 too) so its history holds; any
    set it does not make goes to the built-in maker as before.
  • gpu/vk/vk_temporal.cpp: temporal_fg_inputs() / fg_inputs(): with no engine drawing (the game's own upscaler, or
    Off) and FSR FI asked, the chain still takes the camera and skinned draws and makes its motion (prep + actor motion)
    at the gameplay upscale, leaving the picture to the network; no jitter is asked of the host. With an engine drawing,
    its motion is handed over too. vk_draw.cpp: the chain's gates admit this mode.
  • gpu/vk/vk_fsr3_inputs.cpp: take_motion copies the chain's motion over the camera-only motion FSR's own inputs
    made at the same dispatch (same units, same camera). PsychoV35 RGBA16F admitted at any multiplier, not only 2x.
  • smearing on characters: where the frame before's and this frame's samples disagree (a swinging arm, Link's hair),
    AMD's interpolation blends them half and half, so the limb shows twice, see-through. The game's motion is right
    (block-matched against the real frames: about 1 px median error on Link), so the patched interpolation takes the
    nearer frame's sample there instead, the other frame's where the disocclusion mask says the nearer one doesn't see
    the pixel: wherever the two samples differ by more than a fifth, all of it past two fifths (LongshotNoDoubles,
    dispatchFlags bit 22; RX_VK_FSR_FG_DOUBLES=1 gives AMD's blend back). actor_motion pairs frame generation's poses
    with its own last frame (fg_inputs). The 600-present log line counts frames with the chain's motion and the inputs'
    age.
  • menu: Frame generation by (#1041's DLSS FG = 0, Built-in FG = 1) gets FSR 3.1 FG as 2, so an options file's 1 stays
    Built-in FG. Where DLSS FG runs: DLSS FG (the default; FSR 3.1 makes what DLSS-G does not, such as Frame generation's
    Auto), FSR 3.1 FG, Built-in FG. Where it does not: FSR 3.1 FG (0, the default; a saved 2 is the same) and Built-in FG,
    the line at FSR 3.1 FG saying why not DLSS FG; the row is fixed only by RX_VK_DLSS_FG=1. FSR 3.1 FG's line in all 13
    translations. tests/test_framegen_by_row.py and tests/test_bug_report_defaults.py follow the three choices.
  • docs: README, docs/development.md, docs/temporal-history.md, docs/graphics-and-controls.md; the Graphics guide
    screenshot recaptured (scripts/screenshots/capture_menu.py): the row reads FSR 3.1 FG there now, not a fixed Built-in
    FG (docs/images/guide/manifest.json).

Measurements

Verdict: not measured yet: the PC's GPU is held for another session's timed runs. Ready to run once it is free
(this PR's runtime and main's at the same base): Kokiri Forest and Hyrule Field at 2x, main's Built-in FG against this
PR's FSR 3.1 FG against RX_VK_FSR_FG_DOUBLES=1, two interleaved runs each, game fps, frame time and GPU time.

Flags and settings

FSR 3.1 frame generation goes from opt-in to a choice of its own on Frame generation by, the default where DLSS FG cannot run; two new A/B switches.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
Frame generation by who makes the frames DLSS FG (0), Built-in FG (1); Built-in FG alone where DLSS FG cannot run DLSS FG (0), Built-in FG (1), FSR 3.1 FG (2); FSR 3.1 FG (0) and Built-in FG where DLSS FG cannot run FSR 3.1 on every GPU it runs on, every multiplier and Auto helps (by hand and scripted, RTX 3090: far less ghosting than Built-in FG; limbs: see the smear fix) default: DLSS FG where it runs, else FSR 3.1 FG
RX_VK_FSR_FG FSR FI over the row unset: off (=1 2x only) unset: the row; =0 never, =1 over the row untested leave unset
RX_VK_FSR_FG_HUD (new) keep static (HUD) pixels still — unset: on; =0 AMD's passes as they were A/B for the HUD heuristic helps (scripted runs: same doubling either way on limbs, so not the smear's cause) leave unset
RX_VK_FSR_FG_DOUBLES (new) AMD's blend where the frames disagree — unset: the nearer frame's sample; =1 AMD's blend A/B for the smear fix helps in scripted runs (solid limbs in all 12 strafe shots at this threshold; a lower one, and skipping the inpainting, were tried and were worse); not yet by eye leave unset

Testing

Tested:

  • Build: the renderer builds and links on Linux (clang, dev_build.py pack over base 02903b04), rebased on main
    1aec0c3c. The FI shaders compile with glslang through scripts/fsr3_shaders.py. The Graphics guide screenshot was
    rendered game-free by scripts/screenshots/capture_menu.py.
  • In the game, by hand (RTX 3090, Linux, about 37 game fps, before the smear fix): FSR 3.1 FG runs at 2x. Moving
    characters smeared: Link's hair, arms and legs doubled while strafing left and right, worst at 2x.
  • In the game, scripted (RTX 3090, Linux, headless sway at 2560x1440, the same Kokiri save, Z-targeted strafes past
    Saria, 12 screenshots each way, 20–30 game fps, 70–160 px of motion a frame):
    • FG off is clean, Built-in FG mostly clean, FSR FG doubled the limbs. RX_VK_FSR_FG_HUD=0 and RX_VK_DLSS_ACTORS=0
      doubled them the same way, so neither the HUD rule nor actor motion was the cause.
    • The game's motion is right: FSR's game vectors (a debug view, since removed) against block matching between the
      real frames: median error 1.3 px over 3,638 moving points (Link 0.9 px against ~38 px of motion). The doubling is
      FSR's blend.
    • The smear fix at the threshold now in the PR: solid limbs in all 12 strafe shots. Lower thresholds and skipping the
      inpainting were tried: see-through arms again, and tearing at limb edges, so they were dropped.
    • The rebased branch (before the threshold went back): FSR made 600 of 600 presents with Frame generation by at its
      default on this RTX 3090 (no DLSS FG), the chain's motion on 600 of 600.
  • No game-free checks were run on this PC (its owner's rule).

Not tested:

  • This exact commit in the game: the smear fix at its threshold by eye at a normal frame rate (waiting on the PC's GPU).
  • Every multiplier other than 2x, Auto rate, AMD, Intel, Windows, HDR.
  • Checks under tests/ that read the changed source were updated, not run: test_framegen_by_row.py,
    test_bug_report_defaults.py, test_psychov35_fsr3_fg.py, test_psychov35_default.py,
    test_fsr_uniform_ownership.py, present_source_crop_test.cpp (test_present_source_crop.py),
    test_fsr3_shaders.py (headers regenerated).

Known issues: the "A Talk" action prompt is mangled in made frames (HUD).

Must be tested:

  • By hand, NVIDIA or AMD at a normal frame rate: Frame generation 2x with FSR 3.1 FG, strafing left and right past a
    character, the default against RX_VK_FSR_FG_DOUBLES=1. Expect solid limbs without visible tearing.
  • The row: where DLSS FG runs, DLSS FG → Built-in FG → FSR 3.1 FG; where it does not, FSR 3.1 FG ↔ Built-in FG, its line
    at FSR 3.1 FG saying why not DLSS FG; an options file's frame_generation_by=1 stays Built-in FG.
  • Linux and Windows, AMD RDNA2/3: Frame generation 2x, 3x, 4x and Auto at the default. Expect "FSR 3.1 FG" on the row,
    the log's vk: fsr3fi: AMD FSR 3.1 makes N frame(s) and the temporal chain's motion ... in place of the camera's alone; the HUD crisp while the camera turns; far less ghosting on Link than with Built-in FG (by hand; Test Farm: amd).
  • RX_VK_FSR_FG_HUD=0 against the default at the same spot: the HUD smears without it (by hand).
  • NVIDIA RTX 40/50 with DLSS: DLSS FG still makes the frames at 2x–8x; FSR only at Auto rate and where DLSS-G has none
    (Test Farm: nvidia).
  • Intel Arc and a pre-RTX 40 NVIDIA card: FSR FI runs (Test Farm: intel).
  • Native HDR PsychoV35 at 3x: FSR makes the frames (camera-only motion with the game's own upscaler, by design).
  • The game-free checks: python -I -B tests/run_all.py (CI).

Risks

What could break: frame generation on every non-RTX-40 GPU now goes through FSR 3.1 by default: a fault in it
(a wrong picture, a GPU fault) would hit many players. The chain now runs its inputs pass with the game's own upscaler
while FSR FI is on (one compute pass plus the actor draws a frame). Semi-transparent HUD elements over a moving scene
can still smear a little.

Turning it off: Frame generation by: Built-in FG (or DLSS FG where it runs), or RX_VK_FSR_FG=0; RX_VK_FSR_FG_HUD=0 for the HUD heuristic;
RX_VK_FSR_FG_DOUBLES=1 for the smear fix.

Compatibility: the options file's frame_generation_by keeps its values (0 DLSS FG, or FSR 3.1 FG where DLSS FG
cannot run; 1 Built-in FG) and gains 2 (FSR 3.1 FG); saves are unchanged. The FI shaders are new SPIR-V (their pipelines are
built again once).

Issues

See #1075, #1041

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure. (not yet: waiting on the PC's GPU)
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). (not run on this PC: CI)
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. (to come)
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. (to come)
  • The SPIR-V headers regenerated with glslang (a shader changed).
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8dyfXG2rFtkFseYa25y

**Type:** feat · **Risk:** medium · **Tested on:** RTX 3090, Linux (NVIDIA driver; by hand before the smear fix, scripted runs since) · **Needs:** in-game runs on AMD (RDNA2/3), Intel and NVIDIA pre-RTX 40; Windows and Linux ## Why Frame generation on AMD, Intel and older NVIDIA cards is the renderer's own built-in maker: a 16×16 block match on the finished picture. It ghosts badly (moving characters, edges, the HUD trailing the camera). AMD FSR 3.1's frame interpolation was already compiled in and uses the scene's depth and motion, but it stayed opt-in (`RX_VK_FSR_FG=1`), made only the 2x midpoint, got camera-only motion (no skinned characters), and moved the HUD with the scene (#1635 and its duplicates). So almost nobody got it. This makes it good enough to be the default wherever DLSS Frame Generation doesn't run, and a choice of its own on the Frame generation by row. See [#1075](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1075) (HUD artifacts with frame generation), [#1041](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1041) (the Frame generation by row, DLSS FG or Built-in FG; this adds FSR 3.1 FG to it). ## What changed FSR 3.1 frame interpolation now makes the frames at every Frame generation setting (Auto, 2x to 8x), keeps the HUD still, takes the temporal chain's motion with the skinned characters' own in it (with the game's own upscaler too), shows a swinging limb once instead of twice see-through, and is a choice of its own on Frame generation by. - shaders: `scripts/fsr3_shaders.py` (`FI_PATCHES`, `patched_fi_headers`) compiles AMD's frame-interpolation passes from a patched copy of the SDK's GPU headers; `third_party/` is unchanged. The made frame's place `t` comes from cbFI's padding word (`_pad1` → `fInterpolationT`): the vector fields still keep half the motion, scaled where used (2t back to the frame before, 2(1−t) forward), the vector put at the pixel's place at t, the blend weighted t / 1−t. At t = 0.5 every scale is 1 and the passes are AMD's. The HUD: a pixel identical in both frames while the scene there moves is the current frame's pixel, and a sample landing on such a pixel takes the other frame's (`LongshotStaticPixel`, `LongshotStaticSamples`; dispatchFlags bit 16). The ten FI SPIR-V headers are regenerated. - `gpu/vk/vk_fsr3fi.cpp`: `generate(cmd, in, times, count)` makes `count` frames: the optical flow and reconstruct-and-dilate once a game frame, setup → interpolate → inpainting once a made frame, each with its own cbFI block. Made-frame images are allocated as a set asks (`ensure_made`), up to 7. `asked()`: on at Frame generation by FSR 3.1 FG, and at DLSS FG for what DLSS-G does not make (`RX_VK_FSR_FG=0` never, `=1` over the row). - `gpu/vk/vk_framegen.cpp`: `fsr3fi_frames` replaces `fsr3fi_frame`. Fixed multipliers: frames at k/m where DLSS-G made none. Auto rate: each refresh's t. FSR is fed every present it is asked (count 0 too) so its history holds; any set it does not make goes to the built-in maker as before. - `gpu/vk/vk_temporal.cpp`: `temporal_fg_inputs()` / `fg_inputs()`: with no engine drawing (the game's own upscaler, or Off) and FSR FI asked, the chain still takes the camera and skinned draws and makes its motion (prep + actor motion) at the gameplay upscale, leaving the picture to the network; no jitter is asked of the host. With an engine drawing, its motion is handed over too. `vk_draw.cpp`: the chain's gates admit this mode. - `gpu/vk/vk_fsr3_inputs.cpp`: `take_motion` copies the chain's motion over the camera-only motion FSR's own inputs made at the same dispatch (same units, same camera). PsychoV35 RGBA16F admitted at any multiplier, not only 2x. - smearing on characters: where the frame before's and this frame's samples disagree (a swinging arm, Link's hair), AMD's interpolation blends them half and half, so the limb shows twice, see-through. The game's motion is right (block-matched against the real frames: about 1 px median error on Link), so the patched interpolation takes the nearer frame's sample there instead, the other frame's where the disocclusion mask says the nearer one doesn't see the pixel: wherever the two samples differ by more than a fifth, all of it past two fifths (`LongshotNoDoubles`, dispatchFlags bit 22; `RX_VK_FSR_FG_DOUBLES=1` gives AMD's blend back). `actor_motion` pairs frame generation's poses with its own last frame (`fg_inputs`). The 600-present log line counts frames with the chain's motion and the inputs' age. - menu: Frame generation by (#1041's DLSS FG = 0, Built-in FG = 1) gets **FSR 3.1 FG** as 2, so an options file's 1 stays Built-in FG. Where DLSS FG runs: DLSS FG (the default; FSR 3.1 makes what DLSS-G does not, such as Frame generation's Auto), FSR 3.1 FG, Built-in FG. Where it does not: FSR 3.1 FG (0, the default; a saved 2 is the same) and Built-in FG, the line at FSR 3.1 FG saying why not DLSS FG; the row is fixed only by `RX_VK_DLSS_FG=1`. FSR 3.1 FG's line in all 13 translations. `tests/test_framegen_by_row.py` and `tests/test_bug_report_defaults.py` follow the three choices. - docs: README, `docs/development.md`, `docs/temporal-history.md`, `docs/graphics-and-controls.md`; the Graphics guide screenshot recaptured (`scripts/screenshots/capture_menu.py`): the row reads FSR 3.1 FG there now, not a fixed Built-in FG (`docs/images/guide/manifest.json`). ## Measurements **Verdict:** not measured yet: the PC's GPU is held for another session's timed runs. Ready to run once it is free (this PR's runtime and main's at the same base): Kokiri Forest and Hyrule Field at 2x, main's Built-in FG against this PR's FSR 3.1 FG against `RX_VK_FSR_FG_DOUBLES=1`, two interleaved runs each, game fps, frame time and GPU time. ### Flags and settings FSR 3.1 frame generation goes from opt-in to a choice of its own on Frame generation by, the default where DLSS FG cannot run; two new A/B switches. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | Frame generation by | who makes the frames | DLSS FG (0), Built-in FG (1); Built-in FG alone where DLSS FG cannot run | DLSS FG (0), Built-in FG (1), FSR 3.1 FG (2); FSR 3.1 FG (0) and Built-in FG where DLSS FG cannot run | FSR 3.1 on every GPU it runs on, every multiplier and Auto | helps (by hand and scripted, RTX 3090: far less ghosting than Built-in FG; limbs: see the smear fix) | default: DLSS FG where it runs, else FSR 3.1 FG | | `RX_VK_FSR_FG` | FSR FI over the row | unset: off (`=1` 2x only) | unset: the row; `=0` never, `=1` over the row | | untested | leave unset | | `RX_VK_FSR_FG_HUD` (new) | keep static (HUD) pixels still | — | unset: on; `=0` AMD's passes as they were | A/B for the HUD heuristic | helps (scripted runs: same doubling either way on limbs, so not the smear's cause) | leave unset | | `RX_VK_FSR_FG_DOUBLES` (new) | AMD's blend where the frames disagree | — | unset: the nearer frame's sample; `=1` AMD's blend | A/B for the smear fix | helps in scripted runs (solid limbs in all 12 strafe shots at this threshold; a lower one, and skipping the inpainting, were tried and were worse); not yet by eye | leave unset | ## Testing **Tested:** - Build: the renderer builds and links on Linux (clang, `dev_build.py pack` over base 02903b04), rebased on main 1aec0c3c. The FI shaders compile with glslang through `scripts/fsr3_shaders.py`. The Graphics guide screenshot was rendered game-free by `scripts/screenshots/capture_menu.py`. - In the game, by hand (RTX 3090, Linux, about 37 game fps, before the smear fix): FSR 3.1 FG runs at 2x. Moving characters smeared: Link's hair, arms and legs doubled while strafing left and right, worst at 2x. - In the game, scripted (RTX 3090, Linux, headless sway at 2560x1440, the same Kokiri save, Z-targeted strafes past Saria, 12 screenshots each way, 20–30 game fps, 70–160 px of motion a frame): - FG off is clean, Built-in FG mostly clean, FSR FG doubled the limbs. `RX_VK_FSR_FG_HUD=0` and `RX_VK_DLSS_ACTORS=0` doubled them the same way, so neither the HUD rule nor actor motion was the cause. - The game's motion is right: FSR's game vectors (a debug view, since removed) against block matching between the real frames: median error 1.3 px over 3,638 moving points (Link 0.9 px against ~38 px of motion). The doubling is FSR's blend. - The smear fix at the threshold now in the PR: solid limbs in all 12 strafe shots. Lower thresholds and skipping the inpainting were tried: see-through arms again, and tearing at limb edges, so they were dropped. - The rebased branch (before the threshold went back): FSR made 600 of 600 presents with Frame generation by at its default on this RTX 3090 (no DLSS FG), the chain's motion on 600 of 600. - No game-free checks were run on this PC (its owner's rule). **Not tested:** - This exact commit in the game: the smear fix at its threshold by eye at a normal frame rate (waiting on the PC's GPU). - Every multiplier other than 2x, Auto rate, AMD, Intel, Windows, HDR. - Checks under `tests/` that read the changed source were updated, not run: `test_framegen_by_row.py`, `test_bug_report_defaults.py`, `test_psychov35_fsr3_fg.py`, `test_psychov35_default.py`, `test_fsr_uniform_ownership.py`, `present_source_crop_test.cpp` (`test_present_source_crop.py`), `test_fsr3_shaders.py` (headers regenerated). **Known issues:** the "A Talk" action prompt is mangled in made frames (HUD). **Must be tested:** - By hand, NVIDIA or AMD at a normal frame rate: Frame generation 2x with FSR 3.1 FG, strafing left and right past a character, the default against `RX_VK_FSR_FG_DOUBLES=1`. Expect solid limbs without visible tearing. - The row: where DLSS FG runs, DLSS FG → Built-in FG → FSR 3.1 FG; where it does not, FSR 3.1 FG ↔ Built-in FG, its line at FSR 3.1 FG saying why not DLSS FG; an options file's `frame_generation_by=1` stays Built-in FG. - Linux and Windows, AMD RDNA2/3: Frame generation 2x, 3x, 4x and Auto at the default. Expect "FSR 3.1 FG" on the row, the log's `vk: fsr3fi: AMD FSR 3.1 makes N frame(s)` and `the temporal chain's motion ... in place of the camera's alone`; the HUD crisp while the camera turns; far less ghosting on Link than with Built-in FG (by hand; Test Farm: amd). - `RX_VK_FSR_FG_HUD=0` against the default at the same spot: the HUD smears without it (by hand). - NVIDIA RTX 40/50 with DLSS: DLSS FG still makes the frames at 2x–8x; FSR only at Auto rate and where DLSS-G has none (Test Farm: nvidia). - Intel Arc and a pre-RTX 40 NVIDIA card: FSR FI runs (Test Farm: intel). - Native HDR PsychoV35 at 3x: FSR makes the frames (camera-only motion with the game's own upscaler, by design). - The game-free checks: `python -I -B tests/run_all.py` (CI). ## Risks **What could break:** frame generation on every non-RTX-40 GPU now goes through FSR 3.1 by default: a fault in it (a wrong picture, a GPU fault) would hit many players. The chain now runs its inputs pass with the game's own upscaler while FSR FI is on (one compute pass plus the actor draws a frame). Semi-transparent HUD elements over a moving scene can still smear a little. **Turning it off:** Frame generation by: Built-in FG (or DLSS FG where it runs), or `RX_VK_FSR_FG=0`; `RX_VK_FSR_FG_HUD=0` for the HUD heuristic; `RX_VK_FSR_FG_DOUBLES=1` for the smear fix. **Compatibility:** the options file's `frame_generation_by` keeps its values (0 DLSS FG, or FSR 3.1 FG where DLSS FG cannot run; 1 Built-in FG) and gains 2 (FSR 3.1 FG); saves are unchanged. The FI shaders are new SPIR-V (their pipelines are built again once). ## Issues See [#1075](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1075), [#1041](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1041) ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [ ] Measurements has a verdict, or one line saying why there is nothing to measure. (not yet: waiting on the PC's GPU) - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [ ] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). (not run on this PC: CI) - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [ ] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. (to come) - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [ ] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. (to come) - [x] The SPIR-V headers regenerated with glslang (a shader changed). - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8dyfXG2rFtkFseYa25y
feat(vk): FSR 3.1 frame generation for everyone: any multiplier and Auto, the HUD kept still, actor motion, Auto picks it after DLSS FG
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 12s
PR description / Description follows the template (pull_request_target) Successful in 16s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 18s
CI / Workflow lint (actionlint) (pull_request) Successful in 19s
Third-party parts / As their notes say (pull_request) Successful in 26s
0a14e0198e
AMD's frame interpolation passes are compiled from a patched copy of the SDK's headers
(scripts/fsr3_shaders.py FI_PATCHES; third_party/ unchanged): the made frame's place t comes
from cbFI's padding word, so a set makes each of its frames at k/m (or at Auto, each refresh's),
and a pixel the same in both frames while the scene there moves (the HUD) is kept where it is
(RX_VK_FSR_FG_HUD=0: AMD's as they were). The flow and the dilated inputs run once a game frame,
the rest once a made frame, and the interpolation is fed every present so its history holds.

Its motion is the temporal chain's, the skinned draws' own in it, whether an engine draws or not
(temporal_fg_inputs: the chain makes its inputs alone with the game's own upscaler or Off).
Frame generation by's Auto: DLSS FG where it runs, else FSR 3.1, else the built-in one; it was
opt-in (RX_VK_FSR_FG=1) at 2x only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
First-time contributor

The incredible update! Could you look into this issue when you have some attention to spare: #596
The DLSS indicator is flashing constantly. It's not detrimental, but I wonder if it would uncover some hidden implementation issues.

The incredible update! Could you look into this issue when you have some attention to spare: https://git.magicbean.dev/MagicBeanDev/Longshot/issues/596 The DLSS indicator is flashing constantly. It's not detrimental, but I wonder if it would uncover some hidden implementation issues.
fix(vk): FSR 3.1 frame generation shows a swinging limb once, from the nearer frame, not as a see-through double of both
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 15s
PR description / Description follows the template (pull_request_target) Successful in 8s
042e7a8d1d
Where the frame before's and this frame's samples disagree (Link's arms, legs and hair when strafing), AMD's
interpolation blends them half and half and inpaints the rest, so the limb shows twice at half strength. The game's
motion is right (block-matched against the real frames: about 1 px median error on Link). The patched interpolation
(scripts/fsr3_shaders.py LongshotNoDoubles, dispatchFlags bit 22) takes the nearer frame's sample there instead, the
other side where the disocclusion mask says the nearer one doesn't see the pixel, and skips the inpainting.
RX_VK_FSR_FG_DOUBLES=1 gives AMD's blend back, for an A/B.

Also: actor_motion pairs frame generation's poses with its own last frame (fg_inputs), and the 600-present log line
counts frames with the chain's motion and the inputs' age. Debug views for now (WIP): RX_VK_FSR_FG_SOURCE=game, flow,
prevwarp, mask, vectors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8dyfXG2rFtkFseYa25y
Author
Owner

Pushed 042e7a8d: a fix for the smearing on characters (Link's arms, legs and hair doubled into see-through copies when strafing, most visible at 2x).

  • Cause: not the motion. I checked the game's vectors (RX_VK_FSR_FG_SOURCE=vectors) against block matching between the real frames: median error about 1 px on Link, 5% of the motion. The doubling comes from AMD's interpolation: where the frame before and this frame disagree, it blends them half and half and inpaints the rest.
  • Fix: where they disagree, the patched interpolation takes the nearer frame's sample (the other frame's where the disocclusion mask says the nearer one doesn't see the pixel), and skips the inpainting there (LongshotNoDoubles, dispatchFlags bit 22, on by default). RX_VK_FSR_FG_DOUBLES=1 gives AMD's blend back for an A/B.
  • Tested: scripted headless strafe runs on an RTX 3090 (Linux), at 20–27 game fps with 70–160 px of motion a frame. All 12 strafe shots show solid limbs. At that motion some made frames tear at limb edges and on the ground under Link. Not yet compared by eye in a normal run at ~37 fps. If the tearing shows there, the next step is to restrict the change to the pixels actor motion draws.
  • Still WIP: the debug views (RX_VK_FSR_FG_SOURCE=game|flow|prevwarp|mask|vectors) come out before ready, and the branch still needs reworking onto #1041's row. The "A Talk" prompt is mangled in made frames, a separate HUD issue.
Pushed 042e7a8d: a fix for the smearing on characters (Link's arms, legs and hair doubled into see-through copies when strafing, most visible at 2x). - **Cause:** not the motion. I checked the game's vectors (`RX_VK_FSR_FG_SOURCE=vectors`) against block matching between the real frames: median error about 1 px on Link, 5% of the motion. The doubling comes from AMD's interpolation: where the frame before and this frame disagree, it blends them half and half and inpaints the rest. - **Fix:** where they disagree, the patched interpolation takes the nearer frame's sample (the other frame's where the disocclusion mask says the nearer one doesn't see the pixel), and skips the inpainting there (`LongshotNoDoubles`, dispatchFlags bit 22, on by default). `RX_VK_FSR_FG_DOUBLES=1` gives AMD's blend back for an A/B. - **Tested:** scripted headless strafe runs on an RTX 3090 (Linux), at 20–27 game fps with 70–160 px of motion a frame. All 12 strafe shots show solid limbs. At that motion some made frames tear at limb edges and on the ground under Link. Not yet compared by eye in a normal run at ~37 fps. If the tearing shows there, the next step is to restrict the change to the pixels actor motion draws. - Still WIP: the debug views (`RX_VK_FSR_FG_SOURCE=game|flow|prevwarp|mask|vectors`) come out before ready, and the branch still needs reworking onto [#1041](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1041)'s row. The "A Talk" prompt is mangled in made frames, a separate HUD issue.
HumanBean force-pushed fsr3-fg-everyone from 042e7a8d1d
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Third-party parts / As their notes say (pull_request) Successful in 15s
PR description / Description follows the template (pull_request_target) Successful in 8s
to 0d2f95260e
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
PR description / Description follows the template (pull_request_target) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 13s
2026-11-16 17:50:01 +00:00
Compare
HumanBean force-pushed fsr3-fg-everyone from 0d2f95260e
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 6s
PR description / Description follows the template (pull_request_target) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 10s
CI / Workflow lint (actionlint) (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 13s
to 718cb283b8
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 16s
2026-11-16 18:51:02 +00:00
Compare
HumanBean force-pushed fsr3-fg-everyone from 718cb283b8
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 16s
to 3ef7eca7ac
All checks were successful
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 14s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 15s
Third-party parts / As their notes say (pull_request) Successful in 20s
PR description / Description follows the template (pull_request_target) Successful in 8s
2026-11-16 19:10:06 +00:00
Compare
HumanBean changed title from WIP: feat(vk): FSR 3.1 frame generation for everyone: any multiplier and Auto, the HUD kept still, actor motion to WIP: feat(vk): FSR 3.1 frame generation for everyone: FSR 3.1 FG on Frame generation by, any multiplier and Auto, the HUD kept still, actor motion, no see-through limbs 2026-11-16 19:10:59 +00:00
All checks were successful
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 14s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 15s
Third-party parts / As their notes say (pull_request) Successful in 20s
PR description / Description follows the template (pull_request_target) Successful in 8s
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fsr3-fg-everyone:HumanBean-fsr3-fg-everyone'
git switch 'HumanBean-fsr3-fg-everyone'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1103
No description provided.