No way to transition out of SYNCHRONIZED state from the application side
The only state available from SYNCHRONIZED/FOCUS/VISIBLE is STOPPING, and that can only be initiated by the runtime. Calling xrEndSession from SYNCHRONIZED generates a XR_ERROR_SESSION_NOT_STOPPING. This might make sense for normal VR scene applications, but an overlay application has legitimate reasons to want to pause rendering temporarily and resume later, e.g. the user choose to hide the overlay. Right now the options are:
- continue running the frame loop, and not submitting anything
- destroy and then recreate a session
neither of those feel optimal. I think it should be OK to call xrEndSession when the state is not STOPPING.
(Technically as it is defined:
Calling xrEndSession always transitions a session to the not running state, regardless of any errors returned.
I can already use xrEndSession in this way, just have to ignore the error)
Also the spec doesn't say what happens when an SYNCHRONIZED application stops calling xrBegin/End/WaitFrame.
You can use xrRequestExitSession to transition from SYNCHRONIZED/VISIBLE/FOCUSED. But this will force you to destroy the session, there is currently no way for the application to request going to IDLE.
An issue (number 2173) has been filed to correspond to this issue in the internal Khronos GitLab (Khronos members only: KHR:openxr/openxr#2173 ), to facilitate working group processes.
This GitHub issue will continue to be the main site of discussion.