Pre-release: source code only. No IPA and nothing from the game are attached or in the repository. Build your own from your own dump of the game (base game + update v131072) with the steps in the README, using the env file under "Build settings" below.
The Legend of Zelda: Ocarina of Time (Switch 2) as a native iPhone and Mac app, on top of nxnative.
L10.3: about 25 % less CPU work per draw
Everything in L10.1, plus L10.3. Measured on an iPhone 18 Pro (iOS 27.2) in LiveContainer, with profiling builds.
Performance
-
The engine's per-draw caches now work in this game. Ocarina constantly writes a few memory pages that sit beside texture data (an OS lock its worker threads take). Since L8, any such page made two caches throw away their saved results on every draw:
- Each draw's prepared data: none of it was ever reused (0 of 190,000–800,000 per 5 seconds).
- Every texture lookup for textures loaded from game memory, which re-scanned the texture's memory pages each time.
Both caches now react only to real writes. Textures that sit on those constantly written pages are still checked on every use, so nothing goes stale.
Busy play, CPU at full speed L10.1–L10.3 before L10.3 CPU instructions per draw 41,500–47,000 32,000–34,000 Setting up a draw's data about 1.0 µs 0.8–0.9 µs -
Frames hold better when iOS slows the CPU part way (about 2.6–2.9 GHz): 35–39 ms at the 95th percentile. At the lowest clock (about 1.5 GHz) frames still drop: the engine's draw work takes about 21–23 ms a frame there.
-
Saved draw data survives shader program changes and the engine's own new program combinations. The phone measurement showed little gain from the program-change part, because nearly every program change comes with new textures anyway. The combinations part (about 50 a frame) was not measured on the phone before this release.
-
New switch:
DM_NVN_ARGS_KEEP=0goes back to ending the saved draw data at every program change and new combination.
Fixes
- L10.1's Wide View HUD check made most vertex shaders rebuild their draw data at every draw. Only the data large enough to be the HUD's is now rebuilt for shaders that are still being checked. The HUD stays corrected.
Build settings
Unchanged from L10.
DM_UPSCALER=metalfx
DM_FPS_HOLD=off
DM_THERMAL_CAP=0
DM_QOS_MAP=1
DM_QOS_EDGES=45,59
DM_NVN_GPUPROF=every:600
DM_BOOTPROF=1
DM_GUEST_FILE=1
DM_NVN_TEX_MIP_LEVELS=2
DM_FRAMEGEN_SCALE=0.5
DM_NVN_PASS_SPLIT=0
DM_NVN_ANISO_MAX=4
The shaders are the same as L10's: no slow first start when coming from L10 or L10.1.
Status
- Steady 30 fps while the phone runs at full speed, better when iOS slows the CPU part way. When iOS drops the CPU to about 1.5 GHz (after a couple of minutes, sooner on a warm phone), frames still drop. Bigger cuts to the per-draw work are the next target. Start from a cool phone.
- iPhone 15 Pro and 16 / 16 Pro (8 GB) are untested by us.
Credits
- Amiibo and NFC by Tizzle2x.
- seedds and the nxnative contributors for the engine, including Alexander Gurov for the per-draw caches this release makes work in Ocarina, and dpadr for the hot-page tracking it builds on.