The open source OpenXR runtime

a/bindings + a/util + d/psvr2: Add PS VR2 interaction profile

Function button (path called "system" for consistency, but named "function button" by Sony's documentation) is fully implemented, output haptics are exposed but unimplemented, pending getting them working on post-PC firmwares.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2610>

Changed files
+85 -6
scripts
src
external
openxr_includes
xrt
auxiliary
include
state_trackers
+1
scripts/generate_oxr_ext_support.py
··· 109 109 ['XR_MNDX_egl_enable', 'XR_USE_PLATFORM_EGL'], 110 110 ['XR_MNDX_force_feedback_curl', 'XRT_FEATURE_OPENXR_FORCE_FEEDBACK_CURL'], 111 111 ['XR_MNDX_hydra', 'XRT_FEATURE_OPENXR_INTERACTION_MNDX'], 112 + ['XR_MNDX_psvr2_interaction', 'XRT_FEATURE_OPENXR_INTERACTION_MNDX'], 112 113 ['XR_MNDX_system_buttons', 'XRT_FEATURE_OPENXR_INTERACTION_MNDX'], 113 114 ['XR_MNDX_xdev_space', 'XRT_FEATURE_OPENXR_XDEV_SPACE'], 114 115 )
+26
src/external/openxr_includes/openxr/XR_MNDX_psvr2_interaction.h
··· 1 + // Copyright 2025, Beyley Cardellio 2 + // SPDX-License-Identifier: BSL-1.0 3 + /*! 4 + * @file 5 + * @brief Preview header for XR_MNDX_psvr2_interaction extension 6 + * @author Beyley Cardellio <ep1cm1n10n123@gmail.com> 7 + * @ingroup external_openxr 8 + */ 9 + #ifndef XR_MNDX_PSVR2_INTERACTION_H 10 + #define XR_MNDX_PSVR2_INTERACTION_H 1 11 + 12 + #include <openxr/openxr.h> 13 + 14 + #ifdef __cplusplus 15 + extern "C" { 16 + #endif 17 + 18 + #define XR_MNDX_psvr2_interaction 1 19 + #define XR_MNDX_psvr2_interaction_SPEC_VERSION 1 20 + #define XR_MNDX_PSVR2_INTERACTION_EXTENSION_NAME "XR_MNDX_psvr2_interaction" 21 + 22 + #ifdef __cplusplus 23 + } 24 + #endif 25 + 26 + #endif
+31
src/xrt/auxiliary/bindings/bindings.json
··· 3762 3762 } 3763 3763 } 3764 3764 } 3765 + }, 3766 + 3767 + "/interaction_profiles/mndx/psvr2_mndx": { 3768 + "title": "PlayStation VR2", 3769 + "type": "tracked_hmd", 3770 + "monado_device": "XRT_DEVICE_PSVR2", 3771 + "extension": "MNDX_psvr2_interaction", 3772 + "extended_by": [], 3773 + "subaction_paths": [ 3774 + "/user/head" 3775 + ], 3776 + "subpaths": { 3777 + "/input/system": { 3778 + "type": "button", 3779 + "localized_name": "Function", 3780 + "components": ["click"], 3781 + "monado_bindings": { 3782 + "click": "XRT_INPUT_PSVR2_SYSTEM_CLICK" 3783 + } 3784 + }, 3785 + "/output/haptic": { 3786 + "type": "vibration", 3787 + "localized_name": "Haptic", 3788 + "components": [ 3789 + "haptic" 3790 + ], 3791 + "monado_bindings": { 3792 + "haptic": "XRT_OUTPUT_NAME_PSVR2_HAPTIC" 3793 + } 3794 + } 3795 + } 3765 3796 } 3766 3797 3767 3798 }
+2
src/xrt/auxiliary/util/u_pretty_print.c
··· 177 177 XRT_OUTPUT_CASE(XRT_OUTPUT_NAME_TOUCH_PRO_HAPTIC_TRIGGER); 178 178 XRT_OUTPUT_CASE(XRT_OUTPUT_NAME_TOUCH_PRO_HAPTIC_THUMB); 179 179 XRT_OUTPUT_CASE(XRT_OUTPUT_NAME_TOUCH_PLUS_HAPTIC); 180 + 181 + XRT_OUTPUT_CASE(XRT_OUTPUT_NAME_PSVR2_HAPTIC); 180 182 } 181 183 182 184 #undef XRT_OUTPUT_CASE
+8 -2
src/xrt/include/xrt/xrt_defines.h
··· 743 743 XRT_DEVICE_HYDRA, 744 744 XRT_DEVICE_RIFT_REMOTE, 745 745 XRT_DEVICE_BLUBUR_S1, 746 + XRT_DEVICE_PSVR2, 746 747 747 748 // Other misc stuff. 748 749 XRT_DEVICE_HAND_TRACKER, ··· 1301 1302 _(XRT_INPUT_RIFT_REMOTE_DPAD_UP_CLICK , XRT_INPUT_NAME(0x0F07, BOOLEAN)) \ 1302 1303 _(XRT_INPUT_RIFT_REMOTE_DPAD_LEFT_CLICK , XRT_INPUT_NAME(0x0F08, BOOLEAN)) \ 1303 1304 \ 1304 - _(XRT_INPUT_BLUBUR_S1_MENU_CLICK , XRT_INPUT_NAME(0x1000, BOOLEAN)) 1305 + _(XRT_INPUT_BLUBUR_S1_MENU_CLICK , XRT_INPUT_NAME(0x1000, BOOLEAN)) \ 1306 + \ 1307 + _(XRT_INPUT_PSVR2_SYSTEM_CLICK , XRT_INPUT_NAME(0x1100, BOOLEAN)) 1308 + 1305 1309 1306 1310 // clang-format on 1307 1311 ··· 1984 1988 XRT_OUTPUT_NAME_TOUCH_PRO_HAPTIC = XRT_OUTPUT_NAME(0x0400, VIBRATION), 1985 1989 XRT_OUTPUT_NAME_TOUCH_PRO_HAPTIC_TRIGGER = XRT_OUTPUT_NAME(0x0500, VIBRATION), 1986 1990 XRT_OUTPUT_NAME_TOUCH_PRO_HAPTIC_THUMB = XRT_OUTPUT_NAME(0x0600, VIBRATION), 1987 - XRT_OUTPUT_NAME_TOUCH_PLUS_HAPTIC = XRT_OUTPUT_NAME(0x0700, VIBRATION) 1991 + XRT_OUTPUT_NAME_TOUCH_PLUS_HAPTIC = XRT_OUTPUT_NAME(0x0700, VIBRATION), 1992 + 1993 + XRT_OUTPUT_NAME_PSVR2_HAPTIC = XRT_OUTPUT_NAME(0x0800, VIBRATION), 1988 1994 // clang-format on 1989 1995 }; 1990 1996
+5 -4
src/xrt/include/xrt/xrt_openxr_includes.h
··· 64 64 #include "openxr/openxr_loader_negotiation.h" // IWYU pragma: export 65 65 #include "openxr/openxr_reflection.h" // IWYU pragma: export 66 66 67 + #include "openxr/XR_MNDX_ball_on_a_stick_controller.h" 68 + #include "openxr/XR_MNDX_blubur_s1.h" 69 + #include "openxr/XR_MNDX_oculus_remote.h" 67 70 #include "openxr/XR_MNDX_hydra.h" 71 + #include "openxr/XR_MNDX_psvr2_interaction.h" 72 + #include "openxr/XR_MNDX_system_buttons.h" 68 73 #include "openxr/XR_MNDX_xdev_space.h" 69 - #include "openxr/XR_MNDX_system_buttons.h" 70 - #include "openxr/XR_MNDX_ball_on_a_stick_controller.h" 71 - #include "openxr/XR_MNDX_oculus_remote.h" 72 - #include "openxr/XR_MNDX_blubur_s1.h"
+12
src/xrt/state_trackers/oxr/oxr_extension_support.h
··· 841 841 842 842 843 843 /* 844 + * XR_MNDX_psvr2_interaction 845 + */ 846 + #if defined(XR_MNDX_psvr2_interaction) && defined(XRT_FEATURE_OPENXR_INTERACTION_MNDX) 847 + #define OXR_HAVE_MNDX_psvr2_interaction 848 + #define OXR_EXTENSION_SUPPORT_MNDX_psvr2_interaction(_) _(MNDX_psvr2_interaction, MNDX_PSVR2_INTERACTION) 849 + #else 850 + #define OXR_EXTENSION_SUPPORT_MNDX_psvr2_interaction(_) 851 + #endif 852 + 853 + 854 + /* 844 855 * XR_MNDX_system_buttons 845 856 */ 846 857 #if defined(XR_MNDX_system_buttons) && defined(XRT_FEATURE_OPENXR_INTERACTION_MNDX) ··· 957 968 OXR_EXTENSION_SUPPORT_MNDX_egl_enable(_) \ 958 969 OXR_EXTENSION_SUPPORT_MNDX_force_feedback_curl(_) \ 959 970 OXR_EXTENSION_SUPPORT_MNDX_hydra(_) \ 971 + OXR_EXTENSION_SUPPORT_MNDX_psvr2_interaction(_) \ 960 972 OXR_EXTENSION_SUPPORT_MNDX_system_buttons(_) \ 961 973 OXR_EXTENSION_SUPPORT_MNDX_xdev_space(_) 962 974 // clang-format on