DLSS Ray Reconstruction (LARP_RR=1, NVIDIA, opt-in) #576

Open
github-bot wants to merge 1 commit from github-bot/gh-576 into main AGit
Owner

@⁠SkylerizMe on GitHub · 2026-12-06 03:07 UTC · original
SkylerizMe:pr/dlss-ray-reconstruction → main · +1062 −42 · 5 files · 1 commits · open

Adds opt-in DLSS Ray Reconstruction (NGX feature 13, nvngx_dlssd.dll) in place of DLSS Super Resolution where DLSS answers the title's FidelityFX upscaler. Off by default.

What it does

  • crates/larp-gpu/src/rr.rs (new): watches the title's render-target bindings for its G-buffer pass (six targets, formats 29/28/28/28/34/28, at the render size). Just before the upscale, a compute pass turns the packed targets into the guides NVIDIA takes (diffuse albedo, specular albedo, normals with roughness). The camera comes from the reflections' per-view constants (LARP_RR_CAMERA=0: identity).
  • dlss.rs: makes the RR feature next to SR's and evaluates it with the guides and the WorldToView / ViewToClip matrices. A failed RR evaluation falls back to SR for that frame; after three failures in a row RR is given up for the run. SR's feature is released after 600 frames by RR alone.
  • draw.rs: two small hooks (render targets bound; compute dispatches for the camera).
  • Whenever a guide is missing or the colour is not HDR, the frame uses DLSS SR as before and the log says which input is missing.
  • docs/environment-variables.md: LARP_RR, LARP_RR_CAMERA.

The title's own ray-tracing denoisers are left on. In our tests, leaving the reflections' filter out made glossy surfaces indoors white and glass pink or flickering; with the filter on and RR on top, those were gone. Details and speed numbers in a separate issue (to follow).

Credit: ported from TrustNo1/Darner PR #431 (its G-buffer map and conversion shader, GPL-3.0). Port written with help from Claude.

