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
pull from: dlss-only
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
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/Hookshot!850
Loading…
Reference in a new issue
No description provided.
Delete branch "dlss-only"
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?
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)
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 ingpu/PROVENANCE.md). No NVIDIA binaries are in the repo. At run timesl.interposer.dll,sl.common.dllandsl.dlss.dll(from the Streamline SDK) andnvngx_dlss.dllare loaded from astreamlinefolder beside the game exe. With the launcher layout, that's besidebin\hookshot.exe. Ifnvngx_dlss.dllis 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)
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.dllbuilds with the llvm-mingw version CI uses (20261104), and the DLSS files pass a Linux syntax check.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 borrowsdlss_color.companddlss_motion.compfrom #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 allowedandVRAM full: a 3072x3072 image ... in system memory. Streamline then loggedExceeded VRAM budgeton every evaluate, andslEvaluateFeaturesometimes 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: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+kFeaturePCLare loaded atslInit.slReflexSleepright after the present returns, then the PCL markers at the frame's first submit and around the present.sl.reflex.dll,sl.pcl.dllandNvLowLatencyVk.dllbeside 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.
Closing to keep the queue clear — please rebase on current main and reopen; thanks!