Skip to content

ipc|st/oxr: Refactor wait frame function to avoid setting state before we should

We would leak frame_id and active_wait_frames increment that would cause bad states where we hadn't fully waited but would allow xrBeginFrame to complete. Also improve error handling so that on error conditions the semaphore is properly decremented and the application can call xrWaitFrame again.

This was caused by unreal doing something like this:

  • xrBeginFrame <-- Error
  • xrWaitFrame
  • xrBeginFrame
  • xrEndFrame
  • Called at the same time:
    • xrWaitFrame
    • xrBeginFrame <-- Would get state from non-completed xrWaitFrame

Also add some better debugging to app pacer that was useful in figuring what went wrong.

Edited by Jakob Bornecrantz

Merge request reports