24#include "xrt/xrt_config_have.h"
38#if defined(XRT_HAVE_D3D11) || defined(XRT_HAVE_D3D12)
43#ifdef XRT_FEATURE_RENDERDOC
44#include "renderdoc_app.h"
76#define XRT_CAST_PTR_TO_OXR_HANDLE(HANDLE_TYPE, PTR) ((HANDLE_TYPE)(uint64_t)(uintptr_t)(PTR))
87#define XRT_CAST_OXR_HANDLE_TO_PTR(PTR_TYPE, HANDLE) ((PTR_TYPE)(uintptr_t)(uint64_t)(HANDLE))
130struct oxr_facial_tracker_htc;
131struct oxr_face_tracker2_fb;
132struct oxr_body_tracker_fb;
134struct oxr_plane_detector_ext;
136#define XRT_MAX_HANDLE_CHILDREN 256
137#define OXR_MAX_BINDINGS_PER_ACTION 32
159#define OXR_XRT_POSE_TO_XRPOSEF(FROM, TO) \
162 struct xrt_pose xrt; \
164 } safe_copy = {FROM}; \
165 TO = safe_copy.oxr; \
171#define OXR_XRT_FOV_TO_XRFOVF(FROM, TO) \
174 struct xrt_fov xrt; \
176 } safe_copy = {FROM}; \
177 TO = safe_copy.oxr; \
181static inline const char *
182xr_action_type_to_str(XrActionType type)
186 #define PRINT(name, value) \
187 case name: return #name;
188 XR_LIST_ENUM_XrActionType(PRINT)
190 default:
return "XR_ACTION_TYPE_UNKNOWN";
231static inline XrInstance
249 const XrInstanceCreateInfo *createInfo,
250 XrVersion major_minor,
266oxr_instance_get_properties(
struct oxr_logger *log,
268 XrInstanceProperties *instanceProperties);
276oxr_instance_convert_time_to_timespec(
struct oxr_logger *log,
279 struct timespec *timespecTime);
285oxr_instance_convert_timespec_to_time(
struct oxr_logger *log,
287 const struct timespec *timespecTime,
291#ifdef XR_USE_PLATFORM_WIN32
297oxr_instance_convert_time_to_win32perfcounter(
struct oxr_logger *log,
300 LARGE_INTEGER *win32perfcounterTime);
306oxr_instance_convert_win32perfcounter_to_time(
struct oxr_logger *log,
308 const LARGE_INTEGER *win32perfcounterTime,
372 struct oxr_logger *log,
const struct oxr_instance *inst, XrPath path,
const char **out_str,
size_t *out_length);
391static inline XrActionSet
402static inline XrHandTrackerEXT
408#ifdef OXR_HAVE_EXT_plane_detection
414static inline XrPlaneDetectorEXT
415oxr_plane_detector_to_openxr(
struct oxr_plane_detector_ext *plane_detector)
426static inline XrAction
432#ifdef OXR_HAVE_HTC_facial_tracking
438static inline XrFacialTrackerHTC
439oxr_facial_tracker_htc_to_openxr(
struct oxr_facial_tracker_htc *face_tracker_htc)
445#ifdef OXR_HAVE_FB_body_tracking
451static inline XrBodyTrackerFB
452oxr_body_tracker_fb_to_openxr(
struct oxr_body_tracker_fb *body_tracker_fb)
458#ifdef OXR_HAVE_FB_face_tracking2
464static inline XrFaceTracker2FB
465oxr_face_tracker2_fb_to_openxr(
struct oxr_face_tracker2_fb *face_tracker2_fb)
493 uint32_t subaction_path_count,
494 const XrPath *subaction_paths,
514 const XrActionSetCreateInfo *createInfo,
523 const XrActionCreateInfo *createInfo,
533 const XrSessionActionSetsAttachInfo *bindInfo);
546oxr_session_get_action_attachment(
struct oxr_session *sess,
556 uint32_t countActionSets,
557 const XrActiveActionSet *actionSets,
558 const XrActiveActionSetPrioritiesEXT *activePriorities);
564oxr_action_enumerate_bound_sources(
struct oxr_logger *log,
567 uint32_t sourceCapacityInput,
568 uint32_t *sourceCountOutput,
579 XrActionStateBoolean *data);
585oxr_action_get_vector1f(
struct oxr_logger *log,
589 XrActionStateFloat *data);
595oxr_action_get_vector2f(
struct oxr_logger *log,
599 XrActionStateVector2f *data);
608 XrActionStatePose *data);
613oxr_action_apply_haptic_feedback(
struct oxr_logger *log,
617 const XrHapticBaseHeader *hapticEvent);
622oxr_action_stop_haptic_feedback(
struct oxr_logger *log,
631oxr_hand_tracker_create(
struct oxr_logger *log,
633 const XrHandTrackerCreateInfoEXT *createInfo,
664oxr_get_profile_for_device_name(
struct oxr_logger *log,
696 size_t max_binding_count,
698 size_t *out_binding_count);
704oxr_action_suggest_interaction_profile_bindings(
struct oxr_logger *log,
706 const XrInteractionProfileSuggestedBinding *suggestedBindings,
713oxr_action_get_current_interaction_profile(
struct oxr_logger *log,
715 XrPath topLevelUserPath,
716 XrInteractionProfileState *interactionProfile);
724 const XrInputSourceLocalizedNameGetInfo *getInfo,
725 uint32_t bufferCapacityInput,
726 uint32_t *bufferCountOutput,
765oxr_dpad_state_get_or_add(
struct oxr_dpad_state *state, uint64_t key);
802static inline XrSession
811 const XrSessionCreateInfo *createInfo,
815oxr_session_enumerate_formats(
struct oxr_logger *log,
817 uint32_t formatCapacityInput,
818 uint32_t *formatCountOutput,
828oxr_session_begin(
struct oxr_logger *log,
struct oxr_session *sess,
const XrSessionBeginInfo *beginInfo);
836XRT_CHECK_RESULT XrResult
840oxr_session_locate_views(
struct oxr_logger *log,
842 const XrViewLocateInfo *viewLocateInfo,
843 XrViewState *viewState,
844 uint32_t viewCapacityInput,
845 uint32_t *viewCountOutput,
860 const XrHandJointsLocateInfoEXT *locateInfo,
861 XrHandJointLocationsEXT *locations);
875oxr_session_apply_force_feedback(
struct oxr_logger *log,
877 const XrForceFeedbackCurlApplyLocationsMNDX *locations);
879#ifdef OXR_HAVE_KHR_android_thread_settings
881oxr_session_android_thread_settings(
struct oxr_logger *log,
883 XrAndroidThreadTypeKHR threadType,
887#ifdef OXR_HAVE_KHR_visibility_mask
889oxr_session_get_visibility_mask(
struct oxr_logger *log,
891 XrVisibilityMaskTypeKHR visibilityMaskType,
893 XrVisibilityMaskKHR *visibilityMask);
896oxr_event_push_XrEventDataVisibilityMaskChangedKHR(
struct oxr_logger *log,
898 XrViewConfigurationType viewConfigurationType,
902#ifdef OXR_HAVE_EXT_performance_settings
904oxr_session_set_perf_level(
struct oxr_logger *log,
906 XrPerfSettingsDomainEXT domain,
907 XrPerfSettingsLevelEXT level);
926oxr_space_action_create(
struct oxr_logger *log,
929 const XrActionSpaceCreateInfo *createInfo,
933oxr_space_get_reference_bounds_rect(
struct oxr_logger *log,
935 XrReferenceSpaceType referenceSpaceType,
936 XrExtent2Df *bounds);
939oxr_space_reference_create(
struct oxr_logger *log,
941 const XrReferenceSpaceCreateInfo *createInfo,
966 XrSpaceLocations *locations);
980XRT_CHECK_RESULT XrResult
997static inline XrSwapchain
1013static inline XrDebugUtilsMessengerEXT
1022 const XrDebugUtilsMessengerCreateInfoEXT *,
1037 uint32_t system_count,
1038 XrFormFactor form_factor,
1044 XrSystemId systemId,
1045 uint32_t view_count,
1054 XrSystemId systemId,
1058oxr_system_get_properties(
struct oxr_logger *log,
struct oxr_system *sys, XrSystemProperties *properties);
1061oxr_system_enumerate_view_confs(
struct oxr_logger *log,
1063 uint32_t viewConfigurationTypeCapacityInput,
1064 uint32_t *viewConfigurationTypeCountOutput,
1065 XrViewConfigurationType *viewConfigurationTypes);
1068oxr_system_enumerate_blend_modes(
struct oxr_logger *log,
1070 XrViewConfigurationType viewConfigurationType,
1071 uint32_t environmentBlendModeCapacityInput,
1072 uint32_t *environmentBlendModeCountOutput,
1073 XrEnvironmentBlendMode *environmentBlendModes);
1076oxr_system_get_view_conf_properties(
struct oxr_logger *log,
1078 XrViewConfigurationType viewConfigurationType,
1079 XrViewConfigurationProperties *configurationProperties);
1082oxr_system_enumerate_view_conf_views(
struct oxr_logger *log,
1084 XrViewConfigurationType viewConfigurationType,
1085 uint32_t viewCapacityInput,
1086 uint32_t *viewCountOutput,
1087 XrViewConfigurationView *views);
1099oxr_system_get_face_tracking_htc_support(
struct oxr_logger *log,
1102 bool *supports_lip);
1105oxr_system_get_face_tracking2_fb_support(
struct oxr_logger *log,
1107 bool *supports_audio,
1108 bool *supports_visual);
1126oxr_event_push_XrEventDataSessionStateChanged(
struct oxr_logger *log,
1128 XrSessionState state,
1132oxr_event_push_XrEventDataInteractionProfileChanged(
struct oxr_logger *log,
struct oxr_session *sess);
1135oxr_event_push_XrEventDataReferenceSpaceChangePending(
struct oxr_logger *log,
1137 XrReferenceSpaceType referenceSpaceType,
1140 const XrPosef *poseInPreviousSpace);
1142#ifdef OXR_HAVE_FB_display_refresh_rate
1144oxr_event_push_XrEventDataDisplayRefreshRateChangedFB(
struct oxr_logger *log,
1146 float fromDisplayRefreshRate,
1147 float toDisplayRefreshRate);
1150#ifdef OXR_HAVE_EXTX_overlay
1152oxr_event_push_XrEventDataMainSessionVisibilityChangedEXTX(
struct oxr_logger *log,
1157#ifdef OXR_HAVE_EXT_performance_settings
1159oxr_event_push_XrEventDataPerfSettingsEXTX(
struct oxr_logger *log,
1162 enum xrt_perf_sub_domain subDomain,
1186oxr_xdev_destroy(
struct xrt_device **xdev_ptr);
1200#ifdef OXR_HAVE_MNDX_xdev_space
1201static inline XrXDevListMNDX
1202oxr_xdev_list_to_openxr(
struct oxr_xdev_list *sc)
1210 const XrCreateXDevListInfoMNDX *createInfo,
1211 struct oxr_xdev_list **out_xdl);
1214oxr_xdev_list_get_properties(
struct oxr_logger *log,
1215 struct oxr_xdev_list *xdl,
1217 XrXDevPropertiesMNDX *properties);
1220oxr_xdev_list_space_create(
struct oxr_logger *log,
1221 struct oxr_xdev_list *xdl,
1222 const XrCreateXDevSpaceInfoMNDX *createInfo,
1235#ifdef XR_USE_GRAPHICS_API_OPENGL
1236#ifdef XR_USE_PLATFORM_XLIB
1239oxr_session_populate_gl_xlib(
struct oxr_logger *log,
1241 XrGraphicsBindingOpenGLXlibKHR
const *next,
1245#ifdef XR_USE_PLATFORM_WIN32
1247oxr_session_populate_gl_win32(
struct oxr_logger *log,
1249 XrGraphicsBindingOpenGLWin32KHR
const *next,
1254#if defined(XR_USE_GRAPHICS_API_OPENGL) || defined(XR_USE_GRAPHICS_API_OPENGL_ES)
1258 const XrSwapchainCreateInfo * ,
1263#if defined(XR_USE_GRAPHICS_API_OPENGL_ES)
1264#if defined(XR_USE_PLATFORM_ANDROID)
1266oxr_session_populate_gles_android(
struct oxr_logger *log,
1268 XrGraphicsBindingOpenGLESAndroidKHR
const *next,
1280#ifdef XR_USE_GRAPHICS_API_VULKAN
1283oxr_vk_get_instance_exts(
struct oxr_logger *log,
1285 uint32_t namesCapacityInput,
1286 uint32_t *namesCountOutput,
1290oxr_vk_get_device_exts(
struct oxr_logger *log,
1292 uint32_t namesCapacityInput,
1293 uint32_t *namesCountOutput,
1297oxr_vk_get_requirements(
struct oxr_logger *log,
1299 XrGraphicsRequirementsVulkanKHR *graphicsRequirements);
1304 const XrVulkanInstanceCreateInfoKHR *createInfo,
1305 VkInstance *vulkanInstance,
1306 VkResult *vulkanResult);
1311 const XrVulkanDeviceCreateInfoKHR *createInfo,
1312 VkDevice *vulkanDevice,
1313 VkResult *vulkanResult);
1316oxr_vk_get_physical_device(
struct oxr_logger *log,
1319 VkInstance vkInstance,
1320 PFN_vkGetInstanceProcAddr getProc,
1321 VkPhysicalDevice *vkPhysicalDevice);
1324oxr_session_populate_vk(
struct oxr_logger *log,
1326 XrGraphicsBindingVulkanKHR
const *next,
1332 const XrSwapchainCreateInfo * ,
1344#ifdef XR_USE_PLATFORM_EGL
1347oxr_session_populate_egl(
struct oxr_logger *log,
1349 XrGraphicsBindingEGLMNDX
const *next,
1360#if defined(XRT_HAVE_D3D11) || defined(XRT_HAVE_D3D12) || defined(XRT_DOXYGEN)
1366 D3D_FEATURE_LEVEL *min_feature_level);
1379#ifdef XR_USE_GRAPHICS_API_D3D11
1382oxr_d3d11_get_requirements(
struct oxr_logger *log,
1384 XrGraphicsRequirementsD3D11KHR *graphicsRequirements);
1396oxr_session_populate_d3d11(
struct oxr_logger *log,
1398 XrGraphicsBindingD3D11KHR
const *next,
1402oxr_swapchain_d3d11_create(
struct oxr_logger *,
1404 const XrSwapchainCreateInfo *,
1415#ifdef XR_USE_GRAPHICS_API_D3D12
1418oxr_d3d12_get_requirements(
struct oxr_logger *log,
1420 XrGraphicsRequirementsD3D12KHR *graphicsRequirements);
1432oxr_session_populate_d3d12(
struct oxr_logger *log,
1434 XrGraphicsBindingD3D12KHR
const *next,
1438oxr_swapchain_d3d12_create(
struct oxr_logger *,
1440 const XrSwapchainCreateInfo *,
1491 XrViewConfigurationType view_config_type;
1493 uint32_t view_count;
1494 XrViewConfigurationView views[XRT_MAX_COMPOSITOR_VIEW_CONFIGS_VIEW_COUNT];
1496 uint32_t blend_mode_count;
1497 XrEnvironmentBlendMode blend_modes[3];
1527 XrSystemId systemId;
1532 uint32_t view_config_count;
1535 XrReferenceSpaceType reference_spaces[5];
1536 uint32_t reference_space_count;
1540 struct os_mutex sync_actions_mutex;
1544#ifdef OXR_HAVE_MNDX_xdev_space
1545 bool supports_xdev_space;
1548#ifdef XR_USE_GRAPHICS_API_VULKAN
1564 bool external_fence_fd_enabled;
1565 bool external_semaphore_fd_enabled;
1566 bool timeline_semaphore_enabled;
1567 bool debug_utils_enabled;
1568 bool image_format_list_enabled;
1573#if defined(XR_USE_GRAPHICS_API_D3D11) || defined(XR_USE_GRAPHICS_API_D3D12)
1574 LUID suggested_d3d_luid;
1575 bool suggested_d3d_luid_valid;
1598#define MAKE_GET_DYN_ROLES_FN(ROLE) \
1599 static inline struct xrt_device *get_role_##ROLE(struct oxr_system *sys) \
1601 const bool is_locked = 0 == os_mutex_trylock(&sys->sync_actions_mutex); \
1602 const int32_t xdev_idx = sys->dynamic_roles_cache.ROLE; \
1604 os_mutex_unlock(&sys->sync_actions_mutex); \
1606 if (xdev_idx < 0 || xdev_idx >= (int32_t)ARRAY_SIZE(sys->xsysd->xdevs)) \
1608 return sys->xsysd->xdevs[xdev_idx]; \
1610MAKE_GET_DYN_ROLES_FN(left)
1611MAKE_GET_DYN_ROLES_FN(right)
1612MAKE_GET_DYN_ROLES_FN(gamepad)
1613#undef MAKE_GET_DYN_ROLES_FN
1615#define GET_XDEV_BY_ROLE(SYS, ROLE) (get_role_##ROLE((SYS)))
1621 return XRT_DEVICE_INVALID;
1626 return XRT_DEVICE_INVALID;
1631 return XRT_DEVICE_INVALID;
1636 return XRT_DEVICE_INVALID;
1639get_role_profile_hand_tracking_unobstructed_left(
struct oxr_system *sys)
1641 return XRT_DEVICE_INVALID;
1644get_role_profile_hand_tracking_unobstructed_right(
struct oxr_system *sys)
1646 return XRT_DEVICE_INVALID;
1650get_role_profile_hand_tracking_conforming_left(
struct oxr_system *sys)
1652 return XRT_DEVICE_INVALID;
1655get_role_profile_hand_tracking_conforming_right(
struct oxr_system *sys)
1657 return XRT_DEVICE_INVALID;
1660#define MAKE_GET_DYN_ROLE_PROFILE_FN(ROLE) \
1661 static inline enum xrt_device_name get_role_profile_##ROLE(struct oxr_system *sys) \
1663 const bool is_locked = 0 == os_mutex_trylock(&sys->sync_actions_mutex); \
1664 const enum xrt_device_name profile_name = sys->dynamic_roles_cache.ROLE##_profile; \
1666 os_mutex_unlock(&sys->sync_actions_mutex); \
1668 return profile_name; \
1670MAKE_GET_DYN_ROLE_PROFILE_FN(left)
1671MAKE_GET_DYN_ROLE_PROFILE_FN(right)
1672MAKE_GET_DYN_ROLE_PROFILE_FN(gamepad)
1673#undef MAKE_GET_DYN_ROLES_FN
1675#define GET_PROFILE_NAME_BY_ROLE(SYS, ROLE) (get_role_profile_##ROLE((SYS)))
1681#define MAKE_EXT_STATUS(mixed_case, all_caps) bool mixed_case;
1691#undef MAKE_EXT_STATUS
1706 struct u_debug_gui *debug_ui;
1753 size_t profile_count;
1760#define SUBACTION_PATH_MEMBER(X) XrPath X;
1763#undef SUBACTION_PATH_MEMBER
1822 bool lifecycle_verbose;
1825 bool debug_bindings;
1827#ifdef XRT_FEATURE_RENDERDOC
1828 RENDERDOC_API_1_4_1 *rdoc_api;
1831#ifdef XRT_OS_ANDROID
1863 XrSessionState state;
1878 bool compositor_visible;
1879 bool compositor_focused;
1883 int active_wait_frames;
1884 struct os_mutex active_wait_frames_lock;
1948#define OXR_PATH_MEMBER(X) XrPath X;
1951#undef OXR_PATH_MEMBER
1974 const XrSwapchainCreateInfo *,
1989static inline XrResult
1992 switch (session->state) {
1993 case XR_SESSION_STATE_LOSS_PENDING:
return XR_SESSION_LOSS_PENDING;
1994 default:
return XR_SUCCESS;
2004static inline XrResult
2007 switch (session->state) {
2008 case XR_SESSION_STATE_LOSS_PENDING:
return XR_SESSION_LOSS_PENDING;
2009 case XR_SESSION_STATE_FOCUSED:
return XR_SUCCESS;
2010 default:
return XR_SESSION_NOT_FOCUSED;
2014#ifdef OXR_HAVE_FB_display_refresh_rate
2016oxr_session_get_display_refresh_rate(
struct oxr_logger *log,
struct oxr_session *sess,
float *displayRefreshRate);
2019oxr_session_request_display_refresh_rate(
struct oxr_logger *log,
struct oxr_session *sess,
float displayRefreshRate);
2029 float forceThreshold;
2030 float forceThresholdReleased;
2052#ifdef XR_EXT_dpad_binding
2054 uint32_t dpad_count;
2077 uint32_t path_count;
2096 size_t binding_count;
2110 uint32_t path_count;
2117 uint32_t act_key_count;
2165#define OXR_SUBPATH_MEMBER(X) bool X;
2167#undef OXR_SUBPATH_MEMBER
2179#define OXR_CHECK_SUBACTION_PATHS(X) \
2180 if (a->X && !b->X) { \
2184#undef OXR_CHECK_SUBACTION_PATHS
2276 size_t transform_count;
2315 int64_t stop_output_time;
2316 size_t output_count;
2359#define OXR_CACHE_MEMBER(X) struct oxr_action_cache X;
2361#undef OXR_CACHE_MEMBER
2372 switch (space_type) {
2373 case OXR_SPACE_TYPE_REFERENCE_VIEW:
2374 case OXR_SPACE_TYPE_REFERENCE_LOCAL:
2375 case OXR_SPACE_TYPE_REFERENCE_LOCAL_FLOOR:
2376 case OXR_SPACE_TYPE_REFERENCE_STAGE:
2377 case OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_MSFT:
2378 case OXR_SPACE_TYPE_REFERENCE_COMBINED_EYE_VARJO:
2379 case OXR_SPACE_TYPE_REFERENCE_LOCALIZATION_MAP_ML:
2383 case OXR_SPACE_TYPE_ACTION:
2384 case OXR_SPACE_TYPE_XDEV_POSE:
2456 uint32_t
width, height;
2493 XrResult (*enumerate_images)(
struct oxr_logger *,
2496 XrSwapchainImageBaseHeader *);
2498 XrResult (*acquire_image)(
struct oxr_logger *,
2500 const XrSwapchainImageAcquireInfo *,
2551 char name[XR_MAX_ACTION_SET_NAME_SIZE];
2633 char name[XR_MAX_ACTION_NAME_SIZE];
2722oxr_hand_tracking_data_source_cmp(
const void *p1,
const void *p2)
2763 uint32_t requested_sources_count;
2766 XrHandJointSetEXT hand_joint_set;
2769#ifdef OXR_HAVE_FB_passthrough
2771struct oxr_passthrough
2777 XrPassthroughFlagsFB
flags;
2782struct oxr_passthrough_layer
2788 XrPassthroughFB passthrough;
2790 XrPassthroughFlagsFB
flags;
2792 XrPassthroughLayerPurposeFB purpose;
2796 XrPassthroughStyleFB style;
2797 XrPassthroughColorMapMonoToRgbaFB monoToRgba;
2798 XrPassthroughColorMapMonoToMonoFB monoToMono;
2799 XrPassthroughBrightnessContrastSaturationFB brightnessContrastSaturation;
2803oxr_passthrough_create(
struct oxr_logger *log,
2805 const XrPassthroughCreateInfoFB *createInfo,
2806 struct oxr_passthrough **out_passthrough);
2809oxr_passthrough_layer_create(
struct oxr_logger *log,
2811 const XrPassthroughLayerCreateInfoFB *createInfo,
2812 struct oxr_passthrough_layer **out_layer);
2814static inline XrPassthroughFB
2815oxr_passthrough_to_openxr(
struct oxr_passthrough *passthrough)
2820static inline XrPassthroughLayerFB
2821oxr_passthrough_layer_to_openxr(
struct oxr_passthrough_layer *passthroughLayer)
2827oxr_event_push_XrEventDataPassthroughStateChangedFB(
struct oxr_logger *log,
2829 XrPassthroughStateChangedFlagsFB
flags);
2833#ifdef OXR_HAVE_HTC_facial_tracking
2843struct oxr_facial_tracker_htc
2855 enum xrt_facial_tracking_type_htc facial_tracking_type;
2859oxr_facial_tracker_htc_create(
struct oxr_logger *log,
2861 const XrFacialTrackerCreateInfoHTC *createInfo,
2862 struct oxr_facial_tracker_htc **out_face_tracker_htc);
2865oxr_get_facial_expressions_htc(
struct oxr_logger *log,
2866 struct oxr_facial_tracker_htc *facial_tracker_htc,
2867 XrFacialExpressionsHTC *facialExpressions);
2870#ifdef OXR_HAVE_FB_body_tracking
2879struct oxr_body_tracker_fb
2891 enum xrt_body_joint_set_type_fb joint_set_type;
2895oxr_create_body_tracker_fb(
struct oxr_logger *log,
2897 const XrBodyTrackerCreateInfoFB *createInfo,
2898 struct oxr_body_tracker_fb **out_body_tracker_fb);
2901oxr_get_body_skeleton_fb(
struct oxr_logger *log,
2902 struct oxr_body_tracker_fb *body_tracker_fb,
2903 XrBodySkeletonFB *skeleton);
2906oxr_locate_body_joints_fb(
struct oxr_logger *log,
2907 struct oxr_body_tracker_fb *body_tracker_fb,
2909 const XrBodyJointsLocateInfoFB *locateInfo,
2910 XrBodyJointLocationsFB *locations);
2913#ifdef OXR_HAVE_FB_face_tracking2
2922struct oxr_face_tracker2_fb
2934 bool visual_enabled;
2938oxr_face_tracker2_fb_create(
struct oxr_logger *log,
2940 const XrFaceTrackerCreateInfo2FB *createInfo,
2941 struct oxr_face_tracker2_fb **out_face_tracker2_fb);
2944oxr_get_face_expression_weights2_fb(
struct oxr_logger *log,
2945 struct oxr_face_tracker2_fb *face_tracker2_fb,
2946 const XrFaceExpressionInfo2FB *expression_info,
2947 XrFaceExpressionWeights2FB *expression_weights);
2950#ifdef OXR_HAVE_MNDX_xdev_space
2968 uint64_t generation_number;
2975 uint32_t device_count;
2979#ifdef OXR_HAVE_EXT_plane_detection
2989struct oxr_plane_detector_ext
3001 XrPlaneDetectionStateEXT state;
3014 XrPlaneDetectorLocationEXT *xr_locations;
3017 uint64_t detection_id;
3021#ifdef OXR_HAVE_EXT_future
3030struct oxr_future_ext
3050static inline XrFutureEXT
3051oxr_future_ext_to_openxr(
struct oxr_future_ext *future_ext)
3061 struct oxr_future_ext **out_oxr_future_ext);
3064oxr_future_invalidate(
struct oxr_logger *log,
struct oxr_future_ext *oxr_future);
3067oxr_future_ext_poll(
struct oxr_logger *log,
const struct oxr_future_ext *oxr_future, XrFuturePollResultEXT *pollResult);
3070oxr_future_ext_cancel(
struct oxr_logger *log,
struct oxr_future_ext *oxr_future);
3073oxr_future_ext_complete(
struct oxr_logger *log,
3074 struct oxr_future_ext *oxr_future,
3079#ifdef OXR_HAVE_EXT_user_presence
3081oxr_event_push_XrEventDataUserPresenceChangedEXT(
struct oxr_logger *log,
struct oxr_session *sess,
bool isUserPresent);
void oxr_action_set_attachment_teardown(struct oxr_action_set_attachment *act_set_attached)
De-initialize an action set attachment and its action attachments.
Definition: oxr_input.c:224
static void oxr_refcounted_unref(struct oxr_refcounted *orc)
Decrease the reference count of orc, destroying it if it reaches 0.
Definition: oxr_objects.h:2521
XrResult oxr_poll_event(struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuffer *eventData)
Will return one event if available, also drain the sessions event queues.
Definition: oxr_event.c:400
XrResult oxr_spaces_locate(struct oxr_logger *log, struct oxr_space **spcs, uint32_t spc_count, struct oxr_space *baseSpc, XrTime time, XrSpaceLocations *locations)
Definition: oxr_space.c:295
static XrSwapchain oxr_swapchain_to_openxr(struct oxr_swapchain *sc)
To go back to a OpenXR object.
Definition: oxr_objects.h:998
oxr_image_state
Tracks the state of a image that belongs to a oxr_swapchain.
Definition: oxr_defines.h:94
XrResult oxr_path_get_or_create(struct oxr_logger *log, struct oxr_instance *inst, const char *str, size_t length, XrPath *out_path)
Get the path for the given string if it exists, or create it if it does not.
Definition: oxr_path.c:172
XrResult oxr_d3d_check_luid(struct oxr_logger *log, struct oxr_system *sys, LUID *adapter_luid)
Verify the provided LUID matches the expected one in sys.
Definition: oxr_d3d.cpp:80
XrResult oxr_session_hand_joints(struct oxr_logger *log, struct oxr_hand_tracker *hand_tracker, const XrHandJointsLocateInfoEXT *locateInfo, XrHandJointLocationsEXT *locations)
Definition: oxr_session.c:1387
void oxr_binding_find_bindings_from_act_key(struct oxr_logger *log, struct oxr_interaction_profile *profile, uint32_t key, size_t max_binding_count, struct oxr_binding **out_bindings, size_t *out_binding_count)
Find all bindings that is the given action key is bound to.
Definition: oxr_binding.c:512
XrResult oxr_handle_destroy(struct oxr_logger *log, struct oxr_handle_base *hb)
Destroy the handle's object, as well as all child handles recursively.
Definition: oxr_handle_base.c:197
XrResult oxr_event_remove_session_events(struct oxr_logger *log, struct oxr_session *sess)
This clears all pending events refers to the given session.
Definition: oxr_event.c:368
static XrResult oxr_session_success_result(struct oxr_session *session)
Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate.
Definition: oxr_objects.h:1986
XrResult oxr_action_get_pose_input(struct oxr_session *sess, uint32_t act_key, const struct oxr_subaction_paths *subaction_paths_ptr, struct oxr_action_input **out_input)
Find the pose input for the set of subaction_paths.
Definition: oxr_input.c:475
static XrResult oxr_session_success_focused_result(struct oxr_session *session)
Returns XR_SUCCESS, XR_SESSION_LOSS_PENDING, or XR_SESSION_NOT_FOCUSED, as appropriate.
Definition: oxr_objects.h:2001
XrResult oxr_path_only_get(struct oxr_logger *log, struct oxr_instance *inst, const char *str, size_t length, XrPath *out_path)
Only get the path for the given string if it exists.
Definition: oxr_path.c:199
XrResult oxr_space_xdev_pose_create(struct oxr_logger *log, struct oxr_session *sess, struct xrt_device *xdev, enum xrt_input_name name, const struct xrt_pose *pose, struct oxr_space **out_space)
Monado special space that always points to a specific xrt_device and pose, useful when you want to by...
Definition: oxr_space.c:242
void oxr_find_profile_for_device(struct oxr_logger *log, struct oxr_session *sess, struct xrt_device *xdev, struct oxr_interaction_profile **out_p)
Find the best matching profile for the given xrt_device.
Definition: oxr_binding.c:486
XrResult oxr_session_attach_action_sets(struct oxr_logger *log, struct oxr_session *sess, const XrSessionActionSetsAttachInfo *bindInfo)
Definition: oxr_input.c:1752
XRT_CHECK_RESULT XrResult oxr_space_locate_device(struct oxr_logger *log, struct xrt_device *xdev, struct oxr_space *baseSpc, XrTime time, struct xrt_space_relation *out_relation)
Locate the xrt_device in the given base space, useful for implementing hand tracking location look up...
Definition: oxr_space.c:585
static XrDebugUtilsMessengerEXT oxr_messenger_to_openxr(struct oxr_debug_messenger *mssngr)
To go back to a OpenXR object.
Definition: oxr_objects.h:1014
XrResult oxr_space_locate(struct oxr_logger *log, struct oxr_space *spc, struct oxr_space *baseSpc, XrTime time, XrSpaceLocation *location)
Definition: oxr_space.c:452
XrResult oxr_session_frame_end(struct oxr_logger *log, struct oxr_session *sess, const XrFrameEndInfo *frameEndInfo)
Definition: oxr_session_frame_end.c:1645
static XrInstance oxr_instance_to_openxr(struct oxr_instance *inst)
To go back to a OpenXR object.
Definition: oxr_objects.h:232
static XrHandTrackerEXT oxr_hand_tracker_to_openxr(struct oxr_hand_tracker *hand_tracker)
To go back to a OpenXR object.
Definition: oxr_objects.h:403
static XrActionSet oxr_action_set_to_openxr(struct oxr_action_set *act_set)
To go back to a OpenXR object.
Definition: oxr_objects.h:392
bool oxr_classify_subaction_paths(struct oxr_logger *log, const struct oxr_instance *inst, uint32_t subaction_path_count, const XrPath *subaction_paths, struct oxr_subaction_paths *subaction_paths_out)
Helper function to classify subaction_paths.
Definition: oxr_input.c:431
static bool oxr_subaction_paths_is_subset_of(const struct oxr_subaction_paths *a, const struct oxr_subaction_paths *b)
Helper function to determine if the set of paths in a is a subset of the paths in b.
Definition: oxr_objects.h:2172
static XrSession oxr_session_to_openxr(struct oxr_session *sess)
To go back to a OpenXR object.
Definition: oxr_objects.h:803
oxr_session_graphics_ext
What graphics API was this session created with.
Definition: oxr_defines.h:125
static XrAction oxr_action_to_openxr(struct oxr_action *act)
To go back to a OpenXR object.
Definition: oxr_objects.h:427
XrResult oxr_d3d_get_requirements(struct oxr_logger *log, struct oxr_system *sys, LUID *adapter_luid, D3D_FEATURE_LEVEL *min_feature_level)
Common GetRequirements call for D3D11 and D3D12.
Definition: oxr_d3d.cpp:42
bool oxr_xdev_find_input(struct xrt_device *xdev, enum xrt_input_name name, struct xrt_input **out_input)
Return true if it finds an input of that name on this device.
Definition: oxr_xdev.c:90
oxr_space_type
Internal enum for the type of space, lets us reason about action spaces.
Definition: oxr_defines.h:106
XrResult oxr_vk_create_vulkan_instance(struct oxr_logger *log, struct oxr_system *sys, const XrVulkanInstanceCreateInfoKHR *createInfo, VkInstance *vulkanInstance, VkResult *vulkanResult)
Definition: oxr_vulkan.c:230
static void oxr_refcounted_ref(struct oxr_refcounted *orc)
Increase the reference count of orc.
Definition: oxr_objects.h:2512
void oxr_binding_destroy_all(struct oxr_logger *log, struct oxr_instance *inst)
Free all memory allocated by the binding system.
Definition: oxr_binding.c:675
XrResult oxr_session_request_exit(struct oxr_logger *log, struct oxr_session *sess)
Definition: oxr_session.c:426
XrResult(* oxr_handle_destroyer)(struct oxr_logger *log, struct oxr_handle_base *hb)
Function pointer type for a handle destruction function.
Definition: oxr_objects.h:146
void oxr_session_change_state(struct oxr_logger *log, struct oxr_session *sess, XrSessionState state, XrTime time)
Change the state of the session, queues a event.
Definition: oxr_session.c:225
XrResult oxr_system_fill_in(struct oxr_logger *log, struct oxr_instance *inst, XrSystemId systemId, uint32_t view_count, struct oxr_system *sys)
Definition: oxr_system.c:247
XrResult oxr_create_messenger(struct oxr_logger *, struct oxr_instance *inst, const XrDebugUtilsMessengerCreateInfoEXT *, struct oxr_debug_messenger **out_mssngr)
Definition: oxr_messenger.c:41
void oxr_session_binding_destroy_all(struct oxr_logger *log, struct oxr_session *sess)
Free all memory allocated by the binding system.
Definition: oxr_binding.c:683
XrResult oxr_instance_init_system_locked(struct oxr_logger *log, struct oxr_instance *inst)
Must be called with oxr_instance::system_init_lock held.
Definition: oxr_instance.c:470
XrResult oxr_path_get_string(struct oxr_logger *log, const struct oxr_instance *inst, XrPath path, const char **out_str, size_t *out_length)
Get a pointer and length of the internal string.
Definition: oxr_path.c:216
XrResult oxr_session_frame_wait(struct oxr_logger *log, struct oxr_session *sess, XrFrameState *frameState)
Definition: oxr_session.c:878
oxr_handle_state
State of a handle base, to reduce likelihood of going "boom" on out-of-order destruction or other uns...
Definition: oxr_defines.h:48
XrResult oxr_instance_create(struct oxr_logger *log, const XrInstanceCreateInfo *createInfo, XrVersion major_minor, const struct oxr_extension_status *extensions, struct oxr_instance **out_inst)
Creates a instance, does minimal validation of createInfo.
Definition: oxr_instance.c:230
static XrSpace oxr_space_to_openxr(struct oxr_space *spc)
To go back to a OpenXR object.
Definition: oxr_objects.h:920
oxr_subaction_path
Sub action paths.
Definition: oxr_defines.h:65
XrResult oxr_vk_create_vulkan_device(struct oxr_logger *log, struct oxr_system *sys, const XrVulkanDeviceCreateInfoKHR *createInfo, VkDevice *vulkanDevice, VkResult *vulkanResult)
Definition: oxr_vulkan.c:386
const char * oxr_handle_state_to_string(enum oxr_handle_state state)
Returns a human-readable label for a handle state.
Definition: oxr_handle_base.c:42
bool oxr_xdev_find_output(struct xrt_device *xdev, enum xrt_output_name name, struct xrt_output **out_output)
Return true if it finds an output of that name on this device.
Definition: oxr_xdev.c:109
#define XRT_CAST_PTR_TO_OXR_HANDLE(HANDLE_TYPE, PTR)
Cast a pointer to an OpenXR handle in such a way as to avoid warnings.
Definition: oxr_objects.h:76
static XRT_CHECK_RESULT bool xrt_reference_dec_and_is_zero(struct xrt_reference *xref)
Decrement the reference and return true if the value is now zero.
Definition: xrt_defines.h:2251
#define XRT_SYSTEM_MAX_DEVICES
Maximum number of devices simultaneously usable by an implementation of xrt_system_devices.
Definition: xrt_system.h:141
#define XRT_MAX_SWAPCHAIN_IMAGES
Max swapchain images, artificial limit.
Definition: xrt_limits.h:45
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition: xrt_defines.h:1344
static void xrt_reference_inc(struct xrt_reference *xref)
Increment the reference, probably want xrt_reference_inc_and_was_zero.
Definition: xrt_defines.h:2207
xrt_output_name
Name of a output with a baked in type.
Definition: xrt_defines.h:1974
xrt_plane_detector_flags_ext
Flags used when running plane detection.
Definition: xrt_plane_detector.h:46
Wrapper around OS threading native functions.
XrResult oxr_action_get_input_source_localized_name(struct oxr_logger *log, struct oxr_session *sess, const XrInputSourceLocalizedNameGetInfo *getInfo, uint32_t bufferCapacityInput, uint32_t *bufferCountOutput, char *buffer)
Definition: oxr_binding.c:763
Shared internal defines and enums in the state tracker.
Macros for generating extension-related tables and code and inspecting Monado's extension support.
#define OXR_EXTENSION_SUPPORT_GENERATE(_)
Call this, passing a macro taking two parameters, to generate tables, code, etc.
Definition: oxr_extension_support.h:898
The objects that handle session running status and blocking of xrWaitFrame.
#define OXR_PATH_MEMBER(X)
Currently bound interaction profile.
Definition: oxr_objects.h:1945
Provides a utility macro for dealing with subaction paths.
#define OXR_FOR_EACH_SUBACTION_PATH(_)
Expansion macro (x-macro) that calls the macro you pass with the shorthand name of each subaction pat...
Definition: oxr_subaction.h:39
#define OXR_FOR_EACH_VALID_SUBACTION_PATH(_)
Expansion macro (x-macro) that calls the macro you pass with the shorthand name of each valid subacti...
Definition: oxr_subaction.h:23
Definition: m_space.cpp:87
A wrapper around a native mutex.
Definition: os_threading.h:55
Definition: os_time.h:208
Data associated with an Action that has been attached to a Session.
Definition: oxr_objects.h:2325
struct oxr_subaction_paths any_pose_subaction_path
For pose actions any subaction paths are special treated, at bind time we pick one subaction path and...
Definition: oxr_objects.h:2349
struct oxr_action_ref * act_ref
This action's refcounted data.
Definition: oxr_objects.h:2330
struct oxr_action_set_attachment * act_set_attached
The owning action set attachment.
Definition: oxr_objects.h:2327
uint32_t act_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2341
struct oxr_session * sess
The corresponding session.
Definition: oxr_objects.h:2338
The set of inputs/outputs for a single sub-action path for an action.
Definition: oxr_objects.h:2303
A output action pair of a xrt_output_name and a xrt_device.
Definition: oxr_objects.h:2283
The reference-counted data of an action.
Definition: oxr_objects.h:2622
char name[XR_MAX_ACTION_NAME_SIZE]
Application supplied name of this action.
Definition: oxr_objects.h:2626
struct oxr_subaction_paths subaction_paths
Which sub action paths that this action was created with.
Definition: oxr_objects.h:2635
XrActionType action_type
Type this action was created with.
Definition: oxr_objects.h:2632
uint32_t act_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2629
The data associated with the attachment of an Action Set (oxr_action_set) to as Session (oxr_session)...
Definition: oxr_objects.h:2196
struct oxr_action_attachment * act_attachments
An array of action attachments we own.
Definition: oxr_objects.h:2210
struct oxr_session * sess
Owning session.
Definition: oxr_objects.h:2198
struct oxr_action_set_ref * act_set_ref
Action set refcounted data.
Definition: oxr_objects.h:2201
uint32_t act_set_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2204
size_t action_attachment_count
Length of oxr_action_set_attachment::act_attachments.
Definition: oxr_objects.h:2215
struct oxr_subaction_paths requested_subaction_paths
Which sub-action paths are requested on the latest sync.
Definition: oxr_objects.h:2207
The reference-counted data of an action set.
Definition: oxr_objects.h:2540
uint32_t act_set_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2553
char name[XR_MAX_ACTION_SET_NAME_SIZE]
Application supplied name of this action.
Definition: oxr_objects.h:2544
bool ever_attached
Has this action set even been attached to any session, marking it as immutable.
Definition: oxr_objects.h:2550
uint32_t priority
Application supplied action set priority.
Definition: oxr_objects.h:2556
A group of actions.
Definition: oxr_objects.h:2582
struct u_hashset_item * name_item
The item in the name hashset.
Definition: oxr_objects.h:2604
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition: oxr_objects.h:2607
struct oxr_action_set_ref * data
The data for this action set that must live as long as any session we are attached to.
Definition: oxr_objects.h:2593
uint32_t act_set_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2601
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:2584
struct oxr_instance * inst
Owner of this action set.
Definition: oxr_objects.h:2587
The state of a action input.
Definition: oxr_objects.h:2238
bool active
Is this active (bound and providing input)?
Definition: oxr_objects.h:2245
XrTime timestamp
When was this last changed.
Definition: oxr_objects.h:2251
A single action.
Definition: oxr_objects.h:2652
struct oxr_action_set * act_set
Owner of this action.
Definition: oxr_objects.h:2657
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:2654
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition: oxr_objects.h:2674
uint32_t act_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2668
struct u_hashset_item * name_item
The item in the name hashset.
Definition: oxr_objects.h:2671
struct oxr_action_ref * data
The data for this action that must live as long as any session we are attached to.
Definition: oxr_objects.h:2661
Interaction profile binding state.
Definition: oxr_objects.h:2104
uint32_t * preferred_binding_path_index
store which entry in paths was suggested, for each action key
Definition: oxr_objects.h:2116
const char * localized_name
Name presented to the user.
Definition: oxr_objects.h:2109
Debug object created by the client program.
Definition: oxr_objects.h:2685
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:2687
XrDebugUtilsMessageTypeFlagsEXT message_types
Types to submit to this messenger.
Definition: oxr_objects.h:2696
PFN_xrDebugUtilsMessengerCallbackEXT user_callback
Callback function.
Definition: oxr_objects.h:2699
struct oxr_instance * inst
Owner of this messenger.
Definition: oxr_objects.h:2690
void *XR_MAY_ALIAS user_data
Opaque user data.
Definition: oxr_objects.h:2702
XrDebugUtilsMessageSeverityFlagsEXT message_severities
Severities to submit to this messenger.
Definition: oxr_objects.h:2693
dpad binding extracted from XrInteractionProfileDpadBindingEXT
Definition: oxr_objects.h:2036
dpad emulation settings from oxr_interaction_profile
Definition: oxr_objects.h:2070
A entry in the dpad state for one action set.
Definition: oxr_objects.h:2047
dpad settings we need extracted from XrInteractionProfileDpadBindingEXT
Definition: oxr_objects.h:2024
Holds dpad binding state for a single interaction profile.
Definition: oxr_objects.h:2062
Definition: oxr_event.c:30
Structure tracking which extensions are enabled for a given instance.
Definition: oxr_objects.h:1688
Helper that handles synchronizing the xr{Wait,Begin,End}Frame calls.
Definition: oxr_frame_sync.h:36
A hand tracker.
Definition: oxr_objects.h:2737
struct oxr_session * sess
Owner of this hand tracker.
Definition: oxr_objects.h:2742
const struct oxr_hand_tracking_data_source * requested_sources[2]
An ordered list of requested data-source from above options (oxr_hand_tracker::[unobstructed|conformi...
Definition: oxr_objects.h:2755
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:2739
Definition: oxr_objects.h:2706
enum xrt_input_name input_name
the input name associated with this hand tracker
Definition: oxr_objects.h:2711
struct xrt_device * xdev
xrt_device backing this hand tracker
Definition: oxr_objects.h:2708
Used to hold diverse child handles and ensure orderly destruction.
Definition: oxr_objects.h:1459
struct oxr_handle_base * parent
Pointer to this object's parent handle holder, if any.
Definition: oxr_objects.h:1466
uint64_t debug
Magic (per-handle-type) value for debugging.
Definition: oxr_objects.h:1461
struct oxr_handle_base * children[256]
Array of children, if any.
Definition: oxr_objects.h:1471
enum oxr_handle_state state
Current handle state.
Definition: oxr_objects.h:1476
oxr_handle_destroyer destroy
Destroy the object this handle refers to.
Definition: oxr_objects.h:1481
Main object that ties everything together.
Definition: oxr_objects.h:1701
bool disable_vulkan_format_depth
Some applications can't handle depth formats, or they trigger a bug in a specific version of the appl...
Definition: oxr_objects.h:1785
bool parallel_views
For applications that rely on views being parallel, notably some OpenVR games with OpenComposite.
Definition: oxr_objects.h:1810
size_t path_num
Number of paths in the array (0 is always null).
Definition: oxr_objects.h:1740
bool disable_vulkan_format_depth_stencil
Some applications can't handle depth stencil formats, or they trigger a bug in a specific version of ...
Definition: oxr_objects.h:1798
XrVersion major_minor
Stores only major.minor version. Simplifies comparisons for e.g. "at least OpenXR 1....
Definition: oxr_objects.h:1716
bool skip_end_session
Unreal 4 has a bug calling xrEndSession; the function should just exit.
Definition: oxr_objects.h:1801
struct oxr_path ** path_array
Mapping from ID to path.
Definition: oxr_objects.h:1736
bool no_validation_error_in_create_ref_space
Return XR_ERROR_REFERENCE_SPACE_UNSUPPORTED instead of XR_ERROR_VALIDATION_FAILURE in xrCreateReferen...
Definition: oxr_objects.h:1807
size_t path_array_length
Total length of path array.
Definition: oxr_objects.h:1738
struct oxr_extension_status extensions
Enabled extensions.
Definition: oxr_objects.h:1710
struct oxr_debug_messenger * messengers[256]
Debug messengers.
Definition: oxr_objects.h:1817
struct u_hashset * path_store
Path store, for looking up paths.
Definition: oxr_objects.h:1734
struct oxr_instance::@282 openxr_version
The OpenXR version requested in the app info. It determines the instance's OpenXR version.
bool map_stage_to_local_floor
For applications that use stage and don't offer recentering.
Definition: oxr_objects.h:1813
struct oxr_interaction_profile ** profiles
Interaction profile bindings that have been suggested by the client.
Definition: oxr_objects.h:1751
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:1703
A single interaction profile.
Definition: oxr_objects.h:2082
enum xrt_device_name xname
Used to lookup xrt_binding_profile for fallback.
Definition: oxr_objects.h:2086
const char * localized_name
Name presented to the user.
Definition: oxr_objects.h:2089
Logger struct that lives on the stack, one for each call client call.
Definition: oxr_logger.h:40
Internal representation of a path, item follows this struct in memory and that in turn is followed by...
Definition: oxr_path.c:28
Definition: oxr_objects.h:2502
void(* destroy)(struct oxr_refcounted *)
Destruction callback.
Definition: oxr_objects.h:2505
Object that client program interact with.
Definition: oxr_objects.h:1842
struct u_hashmap_int * act_attachments_by_key
A map of action key to action attachment.
Definition: oxr_objects.h:1931
XrResult(* create_swapchain)(struct oxr_logger *, struct oxr_session *sess, const XrSwapchainCreateInfo *, struct oxr_swapchain **)
To pipe swapchain creation to right code.
Definition: oxr_objects.h:1968
struct xrt_compositor_native * xcn
Native compositor that is wrapped by client compositors.
Definition: oxr_objects.h:1854
struct xrt_space_relation local_space_pure_relation
initial relation of head in "global" space.
Definition: oxr_objects.h:1975
struct xrt_session * xs
The xrt_session backing this session.
Definition: oxr_objects.h:1851
XrViewConfigurationType current_view_config_type
This is set in xrBeginSession and is the primaryViewConfiguration argument, this is then used in xrEn...
Definition: oxr_objects.h:1867
struct oxr_action_set_attachment * act_set_attachments
An array of action set attachments that this session owns.
Definition: oxr_objects.h:1905
uint32_t frame_timing_wait_sleep_ms
Extra sleep in wait frame.
Definition: oxr_objects.h:1963
struct os_precise_sleeper sleeper
Used to implement precise extra sleeping in wait frame.
Definition: oxr_objects.h:1897
enum oxr_session_graphics_ext gfx_ext
What graphics type was this session created with.
Definition: oxr_objects.h:1848
size_t profiles_on_attachment_size
Clone of all suggested binding profiles at the point of action set/session attachment.
Definition: oxr_objects.h:1937
bool has_ended_once
There is a extra state between xrBeginSession has been called and the first xrEndFrame has been calle...
Definition: oxr_objects.h:1873
struct u_hashmap_int * act_sets_attachments_by_key
A map of action set key to action set attachments.
Definition: oxr_objects.h:1919
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:1844
float ipd_meters
IPD, to be expanded to a proper 3D relation.
Definition: oxr_objects.h:1955
size_t action_set_attachment_count
Length of oxr_session::act_set_attachments.
Definition: oxr_objects.h:1910
bool frame_timing_spew
Frame timing debug output.
Definition: oxr_objects.h:1960
Can be one of several reference space types, or a space that is bound to an action.
Definition: oxr_objects.h:2397
struct oxr_subaction_paths subaction_paths
Which sub action path is this?
Definition: oxr_objects.h:2414
enum oxr_space_type space_type
What kind of space is this?
Definition: oxr_objects.h:2411
uint32_t act_key
Action key from which action this space was created from.
Definition: oxr_objects.h:2408
struct xrt_pose pose
Pose that was given during creation.
Definition: oxr_objects.h:2405
struct oxr_session * sess
Owner of this space.
Definition: oxr_objects.h:2402
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:2399
A parsed equivalent of a list of sub-action paths.
Definition: oxr_objects.h:2159
A set of images used for rendering.
Definition: oxr_objects.h:2438
struct oxr_session * sess
Owner of this swapchain.
Definition: oxr_objects.h:2443
uint32_t face_count
The number of cubemap faces. 6 for cubemaps, 1 otherwise.
Definition: oxr_objects.h:2455
struct xrt_swapchain * swapchain
Compositor swapchain.
Definition: oxr_objects.h:2446
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:2440
uint32_t width
Swapchain size.
Definition: oxr_objects.h:2449
uint32_t array_layer_count
For 1 is 2D texture, greater then 1 2D array texture.
Definition: oxr_objects.h:2452
Single or multiple devices grouped together to form a system that sessions can be created from.
Definition: oxr_objects.h:1512
struct xrt_system * xsys
The XRT interfaces level system.
Definition: oxr_objects.h:1516
VkPhysicalDevice suggested_vulkan_physical_device
The device returned with the last xrGetVulkanGraphicsDeviceKHR or xrGetVulkanGraphicsDevice2KHR call.
Definition: oxr_objects.h:1553
PFN_vkGetInstanceProcAddr vk_get_instance_proc_addr
Stores the vkGetInstanceProcAddr passed to xrCreateVulkanInstanceKHR to be used when looking up Vulka...
Definition: oxr_objects.h:1559
struct xrt_system_devices * xsysd
System devices used in all session types.
Definition: oxr_objects.h:1519
struct xrt_space_overseer * xso
Space overseer used in all session types.
Definition: oxr_objects.h:1522
VkInstance vulkan_enable2_instance
The instance/device we create when vulkan_enable2 is used.
Definition: oxr_objects.h:1550
bool gotten_requirements
Have the client application called the gfx api requirements func?
Definition: oxr_objects.h:1530
struct xrt_system_compositor * xsysc
System compositor, used to create session compositors.
Definition: oxr_objects.h:1525
struct xrt_system_roles dynamic_roles_cache
Cache of the last known system roles, see xrt_system_roles::generation_id.
Definition: oxr_objects.h:1539
Holds the properties that a system supports for a view configuration type.
Definition: oxr_objects.h:1490
Time-keeping state structure.
Definition: u_time.cpp:30
A simple uint64_t key to a void pointer hashmap.
Definition: u_hashmap.cpp:24
A embeddable hashset item, note that the string directly follows the u_hashset_item.
Definition: u_hashset.h:37
Kind of bespoke hashset implementation, where the user is responsible for allocating and freeing the ...
Definition: u_hashset.cpp:26
Definition: u_index_fifo.h:21
Definition: xrt_defines.h:1957
Main compositor server interface.
Definition: xrt_compositor.h:2227
Common compositor client interface/base.
Definition: xrt_compositor.h:991
A single HMD or input device.
Definition: xrt_device.h:284
enum xrt_device_name name
Enum identifier of the device.
Definition: xrt_device.h:286
The (future) result of an asynchronous operation.
Definition: xrt_future.h:38
A future is a concurrency primitive that provides a mechanism to access results of asynchronous opera...
Definition: xrt_future.h:74
This interface acts as a root object for Monado.
Definition: xrt_instance.h:119
A single named output, that sits on a xrt_device.
Definition: xrt_device.h:183
Each plane has n polygons; ultimately plane metadata from locations and vetices is reconstructed.
Definition: xrt_plane_detector.h:171
A pose composed of a position and orientation.
Definition: xrt_defines.h:479
A base class for reference counted objects.
Definition: xrt_defines.h:99
The XRT representation of XrSession, this object does not have all of the functionality of a session,...
Definition: xrt_session.h:259
Object that oversees and manages spaces, one created for each XR system.
Definition: xrt_space.h:96
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:670
A space very similar to a OpenXR XrSpace but not a full one-to-one mapping, but used to power XrSpace...
Definition: xrt_space.h:31
Common swapchain interface/base.
Definition: xrt_compositor.h:540
The system compositor handles composition for a system.
Definition: xrt_compositor.h:2438
A collection of xrt_device, and an interface for identifying the roles they have been assigned.
Definition: xrt_system.h:221
struct xrt_system_devices::@257::@258 hand_tracking
Devices providing optical (or otherwise more directly measured than from controller estimation) hand ...
struct xrt_device * head
An observing pointer to the device serving as the "head" (and HMD).
Definition: xrt_system.h:250
struct xrt_device * face
An observing pointer to the device providing face tracking (optional).
Definition: xrt_system.h:262
struct xrt_device * eyes
An observing pointer to the device providing eye tracking (optional).
Definition: xrt_system.h:256
struct xrt_device * left
An observing pointer to the device providing unobstructed hand-tracking for the left hand (optional).
Definition: xrt_system.h:285
struct xrt_system_devices::@257 static_roles
Observing pointers for devices in some static (unchangeable) roles.
struct xrt_device * right
An observing pointer to the device providing unobstructed hand-tracking for the right hand (optional)...
Definition: xrt_system.h:294
struct xrt_device * body
An observing pointer to the device providing body tracking (optional).
Definition: xrt_system.h:268
Data associating a device index (in xrt_system_devices::xdevs) with a given "role" for dynamic role s...
Definition: xrt_system.h:161
A system is a collection of devices, policies and optionally a compositor that is organised into a ch...
Definition: xrt_system.h:62
Visibility mask helper, the indices and vertices are tightly packed after this struct.
Definition: xrt_visibility_mask.h:25
Misc helpers for device drivers.
Hashmap for integer values header.
Header holding Android-specific details.
xrt_android_lifecycle_event
Distinguishes the possible Android lifecycle events from each other.
Definition: xrt_android.h:32
Header declaring XRT graphics interfaces.
Auto detect OS and certain features.
xrt_perf_notify_level
Performance level.
Definition: xrt_defines.h:2161
xrt_device_name
A enum that is used to name devices so that the state trackers can reason about the devices easier.
Definition: xrt_defines.h:724
xrt_perf_domain
Domain type.
Definition: xrt_defines.h:2134
Header defining an xrt display or controller device.
Interface for creating futures.
Header for limits of the XRT interfaces.
Include all of the openxr headers in one place.
Header defining xrt space and space overseer.
Header for system objects.
Header defining the tracking system integration in Monado.
Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.