mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 17:29:57 -04:00
The replay asks whether a frame that skips a draw would be held (vk_exec_draw.c, vk_frame_hold_left) on whatever thread holds the submission lock, and with the replay on the submitting thread that need not be the thread that presents. vk_frame_hold_left refilled FH itself (frame_hold_refill), so a refill on a replaying thread beside the one in frame_hold on the presenting thread wrote left_ns and last_ns from two threads: an interval counted twice or not at all, which decides whether a frame with skipped draws is held. Now the reader computes the same arithmetic from the stored fields (fh_left_at) and writes nothing; the limit is read once with a compare-and-swap whose winner logs it; left_ns, last_ns and holding are stored and loaded as atomics. Refilling in two steps or one gives the same allowance, so the single-thread case is unchanged. Not reproduced before the change. Checks that passed: pass_cc_check of vk_backend.c with no new -Wall -Wextra warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 KiB
52 KiB