Repository navigation
Make the OpenXR session again after a loss instead of quitting - #79
Open
feimos-dev wants to merge 10 commits into
Open
feimos-dev wants to merge 10 commits into
feimos-dev wants to merge 10 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Session restarts go through one place, and a lost session comes back instead of telling the game to quit.
Restarts
XrBackend::RebuildSession(reason)covers the first Submit (game's device), the game's inputs and a loss. It holds the session lock and never runs mid-frame: if the game has a frame open, that frame is ended first.XrBackend::InputsMayAttach). That means the first Submit, or 2 s without any Submit for a game that never submits. A manifest loaded before the first Submit therefore costs no extra restart. A game that asks for legacy input gets it in place of the info set, with no restart between them.Loss
SetupSessionbinds the game's actions to it.SessionWrapper::try_lock), because a thread holding it may be stopping the loop. The loop and its thread are kept through the rebuild.Tests
loss_unavailable_mskeeps xrGetSystem failing for that long. A scripted EXITING on a running session behaves like a user quit (STOPPING, then EXITING after xrEndSession). The dump counts sessions created and lost, and action attaches.lostlost_unavailablelostlost_before_submitlost_inputlost_overlaylost, and the overlay drawn againAll CI jobs pass, Windows and Linux. The baselines didn't change.
Not covered here: rebuilding the instance after XR_ERROR_INSTANCE_LOST (in the stacked PR). Headless sessions take the same loop path as overlay sessions but weren't run, since on Linux a background app gets a scene session.