From 68080b7f0952697737abc796361b9961564b621b Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Fri, 15 Nov 2024 09:48:29 +0100 Subject: [PATCH] [OpenXR] Do not crash if FB keyboard extension does not work The XR_FB_keyboard_tracking extension is deprecated and won't work starting on MetaOS v72. We should replace it by others like XR_META_dynamic_object_tracker for example. In the meantime we should bailout instead of asserting to avoid a crash that should not happen anyway. --- app/src/openxr/cpp/OpenXRInput.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/openxr/cpp/OpenXRInput.cpp b/app/src/openxr/cpp/OpenXRInput.cpp index 4e3c5ee913..a30db57ffd 100644 --- a/app/src/openxr/cpp/OpenXRInput.cpp +++ b/app/src/openxr/cpp/OpenXRInput.cpp @@ -227,7 +227,8 @@ void OpenXRInput::UpdateTrackedKeyboard(const XrFrameState& frameState, XrSpace .flags = XR_KEYBOARD_TRACKING_QUERY_LOCAL_BIT_FB, }; XrKeyboardTrackingDescriptionFB kbdDesc; - CHECK_XRCMD(OpenXRExtensions::xrQuerySystemTrackedKeyboardFB(mSession, &queryInfo, &kbdDesc)); + if (XR_FAILED(OpenXRExtensions::xrQuerySystemTrackedKeyboardFB(mSession, &queryInfo, &kbdDesc))) + return; // Check if existing keyboard disappeared or changed, and clear up its state if so if ((kbdDesc.flags & XR_KEYBOARD_TRACKING_EXISTS_BIT_FB) == 0 ||