mirror of
https://github.com/mitch030504/Wiicompiled_VR_Frame.git
synced 2026-10-06 01:00:14 +02:00
When the GPU is two frames behind, begin_frame waits for the next staging buffer's MapAsync. It used to spin on ProcessEvents, holding a whole core busy for as long as the GPU took. It now calls ProcessEvents, checks for device loss, then sleeps on a condition variable until the map callback lands or 1 ms passes. The map state also carries a generation, so a callback from a request that shutdown or a rotation already retired can no longer mark the current buffer mapped or unmapped. From upstream patchzyy/Wiicompiled 6f14bde (#244, KartPad batch). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wg7mB8ogCWmp9GH19Uc82B