10 Commits

Author SHA1 Message Date
chrg6
a8639f1cb6 Keep the scene and the picture inside the shipped render-target heap when the grown heap table is not served.
The scene's share followed the settings alone. When the grown table could not be built or written (a table in a form
that is not rewritten, as a mod's may be, or a profile folder that cannot be written), the game kept the shipped heap
and the scene still went to the whole picture inside it, which is the crash the growth was made for.

The start now asks for the table before the first present and looks at the answer: without the grown table the scene
is three quarters of the picture at most and the picture stays the game's own 2560x1440, with a log line that says so.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 22:09:37 -05:00
tangerineturtle1
1fb2877f56 Add the -1 texture LOD bias NVIDIA asks for while DLSS or FSR runs with jitter.
The bias on the scene's tiled material textures was log2(render / output) alone, so DLAA got 0 and Quality -0.58. NVIDIA's DLSS guide asks for log2(render / output) - 1 on top of the game's own bias: the jittered frames the upscaler accumulates resolve detail a level finer than one frame shows. The -1 now comes with the jitter (dlaa_jitter, on by default): DLAA gets -1, Quality -1.58, Performance -2, for DLSS and FSR 3.1 and 4 alike, which share the bias. Without jitter it stays as it was, where a sharper level would shimmer. Which samplers take it, and the clamp to the device's limit, are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:09:16 -05:00
Michael Schienbein
ab34c302d0 Make the texture sharpness bias follow a DLSS mode picked while the game runs.
A DLSS or FSR 3.1 mode picked in the menu changes the scene size at once (widescreen.c wide_present), but the texture LOD bias that goes with it stayed the one of the mode the game started with. vk_dlaa.c dlss_mode asks res_dlss_lod_bias again at every mode change, and res_dlss_lod_bias took the share from R.dlss_k, which decide() sets once at start; res_dlss_mode would move it, but returns first while res_init has not switched the output and scene patch sets on, which is always the case for Ocarina's build. Switching from Performance to Quality kept the bias of -1.00 where -0.58 belongs, and switching to DLAA kept a negative bias with the scene at full size. R.dlss_k is also 0 when the game started with DLAA off or without the DLSS model file beside the executable (the driver's NGX supplies the model then), so FSR 3.1 turned on later, or DLSS on such a machine, had no bias in any mode.

Without those patch sets res_dlss_lod_bias now takes the share from widescreen.c's wide_dlss_share, the share the scene is drawn at, which follows the mode and the upscaler in use; builds with the sets keep R.dlss_k, which res_dlss_mode moves where their scene can change. vk_sampler_dlss_bias logs each change of the bias, so a mode change can be followed in the log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 01:55:28 -05:00
chrg6
9b4f461e6f Add a mod's BYML key offsets in size_t, so an offset near 4 GiB no longer passes the bounds check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:09:25 -05:00
chrg6
b62ffac721 Apply the DLSS mode's render scale every frame, so native DLAA and the other modes take effect when picked.
The res_fixed patch sends the game's dynamic-resolution controller down its fixed path, which returns its scale with
state 1 or 2. The caller makes a new scene scale only on state 0, so the menu's mode reached the scene only by chance:
a mode switch in play left the scene at its old size, and a scene reload put it back at full size. The fixed path now
returns state 0, and the page's scale applies every frame. Ocarina also no longer logs that DLSS needs
nvngx_dlss.dll and follows render_scale, which was true only of the builds with a scene patch set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 04:10:34 -05:00
chrg6
501d5bd084 Release pass: fix crashes, freezes and races, cut VRAM use, and translate more shaders.
Crashes: the render-target heap (HeapDef DynamicTextureAllocatorMem and its parent) grows with the widescreen
picture, so the pause menu no longer reads a null block at 5120x2160; texture uploads keep the game's memory mapped
while they copy it, so UnmapPhysicalMemory no longer pulls it away mid-copy; DLSS Frame Generation no longer crashes
in Streamline's set-up (physical devices and the window surface go through its proxies, its swapchain images are
counted first, resources are tagged per frame); a stale core-wait target is cleared before its thread is freed.

Freezes and races: a resize during a swapchain rebuild is kept, a failed frame generation swapchain is retried
instead of replaced by a plain one, three acquire timeouts in a row rebuild the swapchain, device waits take the
queue lock, a translator child that stops answering times out, an in-flight compute pipeline builds at normal
priority, a save Commit started before the window closes finishes and none starts after, a settings change just
before closing is saved, and a movie sample taken before a flush is dropped.

HDR: Enhanced HDR extends the game's own tonemap so highlights go above the picture's white (the hue slider,
which no longer applies, is gone from the menu); frame generation gets a HUD-less picture, the HDR flag and the HDR10
metadata under HDR too.

Memory: ASTC textures are encoded to BC3 unless the PC has 20 GiB of VRAM and 48 GiB of RAM, as Windows charges video
memory to the commit charge (a long session held 17 GiB of RGBA8 textures and 45.7 GiB of commit on a 32 GiB PC).

Shaders: the translator lowers spill-mode programs with more than eight uniform register groups in a wider spill
layout, and local loads and stores with a uniform-register address (36029 of the game's 36031 variants translate,
20 failed before).

The launcher release ships the shader tools and AMD's FidelityFX library (make_launcher.py --ffx); windres there gets
the toolchain on PATH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 16:02:30 -05:00
chrg6
99de7b943f Give each file of copied code one license line.
Each file that contains copied code names its copyright holder and license and points at THIRD_PARTY_NOTICES.md; zlib code keeps its full notice and the mark that it was altered. Comments and probe text only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 05:04:40 -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
chrg6
9a5b1163f3 Make every settings menu row work for Ocarina and give the controls Ocarina's actions and keys.
The Screen tab hides Game resolution when the build has no output and scene patch sets, and the resolution code no
longer grows the memory pool for it. FSR sharpness now also runs when the game image is shrunk to the window, which is
always the case for Ocarina's 2560x1440 picture at 1920x1080, and the overlay drops NX2navi's fixed 3D scene size. A colour
profile set in nx2navi.ini now applies without the menu. The Game tab hides the frame limit in builds without frame-rate
patch sets and lists the game languages the RomFS ships, adding Polish and Brazilian Portuguese. 5.1 sound is reported to
the game's virtual output device. The remap page describes each button as Ocarina's controls screen does, gives each
D-pad direction its own description and drops NX2navi's shake row; the keyboard defaults follow Ocarina (Shift dashes on A,
Ctrl puts away on B, O and N for the ocarina and Navi, middle mouse resets the camera). docs/controls.md is updated.

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