Skip to content

Add a render-scale ceiling for Ocarina v131072 - #1497

Open
givethesourceplox wants to merge 1 commit into
seedds:mainfrom
givethesourceplox:feat/oot-render-scale
Open

givethesourceplox wants to merge 1 commit into
seedds:mainfrom
givethesourceplox:feat/oot-render-scale

Conversation

@givethesourceplox

Copy link
Copy Markdown
Contributor

Ocarina v131072 now honors the existing host render-scale setting as a ceiling on the scale chosen by the game. For example, a 50% ceiling caps a game-selected 75% scale at 50%, while allowing the game's dynamic resolution to drop below that ceiling. The default 100% setting preserves the game's selected scale.

The game profile checks build ID e0f3ccfaf50065ae4ea01eb5aeb13b1a and the original instruction at main+0x31d3f48 before patching the final scale store. The stub preserves all integer and SIMD registers, the stack pointer, and condition flags. It uses the existing host state and advertises RENDER_SCALE so the current launcher control becomes available. Frame timing and the shader translation path are unchanged; no shader rebuild is needed.

Validation:

  • Render-scale tests: 2 passed, including ARM64 execution across 160 combinations of caps, game scales, and flags, with register and memory guards checked.
  • Rewrote the actual v131072 main successfully and executed its patched site in ARM64 emulation at 50% and 100% ceilings.
  • Patch, docs, settings, and environment-switch suites: 31 tests passed.
  • Python lint against main: zero new findings. Diff whitespace checks passed.

An earlier version of the cap was exercised on an M1 Pro through the house-to-forest route. This isolated implementation was verified with the actual rewritten image and ARM64 execution; sustained performance gains, later areas, and iOS remain unmeasured.

