Repository navigation
Conversation
…with a settings panel switch (after nxnative) Mid-submission commits (chunk_maybe_split) happen only between render passes, so a long pass reaches the GPU in one piece when it ends. Breath of the Wild 1.9.0 draws about 2,700 of its 4,100 draws a frame into one G-buffer pass (several same-target SetRenderTargets continued into one Metal pass), and the GPU, done with the shadow passes, waits for it to be translated. seedds/nxnative fixed this with pass_split_try (its PR ly05010419#1468); this is the same rule on this repository's chunks. At a draw, with nothing committed still on the GPU (g_q4_inflight) and TOTK_PASS_SPLIT draws (default 256, 0 off) since the last commit, draw_inner ends the pass, commits the chunk as chunk_maybe_split does, and the draw opens the pass again. Attachments are always stored and a reopened pass loads them, as after a compute dispatch inside a pass: TAA keeps its jitter for the reopened G-buffer pass, MetalFX does not take its depth again, and a counting occlusion query counts into a new slot that its report adds up (vis_count_begin, g_pass.serial). At most TOTK_PASS_SPLIT_MAX (default 2) splits per NVN pass. Not split: passes opened without all their attachments, ranged, layered or cube-merged passes, hoisted or pending clears, the TBDR rewrites and geometry draws. The settings panel's display page has a switch for it (pass-split.txt above the game's folder, like the GPU keep-alive; TOTK_PASS_SPLIT decides first and greys it out), and "flag pass_split <draws>" (TOTK_INPUT_FILE) sets it while the game runs. The chunk line of the log counts the splits per frame, and a second line counts the draws that could have been split, by command buffers still in flight and by passes that may not be. Measured on BotW 1.9.0 (M4 Max, Kakariko, uncapped, flag alternated every 25 s): about 2-3 splits a frame; with the split the GPU stayed at 641 MHz and frames at 10.9 ms p50, without it the clock fell to 344-380 MHz and frames to 14-19 ms, in both pairs. No visual difference was seen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for porting this and for the paired runs; the GPU clock going from ~350 to ~640 MHz on BotW 1.9.0 is a real finding. Before we merge, two things:
|
settings_panel.h is now a link to shared/runtime/settings_panel.h upstream, so the switch's row moves to games/totk/runtime/settings_game.h, beside the GPU keep-alive's.
… 1.9.0 on the Mac, where it was measured Review of PR ly05010419#2191: the gain was measured on BotW 1.9.0 on an M4 Max only. PASS_SPLIT_DEFAULT (nvn_mtl.m) is now 256 draws there (GAME_BOTW190 on the Mac) and 0 elsewhere: Tears of the Kingdom, Breath of the Wild 1.6.0, Ocarina of Time, the Switch 2 games and iPhone / iPad start with it off. The settings panel's switch (pass-split.txt) and TOTK_PASS_SPLIT still turn it on everywhere, at PASS_SPLIT_DRAWS (256) draws. tools/gfx_matrix.py: every configuration, Mac and iOS, compiles with the same warnings as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review. Two commits are pushed:
Points 2 and 3 need the game running, so they will come in a later comment on BotW 1.9.0 (M4 Max):
|
|
Point 2: pictures, split vs not split. Short version: no visible change. Split and not split differ no more than two unsplit frames taken a second apart, and the frame has no multisample attachment or resolve for a split to cut. Details below. BotW 1.9.0 + DLC, M4 Max, Kakariko, standing still, 60+60, 1920×1080 render. Everything comes from one session:
Not split / split (the first off → on pair): Difference ×8, null control (off/off) / split vs not split (off/on): Both kinds of pairs differ in the same places: grass, leaves, banners, the fire, the NPCs and edge shimmer. The largest off/on pair (5.90) differs by edge outlines across the whole frame, a sub-pixel shift, not in one region and not by a missing object. I see no difference between split and not split. The splits did happen: the first one came at frame 9693, right after the first switch on, and the log counts 4.2–4.6 splits a frame while the split stayed on. No errors in the log. Resolves, and how the exclusions cover them
Point 3 (GPU clock and frame time with neither, the split alone, the keep-alive alone, and both) will follow in its own comment. |
|
Point 3: the split and the GPU keep-alive, alone and together BotW 1.9.0 + DLC, M4 Max, on AC power, Kakariko, standing still, 60+60 (the game capped at 60 fps), 1080p render. Each of the three phases was about 2 minutes: keep-alive off, then on, then off again (A-B-A, so a slow clock drift doesn't count against one setting). Within each phase
The split ran whenever it was on: 3.2–4.6 splits a frame with the keep-alive off, 5.6 with it on.
So the two address the same clock drop. With the keep-alive on, the split is redundant. Uncapped with the keep-alive off, the split kept the clock up (PR description). At a 60 fps cap it gave nothing here and used a little more power. I haven't re-measured uncapped with the keep-alive on. One caveat on that last point: an M4 Max has a lot of GPU headroom at 60 fps (about 6.4 ms of GPU work in a 16.7 ms frame), so a lower clock still fits the frame and the cap hides what the split is for. On a Mac with less GPU headroom (a base or Pro chip), the same frame takes a larger share of the 16.7 ms, which is closer to the uncapped case where the split helped. The split only fires while nothing is on the GPU ( |
|
Thank you for the careful pictures and the powermetrics runs. They answer both questions: the split does not change the picture, and at the 60 fps cap it gains no frame time and uses about 2 W more; with the GPU keep-alive on it adds nothing measurable, because both address the same clock drop. The keep-alive is on by default on the Mac, so we will not merge the split for now. If you measure a gain on a base or Pro chip with the keep-alive on (uncapped and at the 60 cap), please post it here and we will look again. |
|
Results on an M4 Pro (16-core GPU), the base/Pro data point asked for above BotW 1.9.0 + DLC, macOS 27.2.1, on AC power, Kakariko at night by the campfire, standing still, 2560×1440 render. This PR was merged onto current Uncapped and 60+60 interpolation (keep-alive off, 6 + 4 pairs)
The uncapped medians differ only because the scene went from ~97 to ~116 fps during the third pair, with the split on and off alike. The pairs themselves match: 97.6 / 96.4, 96.4 / 96.9, 115.8 / 115.9, 112.5 / 112.8. Once the scene got faster, the split fired 0.01–0.1 times a frame, because a command buffer was always in flight. A first uncapped / 60+60 run with the keep-alive on gave the same frame rates (no power data for that run). 60 fps frame lock, no interpolation (5 pairs each)
Summary for this Mac and scene
Not tested: other scenes, battery power, base M-series chips. |




What
Mid-submission commits (
chunk_maybe_split) happen only between render passes, so a long pass reaches the GPU in one piece when it ends. Breath of the Wild 1.9.0 draws about 2,700 of its 4,100 draws a frame into one G-buffer pass: several same-targetSetRenderTargets, continued into one Metal pass. The GPU, done with the shadow passes, waits for that pass to be translated.seedds/nxnative fixed this with
pass_split_try(their PR #1468). This PR applies the same rule to this repository's chunks:g_q4_inflight) andTOTK_PASS_SPLITdraws since the last commit (default 256,0off).draw_innerends the pass, commits the chunk aschunk_maybe_splitdoes, and the draw opens the pass again.vis_count_begin,g_pass.serial).TOTK_PASS_SPLIT_MAXsplits per NVN pass (default 2).Controls and diagnostics:
pass-split.txtlike the GPU keep-alive.TOTK_PASS_SPLITdecides first and greys the switch out.flag pass_split <draws>throughTOTK_INPUT_FILE.Measured
BotW 1.9.0 + DLC, M4 Max, macOS 27.2, Kakariko, standing still, uncapped. The flag alternated every 25 s with
powermetricsrunning. There were about 2–3 splits per frame.The GPU clock followed the flag in both pairs. Feeding the GPU earlier appears to keep macOS from lowering its clock. With Game Mode on, this Mac otherwise falls to 338–380 MHz after about two minutes in fullscreen. It is only two pairs. Power rises with the higher frame rate, which is why the split has a switch.
No visual difference was seen in game.
Tests
tests.test_settings_panel(with updated row counts and stubs for the switch),tests.test_frame_lock,tests.test_shot_shareandtests.test_text_keyboard.nvn_mtl.mfor BotW 1.9.0, TotK 1.4.3 and Ocarina of Time.Not tested
🤖 Generated with Claude Code