diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-30 19:08:55 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-30 19:08:55 +0100 |
commit | f5dbec2f735a9ea0803580537ceb6836d3274ad7 (patch) | |
tree | a9d4268b6a8364221bf8fca17f37d3cfc0960dac | |
parent | b355e29b97fb43ebde7eb3a122cda720aef9779c (diff) | |
parent | aa5b42946c8c5a9b0af60504ec038aa3f734aed0 (diff) |
Merge pull request #69392 from dsnopek/openxr-quest-fix
Fix OpenXR on the Meta Quest: XR_KHR_loader_init_android is not reported as available (but it works anyway)
-rw-r--r-- | modules/openxr/extensions/openxr_android_extension.cpp | 6 | ||||
-rw-r--r-- | modules/openxr/extensions/openxr_android_extension.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/modules/openxr/extensions/openxr_android_extension.cpp b/modules/openxr/extensions/openxr_android_extension.cpp index ea539f2053..753fc5fa89 100644 --- a/modules/openxr/extensions/openxr_android_extension.cpp +++ b/modules/openxr/extensions/openxr_android_extension.cpp @@ -47,11 +47,15 @@ OpenXRAndroidExtension *OpenXRAndroidExtension::get_singleton() { OpenXRAndroidExtension::OpenXRAndroidExtension(OpenXRAPI *p_openxr_api) : OpenXRExtensionWrapper(p_openxr_api) { singleton = this; - request_extensions[XR_KHR_LOADER_INIT_ANDROID_EXTENSION_NAME] = nullptr; // must be available + request_extensions[XR_KHR_LOADER_INIT_ANDROID_EXTENSION_NAME] = &loader_init_extension_available; request_extensions[XR_KHR_ANDROID_CREATE_INSTANCE_EXTENSION_NAME] = &create_instance_extension_available; } void OpenXRAndroidExtension::on_before_instance_created() { + if (!loader_init_extension_available) { + print_line("OpenXR: XR_KHR_loader_init_android is not reported as available - trying to initialize anyway..."); + } + EXT_INIT_XR_FUNC(xrInitializeLoaderKHR); JNIEnv *env = get_jni_env(); diff --git a/modules/openxr/extensions/openxr_android_extension.h b/modules/openxr/extensions/openxr_android_extension.h index ca6011559a..087b634756 100644 --- a/modules/openxr/extensions/openxr_android_extension.h +++ b/modules/openxr/extensions/openxr_android_extension.h @@ -48,6 +48,7 @@ public: private: static OpenXRAndroidExtension *singleton; + bool loader_init_extension_available = false; bool create_instance_extension_available = false; // Initialize the loader |