NVIDIA DLSS in place of the game's upscale (optional, RTX GPUs) #850

Closed
BlueHeisenberg wants to merge 1 commit from dlss-only into main
BlueHeisenberg commented 2026-11-08 23:10:37 +00:00 (Migrated from github.com)

NVIDIA DLSS

Builds on #849 (Output resolution); until that is merged, this PR also shows its commit.

Optional, for RTX GPUs. DLSS takes over the game's gameplay upscale. The 3D is drawn at the DLSS mode's size, and DLSS scales it up to the game's output using the game's depth and its camera's motion. Movies, menus and the HUD are unchanged. This is ported from zortos293/Lichii (its Streamline loader, camera motion and their shaders), which credits Duck912's Eglantine work.

Menu rows (Graphics tab)

Row Choices
DLSS Off, On (restart); says "no NVIDIA DLSS found" when the DLLs are missing
DLSS mode Ultra Performance, Performance, Balanced, Quality, DLAA, each shown with its size for the chosen output
DLSS preset J, K, L, M (changed at once)

While DLSS is on, the DLSS mode sets the Resolution. The DLSS mode's label and help text follow the Output resolution row as soon as it changes.

NVIDIA files: not included

third_party/streamline/ holds NVIDIA Streamline v2.14.16's headers only (MIT, license.txt; noted in gpu/PROVENANCE.md). No NVIDIA binaries are in the repo. At run time sl.interposer.dll, sl.common.dll and sl.dlss.dll (from the Streamline SDK) and nvngx_dlss.dll are loaded from a streamline folder beside the game exe. With the launcher layout, that's beside bin\hookshot.exe. If nvngx_dlss.dll is missing, the NVIDIA app's copy is used, but only if it is signed by NVIDIA. The interposer and the model must carry a valid NVIDIA Corporation signature (checked with WinVerifyTrust) or they are not loaded. Without these files, DLSS stays off and the game runs as before.

Platforms

Windows only. On Linux the DLSS code builds as a stub and the rows say DLSS is unavailable.

Overrides: RX_DLSS=0/1, RX_DLSS_PRESET=J..M, RX_DLSS_DIR=<folder>; tests: RX_DLSS_DEBUG=<n>.

Tested

On an RTX 5090 (Windows 11): the same 140-second gameplay route at every setting below. No crash and no device lost in any run.

With DLSS (3D size -> upscaled to the output)

Output DLSS Quality DLAA
2048x1152 1366x768 -> 2048x1152 2048x1152 -> 2048x1152
2560x1440 1707x960 -> 2560x1440 2560x1440 -> 2560x1440
3840x2160 2560x1440 -> 3840x2160 3840x2160 -> 3840x2160

Also tested at the 4K output: Ultra Performance (1280x720 -> 3840x2160, 4 runs) and DLAA with frame generation 2x. DLSS itself costs about 1.7 ms of GPU time per frame at 4K.

hookshot_vk.dll builds with the llvm-mingw version CI uses (20261104), and the DLSS files pass a Linux syntax check.

## NVIDIA DLSS Builds on #849 (Output resolution); until that is merged, this PR also shows its commit. Optional, for RTX GPUs. DLSS takes over the game's gameplay upscale. The 3D is drawn at the DLSS mode's size, and DLSS scales it up to the game's output using the game's depth and its camera's motion. Movies, menus and the HUD are unchanged. This is ported from zortos293/Lichii (its Streamline loader, camera motion and their shaders), which credits Duck912's Eglantine work. **Menu rows (Graphics tab)** | Row | Choices | |---|---| | DLSS | Off, On (restart); says "no NVIDIA DLSS found" when the DLLs are missing | | DLSS mode | Ultra Performance, Performance, Balanced, Quality, DLAA, each shown with its size for the chosen output | | DLSS preset | J, K, L, M (changed at once) | While DLSS is on, the DLSS mode sets the Resolution. The DLSS mode's label and help text follow the Output resolution row as soon as it changes. **NVIDIA files: not included** `third_party/streamline/` holds NVIDIA Streamline v2.14.16's headers only (MIT, `license.txt`; noted in `gpu/PROVENANCE.md`). No NVIDIA binaries are in the repo. At run time `sl.interposer.dll`, `sl.common.dll` and `sl.dlss.dll` (from the Streamline SDK) and `nvngx_dlss.dll` are loaded from a `streamline` folder beside the game exe. With the launcher layout, that's beside `bin\hookshot.exe`. If `nvngx_dlss.dll` is missing, the NVIDIA app's copy is used, but only if it is signed by NVIDIA. The interposer and the model must carry a valid NVIDIA Corporation signature (checked with WinVerifyTrust) or they are not loaded. Without these files, DLSS stays off and the game runs as before. **Platforms** Windows only. On Linux the DLSS code builds as a stub and the rows say DLSS is unavailable. **Overrides:** `RX_DLSS=0/1`, `RX_DLSS_PRESET=J..M`, `RX_DLSS_DIR=<folder>`; tests: `RX_DLSS_DEBUG=<n>`. ## Tested On an RTX 5090 (Windows 11): the same 140-second gameplay route at every setting below. No crash and no device lost in any run. **With DLSS** (3D size -> upscaled to the output) | Output | DLSS Quality | DLAA | |---|---|---| | 2048x1152 | 1366x768 -> 2048x1152 | 2048x1152 -> 2048x1152 | | 2560x1440 | 1707x960 -> 2560x1440 | 2560x1440 -> 2560x1440 | | 3840x2160 | 2560x1440 -> 3840x2160 | 3840x2160 -> 3840x2160 | Also tested at the 4K output: Ultra Performance (1280x720 -> 3840x2160, 4 runs) and DLAA with frame generation 2x. DLSS itself costs about 1.7 ms of GPU time per frame at 4K. `hookshot_vk.dll` builds with the llvm-mingw version CI uses (20261104), and the DLSS files pass a Linux syntax check.
DarkzGG commented 2026-11-08 23:33:14 +00:00 (Migrated from github.com)

