diff options
author | David Snopek <dsnopek@gmail.com> | 2022-11-29 20:45:01 -0600 |
---|---|---|
committer | David Snopek <dsnopek@gmail.com> | 2022-11-29 20:45:01 -0600 |
commit | aa5b42946c8c5a9b0af60504ec038aa3f734aed0 (patch) | |
tree | e1e9f42ed12f81deaccaeeed799b56aefa107c35 /modules/openxr/extensions | |
parent | 5826e960143fd416e0d02cf8f672d778f56da9ea (diff) |
Fix OpenXR on the Meta Quest: XR_KHR_loader_init_android is not reported as available (but it works anyway)
Diffstat (limited to 'modules/openxr/extensions')
-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 |