Testing

  • PC: RTX 5080 16 GB, Ryzen 9 9950X3D, 32 GB RAM, Windows 11. Retail 1.0.2.1, --console series-x.
  • Played on our local build, not this exact branch: c048b3a (v1.1.6) and v1.1.5, each plus local changes that are NOT in this PR (byte patches to leave out the title's RT denoisers, a borderless window with black bars, keeping previously drawn pipelines from the menu on, the GHST trainer DLL in the mods folder, D3D12 Agility 1.620.2). Switches: LARP_UPSCALER=dlss, LARP_UPSCALER_SCALE=0.6667, LARP_RESOLUTION=2560x1440 (one run 3440x1440), LARP_FRAME_RATE=60, LARP_DISPLAY_MODE=borderless, LARP_PIPELINE_WAIT_MS=8; DLSS frame generation 2x.
  • RR ran on 7,199 of 7,200 frames (1712x960 -> 2560x1440; also 2288x960 -> 3440x1440 with the native ultrawide output).
  • This branch (on 459db13): compile-checked only (cargo check --tests, Windows target).
**@⁠SkylerizMe** on GitHub · 2026-12-06 03:07 UTC · [original](https://github.com/gamingwithhomie/larp/pull/576) `SkylerizMe:pr/dlss-ray-reconstruction` → `main` · +1062 −42 · 5 files · 1 commits · open Adds opt-in DLSS Ray Reconstruction (NGX feature 13, nvngx_dlssd.dll) in place of DLSS Super Resolution where DLSS answers the title's FidelityFX upscaler. Off by default. **What it does** - `crates/larp-gpu/src/rr.rs` (new): watches the title's render-target bindings for its G-buffer pass (six targets, formats 29/28/28/28/34/28, at the render size). Just before the upscale, a compute pass turns the packed targets into the guides NVIDIA takes (diffuse albedo, specular albedo, normals with roughness). The camera comes from the reflections' per-view constants (`LARP_RR_CAMERA=0`: identity). - `dlss.rs`: makes the RR feature next to SR's and evaluates it with the guides and the WorldToView / ViewToClip matrices. A failed RR evaluation falls back to SR for that frame; after three failures in a row RR is given up for the run. SR's feature is released after 600 frames by RR alone. - `draw.rs`: two small hooks (render targets bound; compute dispatches for the camera). - Whenever a guide is missing or the colour is not HDR, the frame uses DLSS SR as before and the log says which input is missing. - `docs/environment-variables.md`: `LARP_RR`, `LARP_RR_CAMERA`. The title's own ray-tracing denoisers are left on. In our tests, leaving the reflections' filter out made glossy surfaces indoors white and glass pink or flickering; with the filter on and RR on top, those were gone. Details and speed numbers in a separate issue (to follow). **Credit:** ported from TrustNo1/Darner PR #431 (its G-buffer map and conversion shader, GPL-3.0). Port written with help from Claude. **Testing** - PC: RTX 5080 16 GB, Ryzen 9 9950X3D, 32 GB RAM, Windows 11. Retail 1.0.2.1, `--console series-x`. - Played on our local build, not this exact branch: c048b3a (v1.1.6) and v1.1.5, each plus local changes that are NOT in this PR (byte patches to leave out the title's RT denoisers, a borderless window with black bars, keeping previously drawn pipelines from the menu on, the GHST trainer DLL in the mods folder, D3D12 Agility 1.620.2). Switches: `LARP_UPSCALER=dlss`, `LARP_UPSCALER_SCALE=0.6667`, `LARP_RESOLUTION=2560x1440` (one run `3440x1440`), `LARP_FRAME_RATE=60`, `LARP_DISPLAY_MODE=borderless`, `LARP_PIPELINE_WAIT_MS=8`; DLSS frame generation 2x. - RR ran on 7,199 of 7,200 frames (1712x960 -> 2560x1440; also 2288x960 -> 3440x1440 with the native ultrawide output). - This branch (on 459db13): compile-checked only (`cargo check --tests`, Windows target).
Opt-in DLSS Ray Reconstruction (NGX feature 13, nvngx_dlssd.dll) in place
of DLSS Super Resolution where DLSS answers the title's FidelityFX upscaler.

- rr.rs (new): watches the title's render-target bindings for its G-buffer
  pass (six targets, formats 29/28/28/28/34/28, at the render size) and,
  just before the upscale, a compute pass turns the packed targets into the
  guides NVIDIA takes (diffuse albedo, specular albedo, normals with
  roughness). The camera comes from the reflections' per-view constants
  (LARP_RR_CAMERA=0: identity). Ported from TrustNo1/Darner PR #431 (its
  G-buffer map and conversion shader, GPL-3.0).
- dlss.rs: the RR feature is made beside SR's (DLSS.Denoise.Mode unified,
  roughness packed, hardware depth), evaluated with the guides and the
  WorldToView / ViewToClip matrices; a refused RR evaluation falls back to
  SR for that frame, and after three failures in a row RR is given up for
  the run. SR's feature is released after 600 frames by RR alone.
- draw.rs: the two hooks (render targets bound; compute dispatches for the
  camera).
- Falls back to DLSS SR whenever a guide is missing or the colour is not
  HDR, and the log says which input is missing.

The title's own ray-tracing denoisers are left as they are: with the
reflections' spatial filter patched out, glossy surfaces indoors came out
white and glass pink or flickering; with it on and RR on top, those are
gone.

Tested on an RTX 5080 (Windows 11, Series X, 2560x1440 and 3440x1440,
DLSS Quality, frame generation 2x) on v1.1.5 and c048b3a (v1.1.6) with
other local changes; this branch on 459db13 is compile-checked only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JG25HBViG2fKPW8mV1j4zH
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-06 03:11:12 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/576/head:github-bot/gh-576'
git switch 'github-bot/gh-576'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-576'
git switch 'github-bot/gh-576'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-576'
git switch 'github-bot/gh-576'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-576'
git switch 'main'
git merge --squash 'github-bot/gh-576'
git switch 'main'
git merge --ff-only 'github-bot/gh-576'
git switch 'main'
git merge 'github-bot/gh-576'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.