Repository navigation
Make the OpenXR instance again when the runtime loses it - #82
Open
feimos-dev wants to merge 14 commits into
Open
feimos-dev wants to merge 14 commits into
feimos-dev wants to merge 14 commits into
Conversation
# Conflicts: # tests/conformance/expect/xr_failures.json
# Conflicts: # DrvOpenXR/XrBackend.cpp
# Conflicts: # tests/conformance/xr_failures.py
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.
This builds on the session-loss handling in the base branch. A runtime whose service dies answers XR_ERROR_INSTANCE_LOST (Monado does this and never sends LOSS_PENDING). The game, or a helper program, now keeps running and the instance is made again once the runtime is back.
Detection: the instance is marked lost along with its session when any of these happen:
The devices are deactivated as for a session loss, and no quit is sent.
Recovery, tried at once and then about once a second, forever. It runs between a game's frames, or from a helper program's own loop:
DrvOpenXR::RemakeInstancedestroys the old instance and makes a new one with the same extensions, keeping it across tries while the headset isn't there yet. It sets up the function pointers, system and views again. The old function table is not freed, so a thread outside the session lock can't read freed memory.Stand-in runtime:
{ "type": "instance_lost" }loses the instance once per process. xrPollEvent and the frame, session and system calls then answer XR_ERROR_INSTANCE_LOST until xrDestroyInstance, and xrCreateInstance fails forloss_unavailable_ms. Each instance hands out different path atoms, as a real runtime's do. The library is kept loaded (-z nodeleteon Linux; pinned on Windows), because the loader unloads a runtime once its last instance is destroyed. The dump keeps its loss, session and attach counts across instances.xr_failures:
instance_lostinstance_lost_overlayinstance_lostinstance_lost_inputLinux x64: unit tests, stand-in runtime tests, hard stops and
scripts/ci/conformance-linux.sh x64all pass. The Linux baselines didn't change.