WIP: feat(vk): add AMD FSR 4 Frame Generation (MLFI 4.0.2) #2831
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2831
Loading…
Reference in a new issue
No description provided.
Delete branch "nwgat/Longshot:feat/fsr4-framegen"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds standalone AMD FSR 4 Frame Generation (ML Frame Interpolation 4.0.2) via the AMD FidelityFX SDK v2.4.0 (
amd_fidelityfx_loader_vk.dll+amd_fidelityfx_framegeneration_vk.dll) on supported AMD GPUs, plus 10-bit PQ Native HDR support (A2B10G10R10_UNORM_PACK32) integrated with Longshot's Native HDR framegen buffers.FFX_FRAMEGENERATION_FLAG_NO_SWAPCHAIN_CONTEXT_NOTIFY), executingffxConfigure→ffxDispatchDescFrameGenerationPrepareV2(with reversed depth, render-pixel actor motion, and world-space camera basis fromvk_fsr3_inputs) →ffxDispatchDescFrameGeneration(numGeneratedFrames = 1, up to 2×).opts.framegen_by = 3) and enables AMD Anti-Lag 2 (opts.antilag = 1, synced viamenu_antilag_changed), while keeping both rows manually overridable.color_format) in Native HDR and composites crisp 10-bit PQ HUD pixels onto generated frames viashaders/fg_hud_fsr4_pq.comp(and the learned HUD layerhud.over_pipe/hud.over_pipe_rgba8in SDR).RX_VK_FSR4_FG=0|1forbids or forces FSR 4 FG for a run; DLSS FG (NGX and Streamline) and XeSS paths are untouched.Files to read first:
gpu/vk/vk_fsr4_fg.h,gpu/vk/vk_fsr4_fg.cpp,gpu/vk/vk_framegen.cpp,gpu/vk/menu/framegen.cpp,gpu/vk/fsr3_math.h,gpu/vk/framegen_rows.h, andtests/test_fsr4_fg.py.Testing
Tested:
providers 4.0.2, 3.1.6; using 4.0.2), verified context creation and frame generation in SDR and Native HDR PQ.main @ cb0a2763):test_fsr4_fg.py,test_framegen_by_row.py,test_framegen_dlss_cap.py,test_pacing_policy.py,test_menu_i18n.py(14/14),test_menu_i18n_count.py,test_menu_ini_keys.py,test_pass_barrier.py,test_fsr3fi_hud_mask.py,test_antilag.py,test_framegen_fixed_pace.py.g++ -std=c++20) both with and without-DLONGSHOT_FSR:vk_framegen.cpp,vk_temporal.cpp,menu/framegen.cpp,vk_fsr4_fg.cpp,vk_fsr3_inputs.cpp.Still to test:
d84c9d8b): re-verify in-game SDR, Native HDR PQ (10-bit HUD composite), Auto mode (with Anti-Lag 2 auto-enable), and Fixed 2× after themain @ cb0a2763rebase (by hand).@Beanstalk/ by hand).FSR4_FG_SKIP_NO_LIBRARY/FSR4_FG_SKIP_NO_MODEL) and builds without--upscaler fsr4(@Beanstalk/ CI).Measurements
Verdict: Pending — interleaved A/B frame-time and pacing measurements against
main @ cb0a2763(FSR 4 FG 2× vs FSR 3.1 FG 2× vs FG Off in SDR and Native HDR) still to be recorded while in WIP.Setup: Windows 11, AMD Radeon RX 9070 XT, Adrenalin 26.11.2, 3840×2160 @ 120 Hz.
cb0a2763d84c9d8bRisks
third_party/fidelityfx/framegeneration/include/ffx_framegeneration*.h); no AMD binaries ship with Longshot.RX_VK_FSR4_FG=0disables FSR 4 FG completely for a run; reverting the branch restoresmainwith no save, cache, orlongshot_options.iniincompatibility (an older ini'sframe_generation_by=0stays FSR 3.1 FG / DLSS FG).d84c9d8bafter adapting to upstream's 10-bit Native HDR (3f94da5d), Streamline (6e6f1160,450e63b8), and 45 FPS cap (53607d0d) changes.Checklist
Ready for review
main(cb0a2763); the title is a Conventional Commit.d84c9d8b.)mise run testpasses (any failure that also fails onmainis named). (Targeted unit tests passed; fullmise run testnot yet run.)main, or Measurements says why there is nothing to measure. (Interleaved measurements TBD in WIP.)third_party/untouched; nothing GPL-incompatible. (Note: adds MIT-licensed FFX SDK 2.4.0 headers underthird_party/fidelityfx/framegeneration/include/withPROVENANCE.md/README.md/scripts/fetch.py/mise.lockupdated.)When it applies
RX_VK_FSR4_FGadded with its row ingpu/vk/switches.def.tests/that reads changed source is updated, not weakened.gpu/vk/shaders/fg_hud_fsr4_pq_comp_spv.h).g++on Windows; Linux build pending CI.)mainand here, for a change that shows on screen. (Pending in-game capture ond84c9d8b.)docs/dev/reference/upscalers.md,docs/user/graphics-and-controls.md).Ready to merge
main, measured again or a comment says why the numbers still hold.Tested in game: Windows 11, AMD Radeon RX 9070 XT, Adrenalin 26.11.2, 4K: FSR 4 FG 4.0.2 verified in 3D gameplay (SDR and Native HDR PQ)
Possibly related, for context:
946ffd684fd84c9d8b1dView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.