OpenXR add core support for Khronos loader #106891
Open
+196
−3
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 PR adds support for the Khronos OpenXR loader to the core of Godot.
This means that as long as the headset supports it, and you don't use any vendor features or have features locked behind vendor specific manifest entries, Godot can export to a headset without needing the vendor plugin.
This is the first step in turning the vendor plugin purely into a plugin that exposes vendor features.
Note: there is a problem with the loader for OpenXR 1.x.41, which is the version we're currently on. You can override the default behaviour by specifying the loader version to use in the export settings. 1.1.47 (currently the latest version) works fine:

I'm planning to update the third-party folder to 1.1.48 as soon as its released and waiting on that before this PR should be merged.
If a custom loader is added through a plugin, this property can be set to disabled:

Bit of a hidden feature but this really is designed to be set using
option_override
(which will also hide the field).This will only disable adding the dependency, it will not remove the manifest additions Khronos requires. Those will now always be added if OpenXR is selected as the XR Mode.
Due to this, changes to the vendors plugin are required as well as it now doubles up setting manifest entries and the loader dependency.
Finally I'll likely add some improvements to the way we obtain function pointers as we're doubling up loader logic but that may become a separate PR.
Tested on:
Contributed by Khronos Group through the Godot Integration Project