Exclude the title's interface from frame generation (DLSS-G HUDLess / FSR HUDLessColor) #84

Manually merged
github merged 1 commit from github-bot/gh-84 into main 2026-12-05 19:01:24 +00:00 AGit
Owner

@⁠SophieTheDoe on GitHub · 2026-12-05 17:52 UTC · original
SophieTheDoe:fix/fg-ui-exclusion → main · +416 −5 · 6 files · 1 commits · merged 2026-12-05 19:00 UTC

Summary

Frame generation (DLSS-G and FSR-FG) was interpolating the game's interface — HUD, menus, map — producing visible ghosting/doubling, because the title composites its UI into the presented frame and larp fed NGX/FSF NULL for every UI-related input (DLSSG.HUDLess, DLSSG.UI, DLSSG.UIAlpha, FSR HUDLessColor).

This PR ports the hudless-capture approach already proven in the victory lineage for this same title/build: snapshot the frame before the interface composite executes and hand that snapshot to the generators as their HUD-less input. Generators then produce frames for the scene only and re-composite the real UI on top.

How it works

The title draws its whole interface into its own target, then lays it over the back buffer with a single fullscreen triangle (draw(), 3 vertices / 1 instance, no depth) using a known pipeline — vertex shader 0602c2384acbb3b2, pixel shader a78d088fa55aa495 (blake3-16hex, same hash space the shader cache already uses).

When frame generation is active, crates/larp-gpu/src/hudless.rs (new):

  1. Detects that composite draw: target ∈ SHOWN ring (last 4 presented host textures) + both known shader hashes across pipeline stages + triangle shape + single colour target + no depth.
  2. Snapshots the target with CopyResource into a 4-deep texture ring (swapchain format), with barriers::around COPY_SOURCE transitions computed from HostList::layout_now() so in-list title barriers are respected.
  3. Pairs the copy with the presented texture across submit → present (HUD_PENDING/HUD_SUBMITTED queues, mark_hudless/take_hudless/presented).
  4. Feeds it to the generators:
    • NGX: DLSSG.HUDLess in evaluate() (was NULL), with COPY_DEST→NON_PIXEL_SHADER_RESOURCE barrier around feature dispatch.
    • FSR: Configure.hudless (was Resource::NONE); FSR derives its own UI mask from the hudless buffer.

Two-plane presents (Series S preset / own-size UI) are unaffected: the overlay plane already bypasses generation ("no interface goes through the generation"), and the hudless copy is consumed and dropped when over is non-empty.

Files

  • crates/larp-gpu/src/hudless.rs — new module: SHOWN ring, copy queues, texture ring, detection, counters
  • crates/larp-gpu/src/draw.rs — before_shown_target hook in draw()/draw_indexed() (after masked_out, before prepare)
  • crates/larp-gpu/src/host.rs — HostList.hudless field, layout_now(), submit hook, swap_format visibility
  • crates/larp-gpu/src/dlssfg.rs — present() pairing, Evaluation.hudless → DLSSG.HUDLess, barriers
  • crates/larp-gpu/src/fsrfg.rs — Frame.hudless → Configure.hudless
  • crates/larp-gpu/src/lib.rs — module decl

Diagnostics

  • info! once on first composite match (size/format/pipeline/state).
  • info! once per ≤24 distinct non-composite pipelines drawing into the presented texture, printing shader hashes — identifies the composite hashes if they ever change.
  • debug! every 10 s: copies/tagged/missing/composites/again/others/busy counters.

Verification

  • cargo check -p larp-gpu clean; cargo build --release -p larp clean.
  • In-game (RTX 3060, FSR FG 2x, 3840x2160): log confirms the colour without the interface is copied in front of the title's interface composite with the expected pipeline hashes; HUD ghosting resolved.

Notes / limitations

  • Cinematic (letterbox) bars are baked into scene color before the composite, so they remain inside the HUD-less snapshot — FG can still generate into the bar region. Not addressed here (no region-mask input exists); the bars are scene pixels, not a separable draw.
  • If the composite shader hashes ever change for a new title build, detection silently stops matching — the others counter/logs will show the new candidate hashes.

Made with the help of Devin.