Tested the same approach on a smaller card, in case it helps: RTX 4050 Laptop (6 GB VRAM), Windows 11, Hookshot v2.0.5, Streamline 2.14.16, DLSS preset K, Resolution 50–67 %.

My build is a separate prototype based on the same Lichii path (camera reprojection from cbuf 3, no jitter, depth *2-1), and it borrows dlss_color.comp and dlss_motion.comp from #818 (now this PR). DLSS works well on this card: 1152x648 -> 1536x864, clearly sharper than the game's network, no ghosting once the motion pass bounds its values.

One thing that may matter for 6 GB cards: VRAM pressure makes Streamline refuse DLSS.

With the default budget the game went past what the card allows. The log showed vk: VRAM: 5896 MB used of 5080 MB allowed and VRAM full: a 3072x3072 image ... in system memory. Streamline then logged Exceeded VRAM budget on every evaluate, and slEvaluateFeature sometimes failed, so the game's network took over for a few frames.

In the Kokiri village, GPU time was ~37 ms/frame (≈22 fps).

Capping the texture budget with RX_VK_VRAM_MB=3600 (the Low (6GB) preset's value) fixed it:

  • Usage dropped to ~4.85 GB of 5.05 GB allowed.
  • The Streamline warnings stopped.
  • DLSS stayed on.
  • GPU time fell to ~13.5 ms in a similar scene.

One catch: changing Resolution after picking the Low preset sets the preset back to Custom, which drops the VRAM cap. So a user who picks Low and then tunes Resolution loses it without noticing. With DLSS on, it might be worth keeping a VRAM cap on 6 GB cards, or noting it in the readme.

Reflex: I also added NVIDIA Reflex through the same Streamline instance:

  • kFeatureReflex + kFeaturePCL are loaded at slInit.
  • One frame token runs per present: slReflexSleep right after the present returns, then the PCL markers at the frame's first submit and around the present.
  • DLSS evaluates with the same token.
  • It needs sl.reflex.dll, sl.pcl.dll and NvLowLatencyVk.dll beside the other DLLs.

It runs fine together with frame generation 2x and feels noticeably more responsive. If you're interested, I can port it on top of this PR as a follow-up PR.

Tested the same approach on a smaller card, in case it helps: **RTX 4050 Laptop (6 GB VRAM)**, Windows 11, Hookshot v2.0.5, Streamline 2.14.16, DLSS preset K, Resolution 50–67 %. My build is a separate prototype based on the same Lichii path (camera reprojection from cbuf 3, no jitter, depth `*2-1`), and it borrows `dlss_color.comp` and `dlss_motion.comp` from #818 (now this PR). DLSS works well on this card: 1152x648 -> 1536x864, clearly sharper than the game's network, no ghosting once the motion pass bounds its values. **One thing that may matter for 6 GB cards: VRAM pressure makes Streamline refuse DLSS.** With the default budget the game went past what the card allows. The log showed `vk: VRAM: 5896 MB used of 5080 MB allowed` and `VRAM full: a 3072x3072 image ... in system memory`. Streamline then logged `Exceeded VRAM budget` on every evaluate, and `slEvaluateFeature` sometimes failed, so the game's network took over for a few frames. In the Kokiri village, GPU time was ~37 ms/frame (≈22 fps). Capping the texture budget with `RX_VK_VRAM_MB=3600` (the Low (6GB) preset's value) fixed it: - Usage dropped to ~4.85 GB of 5.05 GB allowed. - The Streamline warnings stopped. - DLSS stayed on. - GPU time fell to ~13.5 ms in a similar scene. One catch: changing Resolution after picking the Low preset sets the preset back to Custom, which drops the VRAM cap. So a user who picks Low and then tunes Resolution loses it without noticing. With DLSS on, it might be worth keeping a VRAM cap on 6 GB cards, or noting it in the readme. **Reflex:** I also added NVIDIA Reflex through the same Streamline instance: - `kFeatureReflex` + `kFeaturePCL` are loaded at `slInit`. - One frame token runs per present: `slReflexSleep` right after the present returns, then the PCL markers at the frame's first submit and around the present. - DLSS evaluates with the same token. - It needs `sl.reflex.dll`, `sl.pcl.dll` and `NvLowLatencyVk.dll` beside the other DLLs. It runs fine together with frame generation 2x and feels noticeably more responsive. If you're interested, I can port it on top of this PR as a follow-up PR.
NotRexed commented 2026-11-09 05:30:37 +00:00 (Migrated from github.com)

Closing to keep the queue clear — please rebase on current main and reopen; thanks!

Closing to keep the queue clear — please rebase on current main and reopen; thanks!
Commenting is not possible because the repository is archived.
No description provided.