Commit Graph

8 Commits

Author SHA1 Message Date
chrg6
b9a042969e Keep the HUD out of frame generation, show the frame generation rate, and start DLSS Frame Generation.
Frame generation now gets the picture without the HUD each frame: the upscaler's output before the HUD is drawn over
it, encoded to sRGB as the game's last pass encodes its picture and put through the same colour, scaling and borders
as the presented frame, so it tells the HUD apart and leaves it unwarped in the generated frames
(NX2NAVI_FG_HUDLESS_SHOW=1 shows that picture, a test). The performance overlay gains an FG row and the fps line the
display's rate, generated frames included. The device enables VK_KHR_get_memory_requirements2 whenever AMD's frame
generation is on, which crashed at start with DLSS upscaling.

DLSS Frame Generation through NVIDIA Streamline (vk_dlssg.c, and nx2navi_dlssg.dll from runtime/dlssg, built with
MSVC by tools/build_dlssg.py against the SDK kept outside the repository) creates the instance and device through
Streamline's proxies and calls its swapchain hooks; Streamline still fails in its plugin start-up here, so the menu
lists it only while it is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:31:07 -05:00
chrg6
7c11ff6816 Add AMD FSR 3.1 frame generation: a generated frame between every two the game draws.
With Frame generation set to AMD FSR 3.1 (after a restart), AMD's frame generation swapchain takes the place of the
present path's own: the device creates two more graphics queues for its presents and image acquires, the present
path acquires, gets images and presents through its replacement functions, and every frame configures generation
and records its preparation from the depth and camera motion vectors the DLSS or FSR 3.1 upscaling pass made (one of
them must be on). Generation pauses while the menu is open. On an RTX 5090 at a 60 fps game, about one frame was
generated for every frame drawn in play.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:31:06 -05:00
chrg6
ca5e5eb5a4 Add AMD FSR 3.1 upscaling, and run DLSS's smaller modes on a 16:9 picture too.
The Upscaling choice gains FSR 3.1 Native AA, Quality, Balanced, Performance and Ultra Performance. FSR 3.1 runs
through AMD's signed amd_fidelityfx_vk.dll (loaded at run time; the build kit ships it) in DLSS's place, on the same
scene light, depth and camera motion vectors and at the same render scales. Its Vulkan back end needs
VK_KHR_get_memory_requirements2, which the device now enables when FSR 3.1 is chosen.

A half-size effect pass with three targets and a half-size depth was taken for a G-buffer, which switched every later
frame to the deferred frame shape: there the output pass of a smaller scene was never found, so DLSS Quality,
Balanced, Performance and Ultra Performance did nothing on a 16:9 picture. Such a pass smaller than the scene is now
left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:31:06 -05:00
chrg6
ee6fbaf0bb Zero shader locals with DLSS and DLAA on too, which removes the speckled floor tiles there.
With DLAA on, function-local variables stayed undefined, and NVIDIA's driver filled the game's clustered-light reads
with other warp lanes' values: floors around Link lit in 4x8-pixel tiles. The setting was also part of every shader
cache key, so shaders prepared with DLSS off missed with it on. Zeroing is now on for every setting; DLSS still finds
the game's FXAA by its zeroed hash and keeps its camera motion. A log line now says when DLSS replaces the game's
scaling draw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:31:06 -05:00
chrg6
43a8096f37 Give DLSS Ocarina's camera, so it keeps its history along the camera's motion.
Ocarina's opaque scene draws bind a 0x3500-byte scene context at c3, and their vertex shaders take the world position
through its rows 0-2 (the view) and then rows 7-10 (the projection: an infinite-far projection whose z row is its w row
less twice the 0.1 near plane). The camera motion pass now uses that block's view-projection, from the block most of
the frame's light-target draws bind, and DLSS keeps its history instead of starting anew every frame. Measured with
NX2NAVI_MV_CHECK while turning: 176 to 227 px of camera motion a frame, a warp error of 0.006 to 0.015 with the vectors
against about 0.025 without.

There is no jitter on Ocarina's frame yet: with it the picture went white within seconds, with or without motion
vectors, while the same frames without it look right.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 10:16:34 -05:00
chrg6
3c0377abf8 Run DLSS on Ocarina's frame, which has no G-buffer and tonemaps straight into its 8-bit output.
Without a scene-size G-buffer the DLSS point arms on the first scene-size light-target pass (B10G11R11 with the D32F
scene depth) and runs at the pass that tonemaps it: into the output when that is larger (DLSS scales and the tonemap
samples its picture), or back into the light target for an sRGB output of the scene size (DLAA). The sizes come from
the frame, since Ocarina's builds have no scene or output patch sets for res_sizes. The deferred engine's shape is
kept as it was.

Ocarina's camera for the motion vectors is not found yet: the c3 view block its light-target draws bind gives a
reprojection that moves a still picture by tens of pixels (NX2NAVI_MV_CHECK), so there is no camera motion and no
jitter there, and DLSS works on each frame alone. dlaa stays off by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 09:26:51 -05:00
chrg6
1b39aabd37 Describe what the code does in comments and docs.
Comments say what the code does and why, docs/maxwell.md keeps the Maxwell facts, and fetch_refs.sh clones only the checkout the build reads. Code is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 05:04:40 -05:00
Valiantsin Dzerakh
0478c13e45 Import the base tree (MIT, see LICENSE) 2026-11-07 05:04:38 -05:00