**@⁠SophieTheDoe** on GitHub · 2026-12-05 17:52 UTC · [original](https://github.com/gamingwithhomie/larp/pull/84) `SophieTheDoe:fix/fg-ui-exclusion` → `main` · +416 −5 · 6 files · 1 commits · merged 2026-12-05 19:00 UTC ## Summary Frame generation (DLSS-G and FSR-FG) was interpolating the game's **interface** — HUD, menus, map — producing visible ghosting/doubling, because the title composites its UI into the presented frame and larp fed NGX/FSF `NULL` for every UI-related input (`DLSSG.HUDLess`, `DLSSG.UI`, `DLSSG.UIAlpha`, FSR `HUDLessColor`). This PR ports the **hudless-capture** approach already proven in the victory lineage for this same title/build: snapshot the frame *before* the interface composite executes and hand that snapshot to the generators as their HUD-less input. Generators then produce frames for the scene only and re-composite the real UI on top. ## How it works The title draws its whole interface into its own target, then lays it over the back buffer with a **single fullscreen triangle** (`draw()`, 3 vertices / 1 instance, no depth) using a known pipeline — vertex shader `0602c2384acbb3b2`, pixel shader `a78d088fa55aa495` (blake3-16hex, same hash space the shader cache already uses). When frame generation is active, `crates/larp-gpu/src/hudless.rs` (new): 1. **Detects** that composite draw: target ∈ `SHOWN` ring (last 4 presented host textures) + both known shader hashes across pipeline stages + triangle shape + single colour target + no depth. 2. **Snapshots** the target with `CopyResource` into a 4-deep texture ring (swapchain format), with `barriers::around` COPY_SOURCE transitions computed from `HostList::layout_now()` so in-list title barriers are respected. 3. **Pairs** the copy with the presented texture across submit → present (`HUD_PENDING`/`HUD_SUBMITTED` queues, `mark_hudless`/`take_hudless`/`presented`). 4. **Feeds** it to the generators: - NGX: `DLSSG.HUDLess` in `evaluate()` (was NULL), with COPY_DEST→NON_PIXEL_SHADER_RESOURCE barrier around feature dispatch. - FSR: `Configure.hudless` (was `Resource::NONE`); FSR derives its own UI mask from the hudless buffer. Two-plane presents (Series S preset / own-size UI) are unaffected: the overlay plane already bypasses generation (\"no interface goes through the generation\"), and the hudless copy is consumed and dropped when `over` is non-empty. ## Files - `crates/larp-gpu/src/hudless.rs` — new module: SHOWN ring, copy queues, texture ring, detection, counters - `crates/larp-gpu/src/draw.rs` — `before_shown_target` hook in `draw()`/`draw_indexed()` (after `masked_out`, before `prepare`) - `crates/larp-gpu/src/host.rs` — `HostList.hudless` field, `layout_now()`, submit hook, `swap_format` visibility - `crates/larp-gpu/src/dlssfg.rs` — `present()` pairing, `Evaluation.hudless` → `DLSSG.HUDLess`, barriers - `crates/larp-gpu/src/fsrfg.rs` — `Frame.hudless` → `Configure.hudless` - `crates/larp-gpu/src/lib.rs` — module decl ## Diagnostics - `info!` once on first composite match (size/format/pipeline/state). - `info!` once per ≤24 distinct non-composite pipelines drawing into the presented texture, printing shader hashes — identifies the composite hashes if they ever change. - `debug!` every 10 s: `copies/tagged/missing/composites/again/others/busy` counters. ## Verification - `cargo check -p larp-gpu` clean; `cargo build --release -p larp` clean. - In-game (RTX 3060, FSR FG 2x, 3840x2160): log confirms `the colour without the interface is copied in front of the title's interface composite` with the expected pipeline hashes; HUD ghosting resolved. ## Notes / limitations - Cinematic (letterbox) bars are baked into scene color before the composite, so they remain inside the HUD-less snapshot — FG can still generate into the bar region. Not addressed here (no region-mask input exists); the bars are scene pixels, not a separable draw. - If the composite shader hashes ever change for a new title build, detection silently stops matching — the `others` counter/logs will show the new candidate hashes. Made with the help of Devin.
The title draws its whole interface (HUD, menus, map) into its own
target and lays it over the back buffer with a single fullscreen
triangle of a known pipeline. With one presented plane that composite
happens inside the frame, so frame generation was interpolating the
interface too — visible as ghosting/doubling on the HUD.

Port of the hudless capture already proven in the victory lineage for
this same build: when frame generation is active, watch for that
composite draw (both known shader hashes + one triangle + one instance
+ no depth + the presented texture as target), and CopyResource the
target just before the draw executes. The copy is paired with the
presented texture through the submit/present path and fed to
DLSSG.HUDLess (NGX) / Configure.hudless (FSR, which derives its own UI
mask). Two-plane presents are unaffected: the overlay plane already
bypasses generation, and the hudless copy is dropped when planes are
present.

Diagnostics: counters every 10 s plus one-time logs of the first match
and of up to 24 distinct non-composite pipelines that draw into the
presented texture (to identify the composite hashes if they ever
change).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 17:58:00 +00:00
github manually merged commit 8f3ca7874d into main 2026-12-05 19:01:24 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.