d3d12: FSR 3 frame generation for cards without DLSS frame generation (D3D12-FSR3-FRAMEGEN) #2615
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2615"
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?
Imported from ubiquitarianism/leonida. Originally posted by alpfilho on 2026-11-29T15:49:36Z.
Claimed in the coordination issue as: D3D12-FSR3-FRAMEGEN (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7258291947)
What and why
DLSS frame generation (Streamline) runs on RTX 40 and 50 cards only, so on an RTX 20 or 30 card the
d3d12/runtime shows only the title's own frames.LEONIDA_FSR_FRAMEGEN=1(-FsrFrameGenin both launchers, or FSR 3 FRAME GEN 2X in the F1 menu) presents through AMD FidelityFX's frame interpolation swap chain instead: one generated frame between two of the title's.leonida-gpu/src/fsr.rs(new):amd_fidelityfx_loader_dx12.dllandamd_fidelityfx_framegeneration_dx12.dllfromLEONIDA_FIDELITYFX_DIR(d3d12\amd-sdk\FidelityFX\binby default), and only onceWinVerifyTrustfinds both signed.fg.rsalready collects for DLSS (from an upscale,tag_plainor the G-buffer pass).fg.rs:collecting()). That includes main's newgbuffer_submitted, andgbuffer_at_presentruns at FSR's presents too.inputs_for_present()gives them tofsr.rs.shown_per_frame()counts FSR's frames for the frame-rate text.host.rs: the swap chain comes fromfsr.rswhen it is on, andfsr.rsis told beforeResizeBuffers.-FsrFrameGenand-FidelityFxDirare new. A missing DLL turns it off with a message.-RayTracing.LEONIDA_TEXTURE_ROOM_PERCENTdefaults to 80 with it, because FSR's frame generation holds 1.5 to 2 GB of video memory.Ported and adapted from trustno1-coder/VIctory-NVIDIA
crates/victory-gpu/src/streamline/fsr.rs(29d8dbf, GPL-3.0), credited in the module's notes and in thed3d12/README.mdtable. AMD's DLLs are not in the repository: the user puts them in the folder. This is not PORT-UN-FIDELITYFX-REDIRECT, which redirects the title's own FSR upscaler DLL.Tested
c22a0a732: retail copy, Series S profile, DLSS upscaling plus FSR 3 frame generation.cargo test -p leonida-gpu --lib fsr, three tests: the struct layouts against AMD's headers, the states and formats, and the flags from depth and back buffer.cargo clippyreports nothing infsr.rs.cargo test,cargo clippyandscripts\build-nvidia.ps1were run again. The game was not run again; the only code change is thegbuffer_submitted/gbuffer_at_presentmerge described above.GPUs tested: NVIDIA GeForce RTX 3060 12 GB, driver 621.40, Windows 11 Pro (build 26300); Ryzen 5 5600GT, 16 GB RAM
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No translator change.)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T16:47:21Z.
Independent Linux check of
865f6c24emerged onto0bc6e21a1, using the official signed AMD FSR SDK 2.4.0, DXVK and VKD3D-Proton71cae091. Test-only code supplied cleared R32_FLOAT depth and R16G16_FLOAT motion textures at the present-input boundary. The production prepare, configure, generation callback and swap-chain resize all ran.cachyos-11.0-20261015-slreach passed two runs. Each run produced six SDK callback outputs at 384×216 and six more after resizing to 512×288. The SDK reported 12 successful callbacks and 12 generated outputs per run, and its queue wait returned 0. Presents without fresh inputs disabled interpolation. The three included unit tests also passed on both runners. With FSR disabled, the SDK missing, or a synthetic unsigned DLL rejected by WinVerifyTrust, the ordinary swap chain still presented and resized.Xid 31on the test process. The second size did not complete and headless Gamescope later faulted. This is one failed run with generation active. An earlier check of this same PR head on9e3218f0esuccessfully resized the NVIDIA FidelityFX swap chain with no frame-generation inputs. The failure is localized in time to resize in the active-generation test. Its cause remains unverified.The offline fixture used synthetic textures. These checks cover SDK setup, its generated-output descriptor counts and resize behavior. AI-assisted with OpenAI Codex (GPT-6).
Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-29T17:37:14Z.
Independent native Windows 11 + AMD Radeon RX 7900 XTX (gfx1100, driver 32.0.32029.2010, Windows 11 10.0.26200) check of
865f6c24emerged cleanly onto main4364a4fa6(no FidelityFX SDK DLLs installed; no game files):4364a4fa6): cargo test -p leonida-gpu --lib -- --test-threads=4 -> 544 passed; 0 failed; 47 ignored (13.62 s).865f6c24e) + main4364a4fa6: cargo test -p leonida-gpu --lib -- --test-threads=4 -> 547 passed; 0 failed; 47 ignored (13.47 s).AI-assisted: Antigravity (Gemini 4 Neon).
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-11-29T17:37:56Z.
A partial verification: the parts that can be checked without a Rust toolchain. The build and the frame-generation behaviour I cannot verify here (no
cargoon thismachine, only a Windows C++ runtime), so read this as "the wiring matches", not "it works".
Checked:
Parser::ParseInput, no errors):scripts/play-d3d12.ps1andd3d12/scripts/play-nvidia.ps1;d3d12/cratesLEONIDA_FSR_FRAMEGENLEONIDA_FIDELITYFX_DIRLEONIDA_FG_WITH_RTorigin/main4364a4fa6, so it is close to reviewable without a rebase.What I did not do: build the workspace, run it on an AMD card, or check that FSR 3 frame generation produces frames. That needs a Rust build and hardware this machine
does not have in that configuration, and it is the part a reviewer actually has to settle.
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-11-29T17:49:52Z.
Live menu follow-up on
865f6c24emerged onto4364a4fa6. AMD Raphael iGPU / RADV Mesa 26.3.1, signed FidelityFX SDK 2.4.0, VKD3D-Proton71cae091. I ran each case twice with System Wine 11.22 and twice with CachyOS-Protoncachyos-11.0-20261015-slr. A synthetic fixture called the actualMenu::changeaction on the presenter and supplied depth and motion textures at the existing inputs boundary.All four toggle runs produced the same sequence. Off was observed on the second present after the menu action, consistent with the poll interval. I drained the SDK queue at the phase boundaries and confirmed that the same FidelityFX swap chain kept presenting throughout.
The four additional runs started on an ordinary DXGI swap chain with the signed SDK files available. Selecting On was correctly marked as pending by the menu, kept the normal chain, and all eleven presents completed with zero SDK callbacks.
This covers the menu state and real SDK presentation path on AMD using synthetic inputs. AI-assisted with OpenAI Codex (GPT-6).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T18:36:08Z.
RUN: PR #2615 (FSR 3 frame generation without DLSS frame generation)
Heads: PR
865f6c24e, maineedd72e30(current origin/main at the time). Merged locally withgit merge --no-ff(clean, 12 files, nothing pushed). No conflict with #2566.Command (d3d12/, MSVC target, vcvars64):
cargo test -j 6 -p leonida-gpu --lib,cargo check -j 6 -p leonida-gpu --tests;python -I -B tests/test_leonida_launcher.py(the only test that reads the two .ps1 scripts the PR touches).fsr.rskept; the tests and the code share that new file, so reverting only the non-test code is a build failure):create_flagsno longer sets the HDR flag for an R16G16B16A16_FLOAT back buffer.fsr::tests::flags_from_depth_and_back_bufferFAILED atfsr.rs:926(left: 8, right: 40); the other two fsr tests pass. Restored afterwards.fsr::tests::layouts_match_the_headers,states_and_formats,flags_from_depth_and_back_bufferok. Whole--libsuite: 547 passed, 0 failed, 47 ignored in 3 of 4 runs; plain main 544 passed, 0 failed, 47 ignored (2 of 2 runs).descriptor::tests::records_copied_as_bytes_are_made_at_the_next_sync(descriptor.rs:2108, a test outside the PR's files); it passed 3 of 3 alone and in the next 3 full runs. Looks like a flaky test under parallel load; I did not see it on plain main (2 runs), so I cannot say it is pre-existing.cargo check -p leonida-gpu --testson the merged tree: clean (the newwindows-sysfeatures resolve, no lockfile change needed).tests/test_leonida_launcher.pyon the merged tree: 15 OK.Not checked: that frame generation works on a card (needs the FidelityFX DLLs and a game run).
Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 (native target).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T19:00:08Z.
Merging. Head
865f6c24ehas red/green verdicts from reviewers other than the author (above), merges cleanly withmaina09d1627e, does not force a rebase of #2566, and carries a claim ID. Remaining main CI reds (translator-testsmesh,semantic-testsf16) are pre-existing. Merged by MoonEyes.AI-assisted (Claude Code).