gpu: DLSS Frame Generation through NVIDIA Streamline (LARP_DLSSG_STREAMLINE=1, default off) for MFG Unlocker #160

Closed
github-bot wants to merge 1 commit from github-bot/gh-160 into main AGit
Owner

@⁠kadiratesdev on GitHub · 2026-12-05 20:03 UTC · original
kadiratesdev:feat/mfg-streamline → main · +1739 −10 · 6 files · 1 commits · closed without merging

Refs #33, #107.

Why

MFG Unlocker's Backspace menu under larp says "Waiting for an active DLSS-G wrapper" and its settings do nothing (#33). As the maintainer's comment there notes, the unlocker hooks a game's Streamline integration, not NGX. From its source (dashdogy/MFG-Unlocker, MIT) and from its log on another title, it detours sl.interposer.dll (slInit, slSetD3DDevice, slUpgradeInterface, slShutdown, slSetTagForFrame, slGetFeatureFunction) and, inside sl.dlss_g.dll, slDLSSGSetOptions, slDLSSGGetState and the NGX create/evaluate calls. Its README says: "For DLSS MFG the game must already have a Streamline DLSS Frame Generation integration." larp calls nvngx_dlssg.dll directly, so the unlocker never finds a wrapper.

What

A new default-off switch, LARP_DLSSG_STREAMLINE=1. With it, DLSS Frame Generation goes through Streamline the way a game integration does. Without it, nothing changes: no DLL is loaded, the queue and swap chain are created as before, and crate::dlssfg keeps its NGX path.

  • crates/larp-gpu/src/slfg.rs (new):
    • loads sl.interposer.dll from LARP_STREAMLINE_DIR (default streamline\ beside larp.exe);
    • calls slInit for DLSS-G + Reflex + PCL, with manual hooking, the DXGI factory proxy, frame-based tagging and no OTA. The engine is "custom" and the project id is a GUID; no NVIDIA app id;
    • after the host device is created, calls slSetD3DDevice. The direct queue is made through Streamline's device proxy, and the native queue behind it is used as before;
    • makes the swap chain through Streamline's factory proxy with that queue, using 4 buffers in this mode;
    • at each present: frame token, PCL markers, slSetConstants, slSetTagForFrame (depth and motion vectors from the copies dlssfg::dispatched already takes, plus the hudless copy when there is one), and slDLSSGSetOptions whenever the F10 count changes. Reflex low latency is on only while FG is on.
  • slfg/abi.rs: the hand-written Streamline 2.14 ABI, with offset tests. It comes from the VIctory fork's streamline/abi.rs, also GPL-3.0-or-later, where this layout runs DLSS-G with MFG Unlocker on an RTX 3080 Ti.
  • dlssfg.rs: when the switch is on and Streamline is ready, present hands the frame's inputs and camera to Streamline (streamline_present) and returns false, so the host presents the title's picture plainly on the proxy swap chain and sl.dlss_g inserts the generated frames. available_dlss reports DLSS available in this mode, because NGX's own "not available" on RTX 20/30 is exactly what the unlocker overrides.
  • host.rs: slfg::init() before D3D12CreateDevice, the queue/swap-chain hand-over, present_ends() after Present.
  • docs/environment-variables.md: LARP_DLSSG_STREAMLINE, LARP_STREAMLINE_DIR, LARP_STREAMLINE_LOG.

No NVIDIA binary is added. The user supplies the bin\x64 DLLs of NVIDIA's public Streamline SDK 2.14 (sl.interposer, sl.common, sl.dlss_g, sl.reflex, sl.pcl, nvngx_dlssg.dll).

Usage

LARP_MFG_UNLOCKER=1         (mfg\winmm.dll, as today)
LARP_DLSSG_STREAMLINE=1
LARP_STREAMLINE_DIR=<folder with the SDK's bin\x64 DLLs>   (default: streamline\ beside larp.exe)

Then set F10 to frame generator DLSS and 2x/3x/4x. The unlocker's Backspace menu should then show an active DLSS-G wrapper.

