From b51acac638503c2b114403bbbf4e5ff63ef90dea Mon Sep 17 00:00:00 2001 From: rsjtdrjgfuzkfg Date: Sat, 7 Jan 2023 18:41:58 +0100 Subject: OpenXR: Fix initialization warning on Android This commit adds proper checking for XR_KHR_loader_init support and fixes the warning regarding missing extensions on Android to only appear if neither XR_KHR_loader_init nor XR_KHR_loader_init_android are supported by the runtime. --- modules/openxr/openxr_api.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/openxr/openxr_api.cpp') diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp index 33b3c2967f..d556f475d2 100644 --- a/modules/openxr/openxr_api.cpp +++ b/modules/openxr/openxr_api.cpp @@ -1224,8 +1224,12 @@ bool OpenXRAPI::resolve_instance_openxr_symbols() { return true; } +XrResult OpenXRAPI::try_get_instance_proc_addr(const char *p_name, PFN_xrVoidFunction *p_addr) { + return xrGetInstanceProcAddr(instance, p_name, p_addr); +} + XrResult OpenXRAPI::get_instance_proc_addr(const char *p_name, PFN_xrVoidFunction *p_addr) { - XrResult result = xrGetInstanceProcAddr(instance, p_name, p_addr); + XrResult result = try_get_instance_proc_addr(p_name, p_addr); if (result != XR_SUCCESS) { String error_message = String("Symbol ") + p_name + " not found in OpenXR instance."; -- cgit v1.2.3