mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
With lock_time = 1 the 0.10.0 session showed flip_locked waiting up to 48.61 ms for the queue lock, and the replay's queue_submit up to 8.05 ms. Nothing named who held it: only vk_texture.c's lock records its holders. A swapchain rebuild holds the lock across vkDeviceWaitIdle and the create, and that hold was not timed either. vk_queue_lock, vk_queue_lock_raw and vk_queue_trylock_raw are no longer inlined. Each takes the lock with plat_rmutex_lock_at and its own return address, so the wait report keeps naming the caller (before, the inlined call named a site inside flip_locked). At the outermost take, with lock_time on, the holder's site and the time are noted. vk_queue_unlock passes a hold of 5 ms or more to perf.c perf_qlock_hold. The frame-time summary then prints "queue lock held 5 ms or more" beside the texture lock's holds, by site, as the waits are. create_swapchain logs how long a successful rebuild took: the wait for the lock, the hold, and the part spent waiting for the device to idle. It logs the first 16 rebuilds and each doubling of their count. Diagnostics only: the counters are behind NX2NAVI_LOCK_TIME, which is off by default, plus one capped line per rebuild. Checks that passed: pass_cc_check on every runtime file (host.h changed), no new -Wall -Wextra warnings in gfx_present.c and perf.c, stutter_hitch_check, pgo_build_test, sync_hw_check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
106 KiB
106 KiB