The open source OpenXR runtime

st/oxr: fix finding profiles for device

fixes 6627049af3e7151c116f2f7156e86cd41ce23173

+12 -2
+12 -2
src/xrt/state_trackers/oxr/oxr_binding.c
··· 287 287 enum xrt_device_name name, 288 288 struct oxr_interaction_profile **out_p) 289 289 { 290 + /* 291 + * Map xrt_device_name to an interaction profile XrPath. 292 + * Set *out_p to an oxr_interaction_profile if bindings for that interaction profile XrPath have been suggested. 293 + */ 290 294 #define FIND_PROFILE(PATH) interaction_profile_find(log, inst, inst->path_cache.PATH, out_p) 291 295 292 296 switch (name) { ··· 332 336 return; 333 337 } 334 338 335 - // Does the device directly have a binding profile. 339 + // Have bindings for this device's interaction profile been suggested? 336 340 get_profile_for_device_name(log, inst, xdev->name, out_p); 341 + if (*out_p != NULL) { 342 + return; 343 + } 337 344 338 - // Find all other binding profile for all device provided profiles. 345 + // Check if bindings for any of this device's alternative interaction profiles have been suggested. 339 346 for (size_t i = 0; i < xdev->binding_profile_count; i++) { 340 347 struct xrt_binding_profile *xbp = &xdev->binding_profiles[i]; 341 348 get_profile_for_device_name(log, inst, xbp->name, out_p); 349 + if (*out_p != NULL) { 350 + return; 351 + } 342 352 } 343 353 } 344 354