[OpenXR] Adds optional support for the Passthrough extension #2119
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.
PR Details
For OpenXR devices, this PR adds the option to instantiate the XR_FB_passthrough extension when enabling a VRDevice.
Description
OpenXR supports a wide range of optional extensions. Currently the OpenXR implementation in Stride allows to register extensions by adding them to the
OpenXRHmd.extensions
list before the device is started. Like this any exension that does not require any deeper integration with the engine (e.g. the XR_EXT_hand_tracking) can then be dealt with in custom code.In order to support the XR_FB_passthrough extension we needed tighter integration with the engine because it requires a composition layer. So this PR "hardcodes" the support for the passthrough extension which still has to be requested for the device in order to be activated.
In
OpenXRHmd.Enable(..)
we added a new argument "requestPassthrough" which, if true, adds the XR_FB_passthrough to the list of desired extensions and in case the current hardware supports this extension, it will be instantiated in the publicPassthroughExt
property. This public property is then meant to be controlled from custom code by setting its publicEnabled
property.Types of changes
Checklist