diff --git a/scripts/generate_oxr_ext_support.py b/scripts/generate_oxr_ext_support.py index f60a58d96..b68bb4466 100755 --- a/scripts/generate_oxr_ext_support.py +++ b/scripts/generate_oxr_ext_support.py @@ -54,7 +54,10 @@ EXTENSIONS = ( ['XR_EXT_debug_utils', 'XRT_FEATURE_OPENXR_DEBUG_UTILS'], ['XR_EXT_dpad_binding'], ['XR_EXT_hand_tracking'], + ['XR_EXT_hp_mixed_reality_controller'], + ['XR_EXT_samsung_odyssey_controller'], ['XR_FB_display_refresh_rate'], + ['XR_ML_ml2_controller_interaction'], ['XR_MND_headless'], ['XR_MND_swapchain_usage_input_attachment_bit'], ['XR_EXTX_overlay'], diff --git a/src/xrt/state_trackers/oxr/oxr_api_action.c b/src/xrt/state_trackers/oxr/oxr_api_action.c index 651fdc89c..3e99bb748 100644 --- a/src/xrt/state_trackers/oxr/oxr_api_action.c +++ b/src/xrt/state_trackers/oxr/oxr_api_action.c @@ -249,6 +249,39 @@ oxr_xrSuggestInteractionProfileBindings(XrInstance instance, subpath_fn = oxr_verify_valve_index_controller_subpath; dpad_path_fn = oxr_verify_valve_index_controller_dpad_path; dpad_emulator_fn = oxr_verify_valve_index_controller_dpad_emulator; + } else if (ip == inst->path_cache.hp_mixed_reality_controller) { + if (!inst->extensions.EXT_hp_mixed_reality_controller) { + return oxr_error(&log, XR_ERROR_PATH_UNSUPPORTED, + "(suggestedBindings->interactionProfile == \"%s\") used but " + "XR_EXT_hp_mixed_reality_controller not enabled", + ip_str); + } + + subpath_fn = oxr_verify_hp_mixed_reality_controller_subpath; + dpad_path_fn = oxr_verify_hp_mixed_reality_controller_dpad_path; + dpad_emulator_fn = oxr_verify_hp_mixed_reality_controller_dpad_emulator; + } else if (ip == inst->path_cache.samsung_odyssey_controller) { + if (!inst->extensions.EXT_samsung_odyssey_controller) { + return oxr_error(&log, XR_ERROR_PATH_UNSUPPORTED, + "(suggestedBindings->interactionProfile == \"%s\") used but " + "XR_EXT_samsung_odyssey_controller not enabled", + ip_str); + } + + subpath_fn = oxr_verify_samsung_odyssey_controller_subpath; + dpad_path_fn = oxr_verify_samsung_odyssey_controller_dpad_path; + dpad_emulator_fn = oxr_verify_samsung_odyssey_controller_dpad_emulator; + } else if (ip == inst->path_cache.ml_ml2_controller) { + if (!inst->extensions.ML_ml2_controller_interaction) { + return oxr_error(&log, XR_ERROR_PATH_UNSUPPORTED, + "(suggestedBindings->interactionProfile == \"%s\") used but " + "XR_ML_ml2_controller not enabled", + ip_str); + } + + subpath_fn = oxr_verify_ml_ml2_controller_subpath; + dpad_path_fn = oxr_verify_ml_ml2_controller_dpad_path; + dpad_emulator_fn = oxr_verify_ml_ml2_controller_dpad_emulator; } else if (ip == inst->path_cache.mndx_ball_on_a_stick_controller) { subpath_fn = oxr_verify_mndx_ball_on_a_stick_controller_subpath; dpad_path_fn = oxr_verify_mndx_ball_on_a_stick_controller_dpad_path; diff --git a/src/xrt/state_trackers/oxr/oxr_binding.c b/src/xrt/state_trackers/oxr/oxr_binding.c index 0c0ab546c..df19655dc 100644 --- a/src/xrt/state_trackers/oxr/oxr_binding.c +++ b/src/xrt/state_trackers/oxr/oxr_binding.c @@ -328,6 +328,9 @@ get_profile_for_device_name(struct oxr_logger *log, case XRT_DEVICE_GO_CONTROLLER: FIND_PROFILE(oculus_go_controller); return; case XRT_DEVICE_VIVE_PRO: FIND_PROFILE(htc_vive_pro); return; case XRT_DEVICE_XBOX_CONTROLLER: FIND_PROFILE(microsoft_xbox_controller); return; + case XRT_DEVICE_HP_REVERB_G2_CONTROLLER: FIND_PROFILE(hp_mixed_reality_controller); return; + case XRT_DEVICE_SAMSUNG_ODYSSEY_CONTROLLER: FIND_PROFILE(samsung_odyssey_controller); return; + case XRT_DEVICE_ML2_CONTROLLER: FIND_PROFILE(ml_ml2_controller); return; case XRT_DEVICE_HAND_INTERACTION: FIND_PROFILE(msft_hand_interaction); return; // no interaction diff --git a/src/xrt/state_trackers/oxr/oxr_extension_support.h b/src/xrt/state_trackers/oxr/oxr_extension_support.h index 1790d08a6..922f41560 100644 --- a/src/xrt/state_trackers/oxr/oxr_extension_support.h +++ b/src/xrt/state_trackers/oxr/oxr_extension_support.h @@ -257,6 +257,30 @@ #endif +/* + * XR_EXT_hp_mixed_reality_controller + */ +#if defined(XR_EXT_hp_mixed_reality_controller) +#define OXR_HAVE_EXT_hp_mixed_reality_controller +#define OXR_EXTENSION_SUPPORT_EXT_hp_mixed_reality_controller(_) \ + _(EXT_hp_mixed_reality_controller, EXT_HP_MIXED_REALITY_CONTROLLER) +#else +#define OXR_EXTENSION_SUPPORT_EXT_hp_mixed_reality_controller(_) +#endif + + +/* + * XR_EXT_samsung_odyssey_controller + */ +#if defined(XR_EXT_samsung_odyssey_controller) +#define OXR_HAVE_EXT_samsung_odyssey_controller +#define OXR_EXTENSION_SUPPORT_EXT_samsung_odyssey_controller(_) \ + _(EXT_samsung_odyssey_controller, EXT_SAMSUNG_ODYSSEY_CONTROLLER) +#else +#define OXR_EXTENSION_SUPPORT_EXT_samsung_odyssey_controller(_) +#endif + + /* * XR_FB_display_refresh_rate */ @@ -268,6 +292,18 @@ #endif +/* + * XR_ML_ml2_controller_interaction + */ +#if defined(XR_ML_ml2_controller_interaction) +#define OXR_HAVE_ML_ml2_controller_interaction +#define OXR_EXTENSION_SUPPORT_ML_ml2_controller_interaction(_) \ + _(ML_ml2_controller_interaction, ML_ML2_CONTROLLER_INTERACTION) +#else +#define OXR_EXTENSION_SUPPORT_ML_ml2_controller_interaction(_) +#endif + + /* * XR_MND_headless */ @@ -380,7 +416,10 @@ OXR_EXTENSION_SUPPORT_EXT_debug_utils(_) \ OXR_EXTENSION_SUPPORT_EXT_dpad_binding(_) \ OXR_EXTENSION_SUPPORT_EXT_hand_tracking(_) \ + OXR_EXTENSION_SUPPORT_EXT_hp_mixed_reality_controller(_) \ + OXR_EXTENSION_SUPPORT_EXT_samsung_odyssey_controller(_) \ OXR_EXTENSION_SUPPORT_FB_display_refresh_rate(_) \ + OXR_EXTENSION_SUPPORT_ML_ml2_controller_interaction(_) \ OXR_EXTENSION_SUPPORT_MND_headless(_) \ OXR_EXTENSION_SUPPORT_MND_swapchain_usage_input_attachment_bit(_) \ OXR_EXTENSION_SUPPORT_EXTX_overlay(_) \ diff --git a/src/xrt/state_trackers/oxr/oxr_instance.c b/src/xrt/state_trackers/oxr/oxr_instance.c index 46259e591..5361d01e1 100644 --- a/src/xrt/state_trackers/oxr/oxr_instance.c +++ b/src/xrt/state_trackers/oxr/oxr_instance.c @@ -244,6 +244,9 @@ oxr_instance_create(struct oxr_logger *log, cache_path(log, inst, "/interaction_profiles/oculus/go_controller", &inst->path_cache.oculus_go_controller); cache_path(log, inst, "/interaction_profiles/oculus/touch_controller", &inst->path_cache.oculus_touch_controller); cache_path(log, inst, "/interaction_profiles/valve/index_controller", &inst->path_cache.valve_index_controller); + cache_path(log, inst, "/interaction_profiles/hp/mixed_reality_controller", &inst->path_cache.hp_mixed_reality_controller); + cache_path(log, inst, "/interaction_profiles/samsung/odyssey_controller", &inst->path_cache.samsung_odyssey_controller); + cache_path(log, inst, "/interaction_profiles/ml/ml2_controller", &inst->path_cache.ml_ml2_controller); cache_path(log, inst, "/interaction_profiles/mndx/ball_on_a_stick_controller", &inst->path_cache.mndx_ball_on_a_stick_controller); cache_path(log, inst, "/interaction_profiles/microsoft/hand_interaction", &inst->path_cache.msft_hand_interaction); diff --git a/src/xrt/state_trackers/oxr/oxr_objects.h b/src/xrt/state_trackers/oxr/oxr_objects.h index ebd62e579..aa8814b32 100644 --- a/src/xrt/state_trackers/oxr/oxr_objects.h +++ b/src/xrt/state_trackers/oxr/oxr_objects.h @@ -1487,6 +1487,9 @@ struct oxr_instance XrPath oculus_go_controller; XrPath oculus_touch_controller; XrPath valve_index_controller; + XrPath hp_mixed_reality_controller; + XrPath samsung_odyssey_controller; + XrPath ml_ml2_controller; XrPath mndx_ball_on_a_stick_controller; XrPath msft_hand_interaction; } path_cache;