···11// Copyright 2018-2020,2023 Collabora, Ltd.
22+// Copyright 2025, NVIDIA CORPORATION.
23// SPDX-License-Identifier: BSL-1.0
34/*!
45 * @file
···462463 if (name == XRT_DEVICE_INVALID) {
463464 return false;
464465 }
466466+465467 /*
466468 * Map xrt_device_name to an interaction profile XrPath.
467467- * Set *out_p to an oxr_interaction_profile if bindings for that interaction profile XrPath have been suggested.
469469+ *
470470+ * There might be multiple OpenXR interaction profiles that maps to a
471471+ * a single @ref xrt_device_name, so we can't just grab the first one
472472+ * that we find and assume that wasn't bound then there isn't an OpenXR
473473+ * interaction profile bound for that device name. So we will need to
474474+ * keep looping until we find an OpenXR interaction profile, or we run
475475+ * out of interaction profiles that the app has suggested.
476476+ *
477477+ * For XRT_DEVICE_HAND_INTERACTION both the OpenXR hand-interaction
478478+ * profiles maps to it, but the app might only provide binding for one.
479479+ *
480480+ * Set *out_p to an oxr_interaction_profile if bindings for that
481481+ * interaction profile XrPath have been suggested.
468482 */
469483 for (uint32_t i = 0; i < ARRAY_SIZE(profile_templates); i++) {
470484 if (name == profile_templates[i].name) {
471471- if (interaction_profile_find_in_session(log, sess, profile_templates[i].path_cache, out_p)) {
485485+ interaction_profile_find_in_session(log, sess, profile_templates[i].path_cache, out_p);
486486+487487+ /*
488488+ * Keep looping even if the current matching OpenXR
489489+ * interaction profile wasn't suggested by the app.
490490+ * See comment above.
491491+ */
492492+ if (*out_p != NULL) {
472493 return true;
473494 }
474495 }