OpenXR-Docs icon indicating copy to clipboard operation
OpenXR-Docs copied to clipboard

No way to transition out of SYNCHRONIZED state from the application side

Open yshui opened this issue 2 years ago • 3 comments

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:

  1. continue running the frame loop, and not submitting anything
  2. 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)

yshui avatar Dec 19 '23 05:12 yshui

Also the spec doesn't say what happens when an SYNCHRONIZED application stops calling xrBegin/End/WaitFrame.

yshui avatar Dec 19 '23 05:12 yshui

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.

Wallbraker avatar Dec 20 '23 17:12 Wallbraker

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.

rpavlik-bot avatar Jan 03 '24 20:01 rpavlik-bot