@github-actions github-actions Bot added rewriter The NSO rewriter and per-build patches tools Tools and scripts (dm/tools, scripts) docs Documentation game: 0400486024DEC000 A game labels Nov 6, 2026
john62036203-ops added a commit to john62036203-ops/NXNativeWindows that referenced this pull request Nov 6, 2026
… DM_RENDER_SCALE)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013SzykpcKm2eZPvPjGPKx1C
javierdv7 pushed a commit to javierdv7/nxnative that referenced this pull request Nov 6, 2026
…and turns its dynamic resolution off, at the final scale store upstream PR seedds#1497 found (0.99 renders 1920x1080 on the Mac's 1080p output, GPU 42-52 ms at the Kokiri Forest on an M4)
Aznracer pushed a commit to Aznracer/Mighty-Green-Kokiri-Kid that referenced this pull request Nov 7, 2026
…namic frame step, DM_NDSR=game, present bilinear
thomasruegsegger pushed a commit to thomasruegsegger/nxnative that referenced this pull request Nov 7, 2026
…tep (upstream PRs seedds#1497 and seedds#1543)

Both stubs are FRAME_STEP of main e0f3ccfaf50065ae4ea01eb5aeb13b1a, so the build's function runs both: real_speed at main+0x6e6cc4 (frame step from the measured frame time) and render_scale at main+0x31d3f48 (DM_RENDER_SCALE caps the game's dynamic-resolution scale). test_oot_real_speed checks the build takes both sites and marks the render-scale capability; game-patches.md regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Aax1HnchwCweUDRNWjhHx9
thomasruegsegger pushed a commit to thomasruegsegger/nxnative that referenced this pull request Nov 7, 2026
…tep (upstream PRs seedds#1497 and seedds#1543)

Both stubs are FRAME_STEP of main e0f3ccfaf50065ae4ea01eb5aeb13b1a, so the build's function runs both: real_speed at main+0x6e6cc4 (frame step from the measured frame time) and render_scale at main+0x31d3f48 (DM_RENDER_SCALE caps the game's dynamic-resolution scale). test_oot_real_speed checks the build takes both sites and marks the render-scale capability; game-patches.md regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Aax1HnchwCweUDRNWjhHx9
(cherry picked from commit 1e0258b)
thomasruegsegger pushed a commit to thomasruegsegger/nxnative that referenced this pull request Nov 8, 2026
…mmits on top of main, without the real-speed and render-scale frame steps (seedds#1543, seedds#1497), which main's own frame step (7d8dcdf) and dynamic-resolution switch (04419bc) replace (this merge keeps the earlier branch history reachable, so the push needs no force)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Aax1HnchwCweUDRNWjhHx9
cfryerdev pushed a commit to cfryerdev/nxnative that referenced this pull request Nov 8, 2026
@FifteenPen

Copy link
Copy Markdown
Contributor

On v131072 the scale store at main+0x31d3f48 runs only in a frame where the dynamic-resolution update answers status 0, a new scale. Its caller tests the status byte at main+0x31d3ee4 (ubfx x8,x0,#32,#8). Status 0 sets bit 3 of [x20+0xe2c], and the store is skipped while that bit is clear (tbz w8,#3 at main+0x31d3f30).

At a steady frame rate the update never answers 0, and on current main the level stub (7de11da) holds the top level by default. So a stub at the store alone changes nothing until the game comes under load. That is what we saw with the same single-site approach before adding a second stub.

#1903 adds that second stub at the status test (once, until the host scale has been applied). It is placed by the view-size update's fingerprint rather than the build ID. It takes the setting as a fraction of the game's own size, as Breath of the Wild and Tears of the Kingdom do, rather than a ceiling. The numbers are in its description. If the ceiling semantics are wanted instead, the status stub is what makes either one apply.

Fasen24-AI added a commit to Fasen24-AI/swordboiMacNative that referenced this pull request Nov 10, 2026
Upstream pull requests applied in this commit (their authors' work, brought onto this tree with a three-way merge; the description is in each PR):
- seedds#1497 by givethesourceplox (open): Add a render-scale ceiling for Ocarina v131072
Fasen24-AI added a commit to Fasen24-AI/swordboiMacNative that referenced this pull request Nov 10, 2026
…nds once to half), seedds#1909 (fragment uniform reads bound to the binding length), seedds#1901 (dispatch_overlap on for Ocarina), seedds#1459 (MetalFX takes agl_ndsr_vr, no-curve variants linear), seedds#1903 (render scale stubs for Ocarina; replaces the seedds#1497 ceiling we carried)

Hand-resolved: the mesh draw keeps the task isolation of seedds#1842 and the copy paths our nvn_tex_level_range / DM_SHARPEN; seedds#1497's stub, test and BINDING entry go; the build-keyed rule names the render scale function (main+0x31d3200). Chain e906c7467690.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014eD437mxrMnW2UwLZhpwc7

Upstream pull requests applied in this commit (their authors' work, brought onto this tree with a three-way merge; the description is in each PR):
- seedds#1459 by PromethOps (open): DM_UPSCALER=metalfx takes agl's agl_ndsr_vr.pck networks too, and a variant with no curve and no power is drawn as one colour space: Ocarina of Time's upscaler is MetalFX's
- seedds#1497 by givethesourceplox (open): Add a render-scale ceiling for Ocarina v131072
- seedds#1842 by ycarogabriel-lgtm (open): Ocarina of Time: opt-in task isolation (DM_NVN_ISOLATE_TASK), the Hi-Z task a5288 in command buffers of its own, a workaround for its GPU hangs on an M1
- seedds#1897 by Know-It-All-Brother (closed): HMMA with an f16 accumulator rounds once per 8 products, as Ampere does (chain change)
- seedds#1901 by FifteenPen (open): The game's compute dispatches with no game barrier between them run side by side (profile key dispatch_overlap, on for Ocarina of Time): Kokiri Forest GPU p50 15.63 → 14.76 ms
- seedds#1902 by fxd0h (open): HFMA2 rounds once to half, as Ampere does (chain change)
- seedds#1903 by FifteenPen (open): Ocarina of Time takes the launcher's Render scale: the 3D views at that fraction of the game's own size, the dynamic resolution held at its top level (Kokiri Forest docked at 0.75: GPU p50 15.77 → 14.31 ms, 60 fps held)
- seedds#1909 by oz-rinkliff (open): Bound translated fragment uniform reads to the NVN binding length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation game: 0400486024DEC000 A game rewriter The NSO rewriter and per-build patches tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants