Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dm/games/0400486024DEC000/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ A Switch 2 game: update v131072, SDK 22.2.8 (`Ounce`). Nintendo EPD's engine (se
| `sys_resource 0x3000000` | `game.tsv` | 48 MB, as the NPDM declares |
| Dynamic-resolution stub | [`patches.py`](patches.py) (frame step rule, `others`) | full resolution unless the launcher's Dynamic resolution is on ([Dynamic resolution](#dynamic-resolution)) |
| `draw_barriers game` | `game.tsv` | about 180 full barriers a frame NVN does not ask for: GPU 25 → 18 ms at full resolution. From 7f50222 until the fix in [Draw passes that wait for each other again while images share memory](../../../docs/reference/frame-rate.md#draw-passes-that-wait-for-each-other-again-while-images-share-memory) it had no effect, since the dynamic resolution's family heaps turned it off; with the fix, M1 Max gameplay GPU 22.2 → 20.3 ms; no change on an M2 Air or an M4 Pro |
| `enc_thread on` | `game.tsv` | the game parks each frame's submissions behind an event its CPU signals when the frame before has left the GPU, so the GPU starts every frame dry and waits for the replay; with encoding on its own thread 56.5–56.9 against 55.3–55.8 fps in a GPU-bound scene ([Frame rate](#frame-rate)). |
| `replay_ahead on` | `game.tsv` | the same event: the parked frame is translated before the signal and its commits held until it, so the GPU starts the frame with work queued (Kakariko Village 55.5-57.1 → 59.6-59.8 fps) |
| `tex_flush_upload on`, `tex_dirty_upload on` | `game.tsv` | as Tears of the Kingdom: the CPU writes the terrain tiles' height (R32F), blend and hole (RGBA8) maps into textures after creating them. Without the keys those textures stay zero: flat blue holes in the ground around the path with grass floating in them, and grey stone where the console shows dirt |
| `shader_groups`, `shader_note` | `game.tsv` | shaders grouped as `/Shader/`, `/Effect/`, `/Lib/`, `/UI/` |
| `pad_layout full` | `game.tsv` | a 3D field and both sticks |
Expand All @@ -32,6 +34,9 @@ One [NUP container](../../../docs/development.md#the-packing-script-in-detail) o
Measured on an M6 Mac with 16 GB, headless, on one walk with camera turns (`walk.sh` in the work folder).

- Current on an M5 Pro MacBook Pro (16-inch, 20-core GPU, 24 GB, macOS 27.2, 2026-11-09), `kokiri-deck` from a deck autosave with the full library of chain `dedc9391c30b`, at full resolution (Dynamic resolution off), two runs a variant: in a window a locked 60 fps (59.8–60.0, frame p99 16.8–19.4 ms, GPU p50 10.2 ms). In fullscreen on its ProMotion screen it held 40 fps (39.6–40.1) at the same GPU time, with every present a 120 Hz refresh late and every other link tick skipped: [The 60 Hz link at 40 fps in fullscreen on a ProMotion screen](../../../docs/reference/frame-rate.md#the-60-hz-link-at-40-fps-in-fullscreen-on-a-promotion-screen). With the 120 Hz link there, 58.8–59.6 fps, frame p99 25.3 ms; with the screen held at its fixed 60 Hz mode, 60.0 fps, frame p99 16.9 ms, which fullscreen now switches to. MetalFX present upscaling to the 3456-wide fullscreen cost no measurable GPU time (59.4–59.7 fps). Resident about 10 GB, GPU allocated 11.2–11.4 GB; the prepare step took 7.3 s on a first start.
- Current on an M4 Pro (20-core GPU, 24 GB, macOS 27.2, 2026-11-10, chain `cb2e91c138e3`, full resolution, `DM_FPS_HOLD=off`), headless from a save on the castle town drawbridge looking over Hyrule Field (about 2,720 draws a frame): the game's own GPU time is 14.5–15.0 ms a frame, and it ran at 52.2–53.4 fps, not 60; 56.5–56.9 fps since the two changes below.
- GPU idle at each frame's start. The game submits the whole next frame, about 23 submissions on several queues, some 8 ms before the current frame's GPU work ends; queue 1's first piece waits for an event the CPU signals 0.2 ms after the frame's fence. The replay thread sits idle those 8 ms and translates only from the signal on, the whole frame in about 6 ms, while the GPU's first 5 ms of light passes wait for it. Per frame the game had no command buffer on the GPU for 2.03–2.19 ms, nearly all of it before a buffer committed after the GPU ran dry. Measured steps, headless, three runs a side unless said: `enc_thread on` 2.1 → 1.3–1.6 ms; [texture views by Metal texture](../../../docs/reference/frame-rate.md#texture-views-made-again-every-frame-for-render-targets-on-new-texture-objects) 1.4–1.8 → 1.16–1.20 ms (two runs), the replay's CPU 7.1–7.9 → 6.1–6.3 ms a frame. Frame rate in the same scene: 52.2–53.4 fps before both, 55.3–55.8 with the view cache, 56.5–56.9 with both. Disproved: smaller segments (`DM_NVN_CUT=16` / `8`) move the wait and leave its total (1.84–1.91 ms; 1.30–1.39 with the encode thread); the replay thread not waiting for the encode thread at each submission's end changed nothing once the views were cached (1.24–1.25 against 1.16–1.20 ms). Not tried: translating the parked submissions before the signal. The wait is there so that the frame before has landed (its occlusion results, which the replay reads, and the lighting buffer the CPU clears), so a replay ahead of it would read stale memory. Open: 1.2 ms of idle a frame, the replay's remaining cost (pool tables 0.5 ms a frame in `pool_gpu`'s copies, argument encoding, mesh task draws).
- Current: `replay_ahead` translates the parked frame before the signal and holds its commits until it ([The GPU waits at a frame's start for commands the game queued long before](../../../docs/reference/frame-rate.md#the-gpu-waits-at-a-frames-start-for-commands-the-game-queued-long-before)). Kakariko Village, a GPU-bound scene of about 2,940 draws (2026-11-11, headless from a save in the village, `DM_FPS_HOLD=off`, runs in turn against `DM_NVN_REPLAY_AHEAD=0`): 59.6-59.8 fps against 55.5-57.1 (five and four runs; one more a side fell out with long frames), frame p50 16.5-16.6 against 17.2-17.7 ms, the same GPU work (15.3-15.5 ms a frame); 48.0-53.7 against 41.8-46.1 fps with a terminal and WindowServer drawing 150-290 ms/s. Passing the event's wait outright, so that the next frame is also committed before the signal, removed the same idle (2.31 → 0.25 ms a frame) but lets the GPU run commands the game holds back, and was not kept. Open: not judged by eye in a window, nor on the 120 Hz link.
- Current: the title and menu, a movie behind them, are a locked 60 fps (p50 16.67 ms, GPU span 15.6 ms).
- Resolved: the title movie and the cutscene movies stuttered in small regular jerks at that steady 60 fps on a Mac that decodes AV1 with dav1d (M1, M2). The frames were on time and the movie's pictures were not: the player's `advance` (`main+0x3b61ea0`) found no new picture in 546 and 569 of about 2,900 frames of the title on an M2 Pro, and showed the last one again. Two causes, both general: [packets decoded inside the submission](../../../docs/reference/movies.md#nncodec-packets-decoded-inside-the-submission), on the player's one reader thread, which also gives the shown pictures back, and [dav1d one frame at a time](../../../docs/reference/movies.md#dav1d-decoded-one-frame-at-a-time) (15.4 ms a packet in the movie's heaviest five seconds, 122 ms the longest). After: 0 or 1 in 2,567 to 3,036 frames a run (eight runs of 54 s, headless, `DM_PROBE=main:3b61ed8,main:3b61f80` counting the failed and the good calls), and `DecodeAsync` returns in 0.1 ms at the median and 1.1 ms at the 99th percentile, from 1.9 and 120 ms. Open: not run on an M1 or M2 with four performance cores, nor on an iPad; a Mac with a hardware AV1 decoder (M3 on) decodes with VideoToolbox, where only the first cause applied, not measured.
- Game speed: the game steps its time by a frame ratio, its base rate (60, or 30) / its int frame rate, whatever the frame took (`main+0x6e6cc4` on v131072), so frames longer than a vsync played in slow motion (seen by the user on a slower Mac; [issue 1375](https://github.com/seedds/nxnative/issues/1375)'s M1 Max ran the title at about 28 fps). With `fps_target 60` the ratio is the host's frame step × base / 60 ([A fixed frame step plays in slow motion on a slow Mac](../../../docs/reference/frame-rate.md#a-fixed-frame-step-plays-in-slow-motion-on-a-slow-mac)), a stub placed by its function's fingerprint ([`patches.py`](patches.py)). Mac runs on the M6 (2026-11-08, a test host on the libraries of chain `3ee493b2c3a4`): the user's play sessions held 60 fps with 2- and 3-vsync holds while areas loaded, game time 1.000 of real time by the host's count. That count is the stub's own; no run on a Mac slow enough to show the slow motion before and after.
Expand Down Expand Up @@ -138,6 +143,7 @@ Its 37 kernels that correct samples, NDSR's network among them, gave about 0.25
- [The blend helper's output reference on iOS](../../../docs/reference/shaders.md#the-blend-helpers-output-reference-on-ios): resolved, 22,296 of 42,848 Mac shaders failed to compile on macOS 26 ([GitHub issue #2272](https://github.com/seedds/nxnative/issues/2272)); the Mac compile now names the host's minimum macOS.
- [A NaN colour under a zero blend weight](../../../docs/reference/shaders.md#a-nan-colour-under-a-zero-blend-weight): resolved, white clouds over the ground mist between Kokiri Forest and Hyrule Field and over the ferns at the camera in Kokiri Forest ([issue #1839](https://github.com/seedds/nxnative/issues/1839)). The mist shader `5ad65c0eefd09c7f` writes NaN at alpha 0 where its layer has density 0; NVIDIA's blender, with the option NVN's driver sets, adds nothing there, Apple's stored the NaN.
- [A first start builds every base of the prewarm list before the first frame](../../../docs/reference/rendering.md#a-first-start-builds-every-base-of-the-prewarm-list-before-the-first-frame): the 450-475 s first-start prepare on an M5 Max; the Mac app now bundles the list's pipelines (`--prebake`, on by default) and it took 4.3 s.
- [Texture views made again every frame for render targets on new texture objects](../../../docs/reference/frame-rate.md#texture-views-made-again-every-frame-for-render-targets-on-new-texture-objects): 77 Metal texture views a frame of 39 textures that stayed, 0.9 ms of the replay thread at each frame's start, where the GPU waits for it; 52.2–53.4 → 55.3–55.8 fps in a GPU-bound Hyrule Field scene.
- [The 60 Hz link at 40 fps in fullscreen on a ProMotion screen](../../../docs/reference/frame-rate.md#the-60-hz-link-at-40-fps-in-fullscreen-on-a-promotion-screen): 40 fps in fullscreen on an M5 Pro MacBook Pro with the GPU at 10 ms of the 16.7, every present one 120 Hz refresh late and every other display-link tick skipped; the screen's fixed 60 Hz mode held 60.0 fps there and fullscreen now switches to it, with the 120 Hz link (59 fps) for screens with no such mode.
- [The shader package and the shader map come from different splits](../../../docs/reference/packing.md#the-shader-package-and-the-shader-map-come-from-different-splits): resolved, a black screen with sound in a build through NX2Apple ([issue #1841](https://github.com/seedds/nxnative/issues/1841)); the present pass was translated from a terrain shader's record. Records now carry their keys, and the shader build finds them by key.
- [Native mesh pipelines compiled at their first draw](../../../docs/reference/shaders.md#native-mesh-pipelines-compiled-at-their-first-draw): resolved. The foliage, shadows and enemies drawn with task and mesh shaders stalled at their first draw on a cold Metal cache (59.5 s of builds at the Kokiri Forest entry on an M5 Max, one frame of 42.9 s), as nothing recorded or kept their pipelines; `pso_manifest.tsv` now carries 164 `M` rows (Kokiri Forest, Hyrule Field, Castle Town, Hyrule Castle, and 41 from later play, Death Mountain Trail among it), and with the prepare step they are built before the first frame. Pipelines outside the list still stall once, then go into `pso_user.tsv`. With the first 123 alone, a cold first start (empty Metal cache and pipeline archive, M4 Pro) on a Death Mountain Trail save built 9 and 10 at their first draw in two runs, 2.7 and 4.2 s, frames of 1,775 and 1,657 ms; with all 164, none, worst frame 25.6 and 18.5 ms, the prepare step 29.6 and 29.3 s → 32.1 and 31.0 s.
Expand Down Expand Up @@ -223,6 +229,7 @@ Its 37 kernels that correct samples, NDSR's network among them, gave about 0.25
- [Finalizing a copy of a texture object](../../../docs/reference/nvn-objects.md#finalizing-a-copy-of-a-texture-object)
- [Dynamic resolution that never moves, and draw passes that wait for each other](../../../docs/reference/frame-rate.md#dynamic-resolution-that-never-moves-and-draw-passes-that-wait-for-each-other)
- [Dynamic resolution at its floor while the GPU has time to spare](../../../docs/reference/frame-rate.md#dynamic-resolution-at-its-floor-while-the-gpu-has-time-to-spare): a stale frame-start timestamp, and event waits that idled the GPU
- [The GPU waits at a frame's start for commands the game queued long before](../../../docs/reference/frame-rate.md#the-gpu-waits-at-a-frames-start-for-commands-the-game-queued-long-before): the frame's 23 submissions parked behind the event its CPU signals after the frame before, translated only from the signal on; `replay_ahead` translates them ahead and holds their commits (Kakariko Village 55.5-57.1 → 59.6-59.8 fps).
- [A full table of running GPU writes ends passes for nothing](../../../docs/reference/frame-rate.md#a-full-table-of-running-gpu-writes-ends-passes-for-nothing)
- [Float atomics in storage memory](../../../docs/reference/shaders.md#float-atomics-in-storage-memory)
- [textureGatherOffsets and a loop over its offsets](../../../docs/reference/shaders.md#texturegatheroffsets-and-a-loop-over-its-offsets)
Expand Down
6 changes: 6 additions & 0 deletions dm/games/0400486024DEC000/game.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ draw_barriers game
# As Tears of the Kingdom: the terrain's height, blend and hole maps are written by the CPU into textures after they are created. Without these keys they stay zero: holes in the ground and the wrong materials
tex_flush_upload on
tex_dirty_upload on
# The game submits a frame's commands behind an event its CPU signals once the frame before has left the GPU, so the GPU starts each frame with nothing queued and waits for the
# replay: with Metal encoding on its own thread a GPU-bound Hyrule Field scene went 55.3-55.8 -> 56.5-56.9 fps (Apple M4 Pro, three runs a side, interleaved)
enc_thread on
# The same event again: with the encode thread the replay still began translating at the signal. Translating the parked queue before it, its commits held until the signal, in
# Kakariko Village (headless, DM_FPS_HOLD=off, Apple M4 Pro, 2026-11-11): 55.5-57.1 -> 59.6-59.8 fps, frame p50 17.2-17.7 -> 16.5-16.6 ms, the GPU work and the draws the same
replay_ahead on
1 change: 1 addition & 0 deletions dm/games/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ One row per profile; the notes are each profile's `README.md`.
| `tex_dirty_upload` | `on` / `off` (the default), needs `tex_flush_upload`: a registered texture whose pages the CPU writes after `nvnTextureInitialize` without any NVN flush is uploaded as well (its pages are write-protected at registration, checked on first use; `nvn_ft_written` in `hle_nvn.c`). Tears of the Kingdom fills its ASTC terrain material arrays this way; without it the cave is magenta. FINAL FANTASY TACTICS - The Ivalice Chronicles loads its UI textures straight into CPU-uncached pools, which need no flush, after creating them; without both keys its screen stays black. The Great Ace Attorney Chronicles copies every texture into a CPU-cached pool after creating it and never flushes (its `main` has no cache maintenance at all): black too. The Legend of Zelda: Ocarina of Time writes its terrain tiles' height, blend and hole maps this way, and without the keys has holes in the ground |
| `tex_dyn_slots` | `on` / `off` (the default): a shader whose buffer-texture handle the translator could not trace to one slot gets Ryujinx's fallback arrays (`<stage>_<tb|s>_cb0_40000000`: 32 buffer textures and samplers indexed by the handle's texture / sampler ID; any other sampled texture indexes the whole pool without a key, [Texture handles from game memory index the pools](../../docs/reference/shaders.md#texture-handles-from-game-memory-index-the-pools)). With the key the replay puts slot indices in that shader's c2 texture and sampler tables (texture slot r → r, sampler slot r → r << 20) and binds slot k at element k, so the shader's own arithmetic picks the binding (`NVN_RB_TEXD` / `NVN_RB_SAMPD` in `nvn_mtl.m`). Right only where the handle comes from c2's tables: Octopath Traveler 0's 61 such vertex shaders read separate texture slots 0-10 and samplers 0-4 there and nothing else (FINAL FANTASY RESONANCE's 2,077 the texture table words 0x168-0x1c0 and sampler table words 0x568-0x590). Off, such shaders do not load. Not part of the shader chain version |
| `draw_barriers` | `full` (the default) / `game`: how draw passes are ordered. `full`: each waits for all earlier GPU work. `game`: by the game's own barriers (NVN asks for one before results of rendering are read), so a pass's vertex work overlaps the previous pass's fragments. Ocarina of Time's GPU time 25 → 18 ms, about 180 full barriers a frame halved. Only a barrier that orders primitives or indirect data waits for all earlier work; a fragment-only one keeps the overlap. Only vertex-stage reads of the previous pass's output without a barrier change order. `DM_NVN_BARRIER` overrides it |
| `replay_ahead` | `off` (the default) / `on`: a queue parked on an event the game's CPU signals is translated before the signal, its commits held until then; needs `enc_thread` ([The GPU waits at a frame's start for commands the game queued long before](../../docs/reference/frame-rate.md#the-gpu-waits-at-a-frames-start-for-commands-the-game-queued-long-before); `DM_NVN_REPLAY_AHEAD` overrides) |
| `vconv_range` | `on` / `off` (the default): vertex attributes the replay converts on the CPU (integer shader inputs fed float-type formats and the like, `vconv_bind` in `nvn_mtl.m`) are converted only over the vertices each draw reads (first / count, or the smallest and largest index of a direct indexed draw, kept while the index pages stay unwritten) instead of the whole bound range. Age of Calamity binds whole mesh pools: in a battle that was millions of vertices a frame. Indirect draws, per-instance streams and indices with a GPU write queued on them keep the whole range. `DM_NVN_VCONV_CHECK=1` scans the indices again at every reuse and reports differences; `DM_NVN_VCONV_RANGE=0` / `1` overrides it |
| `shader_key_skip` | `<offset>+<length>` (none by default): control-section bytes every shader key hashes as zeros, in `shader_split.py` (`key_ctl`) and the host (`hle_nvn.c` `keys_hash`), for an engine that shares one control section among shaders that differ only there. Batman: Arkham Knight: `0x770+0x78`, GLSLC's compile information (+0x778..+0x791 and +0x7d0..+0x7e7); without it the game asks for shaders the map does not have, each the control section of one record with the code area of another. It must stay clear of `+0x700..+0x75f`, which the tools read; it is a shader chain input, as every `shader_*` key |
| `shader_groups`, `shader_note` | `shader_split.py` source groups and the map header note (Engage: `engine` for `data.unity3d` and `Resources/`, `assets` for the Addressables bundles). Both are shader inputs, the note too: changing either one, even by a word, builds every shader of the game again. Keep them as they are when a provisional profile moves into `dm/games` |
Expand Down
Loading
Loading