OpenXR: Add core support for Khronos loader#106891
OpenXR: Add core support for Khronos loader#106891Repiteo merged 1 commit intogodotengine:masterfrom
Conversation
e16eb1d to
15ecdbd
Compare
15ecdbd to
918d224
Compare
|
I'm taking this out of draft as it is working. This should not be merged until after we've updated the OpenXR version in the thirdparty folder to atleast 1.1.46 Opinion among the XR team is to also hold off merging until Godot 4.5 has been released as accompanying changes on the vendor plugin side will require some guidance. |
918d224 to
f1de29a
Compare
|
Rebased so it should now automatically pick up the OpenXR loader for 1.1.47 :) |
f1de29a to
a83b99b
Compare
a83b99b to
10503d6
Compare
|
Just discussed with @m4gr3d , need to rebase this and we're planning on removing the custom loader option as there currently is no scenario where we need this. |
10503d6 to
ebfdd7b
Compare
|
This has now been rebased and I've removed the custom option. PR still works as expected. Also as expected, with the current vendor plugin installed gradlew complains that we're including the loader twice. While we plan to remove the loader code from the vendor plugin, we want to be backwards compatible so we're looking into manifest changes that tell gradlew to ignore the loader from the vendor plugin. Once that is resolved this can be merged. |
|
XR Meeting: Fredia to detail his solution for prioritising loader between core and vendor plugin, then this should be ready to merge. |
|
Have not particular tested this one, but if it works the same as khronos loader of the vendor plugin, it works for focus 3 for sure, as I tested it on there. |
Thats the basic idea, it replaces the part of the vendor plugin where the khronos loader is included. This means that for any platform that doesn't require any additional manifest changes, you can create an APK that is deployable on all those platforms without requiring any additional plugins. |
ebfdd7b to
4a64c22
Compare
16e33b3 to
6d9df62
Compare
|
I'm not sure the I tested exporting with this PR and godot_openxr_vendor v4.2.0 installed in my project, then I unzipped the APK file and took an MD5 hash of the When I remove the godot_openxr_vendors plugin, and export again - then I see the right libopenxr_loader.so inside the APK |
6d9df62 to
e10dbf7
Compare
Well, its still better than completely breaking :) Right now I don't think it matters much which one is included, as long as we're not doubling up. We're not really using the loader beyond connecting to the runtime, we obtain all function pointers ourselves so even if we're using an older loader, things still work. It's probably going to matter once OpenXR 1.2 is available but by that time we'll have removed the loader from the vendors plugin. |
I guess that's OK, so long as it's predictable which one gets used But if we did want to have it favor the loader from the Khronos package, we might be able to make that happen by switching to |
Worth testing, but I'm out today so unless you have a moment to verify it'll have to wait. Also I'd like to know what determines the order :) |
|
If we want to be specific, we can try the approach described in https://stackoverflow.com/questions/74258902/how-to-define-which-so-file-to-use-in-gradle-packaging-options/74279439#74279439 |
To be honest, that feels like waaaaay overkill for a temporary situation. Honestly, I don't think it matters which version of the loader is added, and as long as we remove the loaders from the vendor plugins from v5.0.0 onwards, we're gonne be good. |
m4gr3d
left a comment
There was a problem hiding this comment.
Performed a couple rounds of tests and it works as expected!
e10dbf7 to
5d2df61
Compare
5d2df61 to
4720691
Compare
4720691 to
3065449
Compare
3065449 to
c056cae
Compare
m4gr3d
left a comment
There was a problem hiding this comment.
The code looks good. I'll perform a few rounds of tests.
Finished testing, and things build as expected! |
dsnopek
left a comment
There was a problem hiding this comment.
Thanks!
I just retested exporting a project using both godot_openxr_vendors v3 and v4, and everything seems to be working as expected now :-)
|
Thanks! |
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.
All you need to do is enabled

Use Gradle Build:And set the

XR ModetoOpenXR:And your game can be successfully exported to AOSP devices.
Tested on:
Contributed by Khronos Group through the Godot Integration Project