SMO round: black world, deformed characters, crash fixes¶
Status: in progress. Verified by headless scripted runs (work/g4/smo*), not by hand.
Fixed¶
- Black 3D world (
gfx/src/api_cmd.c,api_device.c,obj.h): SMO records thousands of per-model display lists in small scratch command buffers, finalizes the buffers and even hands their memory to other buffers, then calls the handles every frame. The old graveyard kept only the newest 1024 finalized recordings, so ~65k CallCommands per minute hit freed handles and the world was never drawn. Recordings are host copies, so finalized / memory-reused ones now stay alive until unused for 30 s (last_use) or until their handle is finalized (cap 2^18). Stale handles are now counted and logged;NAPPLE_GFX_CMDTRACE=1traces recording lifetimes. - Occlusion queries (
mtl_replay.m): every counter report wrote 0. SAMPLES_PASSED is now counted with Metal visibility results (segments per pass / report / reset, summed on completion); ReportValue writes its 32-bit value (it wrote a 16-byte zero record). - Deformed Mario / Cappy (
shader/maxwell_translate.c):LDC.64 R12, c[6][R12 + 0x18]loaded the second word at an address made from the first (destination == address register). Skinning matrices were torn in 12 skinned vertex programs. The aliased register is now written last; regression test int_xlate;TRANSLATOR_VERSION4 invalidates cached MSL (also clears a stalepoint_coordfailure). - Crash: invalid texture view (
mtl_tex.m,mtl_replay.m): Metal aborts on views it cannot make (seen in a hand-played SMO session). Views are validated first (levels, slices, type, format reinterpretation) and fall back to the whole texture; texture-by-draw copies outside the texture are refused. - Dirty-page tracker race (round 3 code,
dirty.c): a write let through by a fault could land after another uploader's snapshot and be missed (~1 in 3 stress runs). Re-protecting now bumps the generation aftermprotect, callers stamp after protecting, BUSY reads dirty. - Present sharpen pass struct layout (16 vs 24 bytes); controller applet result is 0xC bytes.
- Studio: PlanView crashed when the plan was cleared mid-render;
napple buildpanicked on EPIPE when Studio cancelled (SIGPIPE now default).
Diagnostics added¶
NAPPLE_DRAWLOG_RT_ALL=1 dumps every colour attachment; draw log prints every bound texture (guest target / Metal type, or why it is
missing), pass dumps print the target address, small 3D textures (grading LUTs) print per-slice means.
Open¶
- Exposure: in-game Cap Kingdom frames are ~6x darker than expected. Checked and correct: G-buffer, light buffers, lighting composite inputs, exposure (fixed 0.6 from a 4x4 white texture), tone map, 8x8x8 grading LUT. The HDR scene itself is dark; may be correct for this dark opening scene: needs a comparison in a bright kingdom.
- Scripted runs stay at the "Look Around" prompt although right-stick input reaches the npad state (
NAPPLE_INPUT_LOG=1). - Animal Crossing (Studio build): NULL global singleton early in nnMain (
main+0x19a6250, called frommain+0x1979b94).