Testing (honest status)

  • Builds for x86_64-pc-windows-msvc (release, plus --features diagnostics check); no new clippy warnings in the new code.
  • cargo test --release --target x86_64-pc-windows-msvc (under Wine): everything passes, including the new slfg::abi layout tests and slfg tests. The one failure is larp-game prompts::font::...within_its_advance, which also fails on main under Wine; it needs a Windows host font.
  • Not yet tested in-game. The test will be on an RTX 3080 Ti (driver 621.47) with MFG Unlocker 1.7.2 and Streamline SDK 2.14.16. The same Streamline call sequence and ABI run DLSS-G with the unlocker on that machine in the VIctory fork (unlocker log: route=external ready=1 gameFG=1 appliedFG=1), but that is not larp. I'll post the result here.
  • Known open points:
    • NGX is initialised twice in this mode: once by larp's DLSS SR through _nvngx.dll, once by Streamline for DLSS-G.
    • The jitter is passed in render pixels (Streamline's convention).
    • The UI planes larp blends over the picture are not tagged as UIColorAndAlpha, only the hudless copy when the interface is drawn into the picture.
    • larp's own NVAPI Reflex should stay off in this mode.

This touches the present path only when the switch is on. Happy to rename the switch or move the defaults.

**@⁠kadiratesdev** on GitHub · 2026-12-05 20:03 UTC · [original](https://github.com/gamingwithhomie/larp/pull/160) `kadiratesdev:feat/mfg-streamline` → `main` · +1739 −10 · 6 files · 1 commits · closed without merging Refs #33, #107. ## Why MFG Unlocker's Backspace menu under larp says "Waiting for an active DLSS-G wrapper" and its settings do nothing (#33). As the maintainer's comment there notes, the unlocker hooks a game's **Streamline** integration, not NGX. From its source (dashdogy/MFG-Unlocker, MIT) and from its log on another title, it detours `sl.interposer.dll` (`slInit`, `slSetD3DDevice`, `slUpgradeInterface`, `slShutdown`, `slSetTagForFrame`, `slGetFeatureFunction`) and, inside `sl.dlss_g.dll`, `slDLSSGSetOptions`, `slDLSSGGetState` and the NGX create/evaluate calls. Its README says: "For DLSS MFG the game must already have a Streamline DLSS Frame Generation integration." larp calls `nvngx_dlssg.dll` directly, so the unlocker never finds a wrapper. ## What A new **default-off** switch, `LARP_DLSSG_STREAMLINE=1`. With it, DLSS Frame Generation goes through Streamline the way a game integration does. Without it, nothing changes: no DLL is loaded, the queue and swap chain are created as before, and `crate::dlssfg` keeps its NGX path. - `crates/larp-gpu/src/slfg.rs` (new): - loads `sl.interposer.dll` from `LARP_STREAMLINE_DIR` (default `streamline\` beside `larp.exe`); - calls `slInit` for DLSS-G + Reflex + PCL, with manual hooking, the DXGI factory proxy, frame-based tagging and no OTA. The engine is "custom" and the project id is a GUID; no NVIDIA app id; - after the host device is created, calls `slSetD3DDevice`. The direct queue is made through Streamline's device proxy, and the native queue behind it is used as before; - makes the swap chain through Streamline's factory proxy with that queue, using 4 buffers in this mode; - at each present: frame token, PCL markers, `slSetConstants`, `slSetTagForFrame` (depth and motion vectors from the copies `dlssfg::dispatched` already takes, plus the hudless copy when there is one), and `slDLSSGSetOptions` whenever the F10 count changes. Reflex low latency is on only while FG is on. - `slfg/abi.rs`: the hand-written Streamline 2.14 ABI, with offset tests. It comes from the VIctory fork's `streamline/abi.rs`, also GPL-3.0-or-later, where this layout runs DLSS-G with MFG Unlocker on an RTX 3080 Ti. - `dlssfg.rs`: when the switch is on and Streamline is ready, `present` hands the frame's inputs and camera to Streamline (`streamline_present`) and returns false, so the host presents the title's picture plainly on the proxy swap chain and `sl.dlss_g` inserts the generated frames. `available_dlss` reports DLSS available in this mode, because NGX's own "not available" on RTX 20/30 is exactly what the unlocker overrides. - `host.rs`: `slfg::init()` before `D3D12CreateDevice`, the queue/swap-chain hand-over, `present_ends()` after `Present`. - `docs/environment-variables.md`: `LARP_DLSSG_STREAMLINE`, `LARP_STREAMLINE_DIR`, `LARP_STREAMLINE_LOG`. No NVIDIA binary is added. The user supplies the `bin\x64` DLLs of NVIDIA's public Streamline SDK 2.14 (`sl.interposer`, `sl.common`, `sl.dlss_g`, `sl.reflex`, `sl.pcl`, `nvngx_dlssg.dll`). ## Usage ``` LARP_MFG_UNLOCKER=1 (mfg\winmm.dll, as today) LARP_DLSSG_STREAMLINE=1 LARP_STREAMLINE_DIR=<folder with the SDK's bin\x64 DLLs> (default: streamline\ beside larp.exe) ``` Then set F10 to frame generator DLSS and 2x/3x/4x. The unlocker's Backspace menu should then show an active DLSS-G wrapper. ## Testing (honest status) - Builds for `x86_64-pc-windows-msvc` (release, plus `--features diagnostics` check); no new clippy warnings in the new code. - `cargo test --release --target x86_64-pc-windows-msvc` (under Wine): everything passes, including the new `slfg::abi` layout tests and `slfg` tests. The one failure is `larp-game prompts::font::...within_its_advance`, which also fails on `main` under Wine; it needs a Windows host font. - **Not yet tested in-game.** The test will be on an RTX 3080 Ti (driver 621.47) with MFG Unlocker 1.7.2 and Streamline SDK 2.14.16. The same Streamline call sequence and ABI run DLSS-G with the unlocker on that machine in the VIctory fork (unlocker log: `route=external ready=1 gameFG=1 appliedFG=1`), but that is not larp. I'll post the result here. - Known open points: - NGX is initialised twice in this mode: once by larp's DLSS SR through `_nvngx.dll`, once by Streamline for DLSS-G. - The jitter is passed in render pixels (Streamline's convention). - The UI planes larp blends over the picture are not tagged as `UIColorAndAlpha`, only the hudless copy when the interface is drawn into the picture. - larp's own NVAPI Reflex should stay off in this mode. This touches the present path only when the switch is on. Happy to rename the switch or move the defaults.
MFG Unlocker hooks the game's Streamline integration (sl.interposer.dll
slInit/slSetD3DDevice/slUpgradeInterface/slSetTagForFrame and sl.dlss_g's
slDLSSGSetOptions/slDLSSGGetState); larp calls nvngx_dlssg.dll directly, so
its menu waits for 'an active DLSS-G wrapper' (#33). With the switch on,
DLSS-G goes through Streamline with manual hooking: slInit before the host
device, the direct queue and the swap chain made through Streamline's
proxies, and at each present the frame token, PCL markers, camera constants,
the layer's depth/motion-vector copies (and hudless colour) tagged, and
slDLSSGSetOptions from the F10 count. Off: nothing changes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 20:06:02 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-12-05 20:04 UTC · original · reviewed

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-12-05 20:04 UTC · [original](https://github.com/gamingwithhomie/larp/pull/160#pullrequestreview-6205610679) · **reviewed** Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Author
Owner

@⁠gamingwithhomie on GitHub · 2026-12-05 20:43 UTC · original

Reviewed alongside #133: we merged #133 (Streamline FG backend, opt-in LARP_FG_BACKEND=streamline) which also adds slfg.rs/slfg/abi.rs, so this PR now conflicts in approach. Please rebase on current main and reduce this to the MFG-Unlocker-specific delta on top of the merged Streamline backend (LARP_DLSSG_STREAMLINE wiring) - if the merged backend already satisfies the unlocker, a test report on #33/#107 may be all thats needed. Thank you!

**@⁠gamingwithhomie** on GitHub · 2026-12-05 20:43 UTC · [original](https://github.com/gamingwithhomie/larp/pull/160#issuecomment-7445050252) Reviewed alongside #133: we merged #133 (Streamline FG backend, opt-in `LARP_FG_BACKEND=streamline`) which also adds `slfg.rs`/`slfg/abi.rs`, so this PR now conflicts in approach. Please rebase on current main and reduce this to the MFG-Unlocker-specific delta on top of the merged Streamline backend (`LARP_DLSSG_STREAMLINE` wiring) - if the merged backend already satisfies the unlocker, a test report on #33/#107 may be all thats needed. Thank you!
Author
Owner

@⁠Heliumrich on GitHub · 2026-12-05 21:00 UTC · original · edited 2026-12-05 21:12 UTC

This PR as-is doesn't work for me on RTX4080
It feels exactly as 30fps, maybe even worse in terms of framepacing.

Capture d'écran 2026-12-05 215635

Anything above 2x has flickering terrain too, and motion vectors issue (broken stuff in black bars during cinematics)

Plus MFG Unlocker menu is impossible to use, the cursor can't interact with it (workaround : open windows start menu and you can click once ...)

Dude, try your PRs first at least....

**@⁠Heliumrich** on GitHub · 2026-12-05 21:00 UTC · [original](https://github.com/gamingwithhomie/larp/pull/160#issuecomment-7445290947) · edited 2026-12-05 21:12 UTC This PR as-is doesn't work for me on RTX4080 It feels exactly as 30fps, maybe even worse in terms of framepacing. <img width="3840" height="2160" alt="Capture d&#39;écran 2026-12-05 215635" src="https://github.com/user-attachments/assets/25adf737-bbc6-4314-936b-2615e5d09805" /> Anything above 2x has flickering terrain too, and motion vectors issue (broken stuff in black bars during cinematics) Plus MFG Unlocker menu is impossible to use, the cursor can't interact with it (workaround : open windows start menu and you can click once ...) Dude, try your PRs first at least....
Author
Owner

@⁠kadiratesdev on GitHub · 2026-12-05 23:42 UTC · original

Test report: #133 as merged (LARP_FG_BACKEND=streamline, commit e79b240) with MFG Unlocker 1.7.2, on an RTX 3080 Ti (driver 621.47, Windows 11 build 26300). Streamline 2.14.16, nvngx_dlssg 310.9.16, Series S profile. LARP_MFG_UNLOCKER=1, and this PR's LARP_DLSSG_STREAMLINE was not set.

  • larp's log: Streamline loaded (manual hooking, no downloads), DLSS Frame Generation loaded, Reflex: through Streamline, our swap chain is Streamline's proxy, then at the first tagged frame DLSS Frame Generation switched on=true ... result="ok".
  • The unlocker drove it through the merged backend. Its heartbeat for the whole session reads route=external ready=1 routeFailure=0 control=fixed 2x gameFG=1 appliedFG=1, with no "waiting for an active DLSS-G wrapper".
  • About 58 minutes in the world when I took the logs, with no device removal and the session still running. Subjectively it plays smoothly: the frame rate and image both look right to me, unlike the pacing problem with this PR.
  • Streamline logged Frame rate over 100.00ms, reseting frame timer 87 times and Out of order frame twice. The 2-hour session on this PR logged 1004 and 28.
  • Unlocker menu: the unlocker logs mouse-route=low-level-hook reason=no-window-messages, so it falls back to its own mouse hook under larp. The cursor capture in gameinput/mouse.rs I mentioned above is still the likely cause of the click problem @⁠Heliumrich saw. I have not made or tested a fix for it.

Not tested: anything above 2x (on this card the unlocker caps at 2x because the title is not on NVIDIA's list), the terrain flicker and the motion vectors in the cinematic bars, AMD, and Wine.

So the merged backend already covers the unlocker on my side. Nothing unlocker-specific from this PR is needed, so I'm closing it. Sorry for the noise, and thanks for #133. I'll post a short note on #33 and #107 pointing here.

**@⁠kadiratesdev** on GitHub · 2026-12-05 23:42 UTC · [original](https://github.com/gamingwithhomie/larp/pull/160#issuecomment-7447782524) Test report: #133 as merged (`LARP_FG_BACKEND=streamline`, commit e79b240) with MFG Unlocker 1.7.2, on an RTX 3080 Ti (driver 621.47, Windows 11 build 26300). Streamline 2.14.16, `nvngx_dlssg` 310.9.16, Series S profile. `LARP_MFG_UNLOCKER=1`, and this PR's `LARP_DLSSG_STREAMLINE` was **not** set. - larp's log: `Streamline loaded (manual hooking, no downloads)`, `DLSS Frame Generation loaded`, `Reflex: through Streamline`, `our swap chain is Streamline's proxy`, then at the first tagged frame `DLSS Frame Generation switched on=true ... result="ok"`. - The unlocker drove it through the merged backend. Its heartbeat for the whole session reads `route=external ready=1 routeFailure=0 control=fixed 2x gameFG=1 appliedFG=1`, with no "waiting for an active DLSS-G wrapper". - About 58 minutes in the world when I took the logs, with no device removal and the session still running. Subjectively it plays smoothly: the frame rate and image both look right to me, unlike the pacing problem with this PR. - Streamline logged `Frame rate over 100.00ms, reseting frame timer` 87 times and `Out of order frame` twice. The 2-hour session on this PR logged 1004 and 28. - Unlocker menu: the unlocker logs `mouse-route=low-level-hook reason=no-window-messages`, so it falls back to its own mouse hook under larp. The cursor capture in `gameinput/mouse.rs` I mentioned above is still the likely cause of the click problem @⁠Heliumrich saw. I have not made or tested a fix for it. Not tested: anything above 2x (on this card the unlocker caps at 2x because the title is not on NVIDIA's list), the terrain flicker and the motion vectors in the cinematic bars, AMD, and Wine. So the merged backend already covers the unlocker on my side. Nothing unlocker-specific from this PR is needed, so I'm closing it. Sorry for the noise, and thanks for #133. I'll post a short note on #33 and #107 pointing here.
github-bot closed this pull request 2026-12-05 23:51:22 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.