diff --git a/client/application.cpp b/client/application.cpp index b7cb4b21..cbd52f2c 100644 --- a/client/application.cpp +++ b/client/application.cpp @@ -1088,6 +1088,7 @@ void application::initialize() // Optional extensions std::vector opt_extensions; opt_extensions.push_back(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME); + opt_extensions.push_back(XR_KHR_LOCATE_SPACES_EXTENSION_NAME); opt_extensions.push_back(XR_EXT_HAND_TRACKING_EXTENSION_NAME); opt_extensions.push_back(XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME); opt_extensions.push_back(XR_FB_PASSTHROUGH_EXTENSION_NAME); diff --git a/client/scenes/stream_tracking.cpp b/client/scenes/stream_tracking.cpp index 03b685be..7aaadf04 100644 --- a/client/scenes/stream_tracking.cpp +++ b/client/scenes/stream_tracking.cpp @@ -114,22 +114,22 @@ public: locate_spaces_functor(xr::instance & instance, XrSpace reference) : reference(reference) { - if (instance.get_api_version() >= XR_MAKE_VERSION(1, 1, 0)) + try { - try - { + if (instance.get_api_version() >= XR_MAKE_VERSION(1, 1, 0)) locate_spaces = instance.get_proc("xrLocateSpaces"); - } - catch (std::exception & e) - { - spdlog::warn("Failed to load xrLocateSpaces function, fallback to xrLocateSpace"); - } + else + locate_spaces = instance.get_proc("xrLocateSpacesKHR"); + } + catch (std::exception & e) + { + spdlog::warn("Failed to load xrLocateSpaces function, fallback to xrLocateSpace"); } } void add_space(wivrn::device_id device, XrSpace space, XrTime t, std::vector & out) { - if (not locate_spaces) + if (locate_spaces) { // store, will be located later devices.push_back(device);