Speed up the replay and fix what the perf pass found, and add a frame capture key for chasing rendering faults.

Performance: draws reuse the bindings that did not change and record only the dynamic states that differ from what
the command buffer holds; small uploads come from a staging arena; finished submissions are held briefly and handed to
the queue in batches; the recorder thread can keep a CPU core of its own; ASTC block-linear textures are deswizzled on
the GPU; dynamic resolution steps the upscaler mode to hold a frame-time target. Each has a setting in nx2navi.ini
(bind_reuse, dyn_delta, stg_arena, submit_batch, recorder_core, recorder_prio, astc_gpu_deswizzle, dyn_res) and the
staging cache now frees what it holds at shutdown.

Capture: NX2NAVI_DUMP=key saves the frame after each press of Insert, with mesh draws listed by task, mesh and fragment
shader, depth test and face culling, and mesh_prims.txt giving each mesh draw's primitive, clipping and fragment counts.
All of it is off unless NX2NAVI_DUMP is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-09 01:35:47 -05:00
parent 86de3320a0
commit 1f7e9c975b
38 changed files with 3105 additions and 1840 deletions

View File

@@ -15,6 +15,18 @@ void plat_rmutex_lock(PlatRMutex *m) {
m->depth = 1;
}
int plat_rmutex_trylock(PlatRMutex *m) {
uint32_t me = plat_thread_id();
if (__atomic_load_n(&m->owner, __ATOMIC_RELAXED) == me) {
m->depth++;
return 1;
}
if (!plat_mutex_trylock(&m->m)) return 0;
__atomic_store_n(&m->owner, me, __ATOMIC_RELAXED);
m->depth = 1;
return 1;
}
void plat_rmutex_unlock(PlatRMutex *m) {
if (--m->depth) return;
__atomic_store_n(&m->owner, 0, __ATOMIC_RELAXED);