Monado OpenXR Runtime

Gets called from OpenXR entrypoints functions and talks to devices and Compositor using XRT interfaces. More...

Collaboration diagram for OpenXR main code:

Modules

 OpenXR input
 The action-set/action-based input subsystem of OpenXR.
 

Files

file  oxr_binding.c
 Holds binding related functions.
 
file  oxr_body_tracking.c
 body tracking related API entrypoint functions.
 
file  oxr_conversions.h
 Smaller helper functions to convert between xrt and OpenXR things.
 
file  oxr_d3d.cpp
 D3D 11 and 12 shared routines.
 
file  oxr_d3d11.cpp
 Holds D3D11 related functions that didn't fit somewhere else.
 
file  oxr_d3d12.cpp
 Holds D3D12 related functions that didn't fit somewhere else.
 
file  oxr_defines.h
 Shared internal defines and enums in the state tracker.
 
file  oxr_dpad.c
 Holds binding related functions.
 
file  oxr_event.c
 Holds event related functions.
 
file  oxr_face_tracking.c
 face tracking related API entrypoint functions.
 
file  oxr_face_tracking2_fb.c
 face tracking related API entrypoint functions.
 
file  oxr_frame_sync.c
 The objects that handle session running status and blocking of xrWaitFrame.
 
file  oxr_frame_sync.h
 The objects that handle session running status and blocking of xrWaitFrame.
 
file  oxr_handle.h
 Contains handle-related functions and defines only required in a few locations.
 
file  oxr_input.c
 Holds input related functions.
 
file  oxr_instance.c
 Holds instance related functions.
 
file  oxr_logger.c
 Logging functions.
 
file  oxr_logger.h
 Logging functions.
 
file  oxr_messenger.c
 Holds debug utils/messenger related functions.
 
file  oxr_objects.h
 The objects representing OpenXR handles, and prototypes for internal functions used in the state tracker.
 
file  oxr_passthrough.c
 passthrough related API entrypoint functions.
 
file  oxr_path.c
 Holds path related functions.
 
file  oxr_pretty_print.c
 Pretty printing functions.
 
file  oxr_pretty_print.h
 Pretty printing functions.
 
file  oxr_session.c
 Holds session related functions.
 
file  oxr_session_frame_end.c
 Holds session end frame functions.
 
file  oxr_session_gfx_d3d11.c
 Holds D3D11 specific session functions.
 
file  oxr_session_gfx_d3d12.c
 Holds D3D12 specific session functions.
 
file  oxr_session_gfx_egl.c
 Holds OpenGL-specific session functions.
 
file  oxr_session_gfx_gl_win32.c
 Holds OpenGL-specific session functions for Windows.
 
file  oxr_session_gfx_gl_xlib.c
 Holds OpenGL-specific session functions.
 
file  oxr_session_gfx_gles_android.c
 Holds OpenGLES-specific session functions.
 
file  oxr_session_gfx_vk.c
 Holds Vulkan specific session functions.
 
file  oxr_space.c
 So much space!
 
file  oxr_swapchain.c
 Holds swapchain related functions.
 
file  oxr_swapchain_common.h
 Helper functions for oxr_swapchain functions.
 
file  oxr_swapchain_d3d11.c
 Holds D3D11 swapchain related functions.
 
file  oxr_swapchain_d3d12.c
 Holds D3D12 swapchain related functions.
 
file  oxr_swapchain_gl.c
 Holds OpenGL swapchain related functions.
 
file  oxr_swapchain_vk.c
 Holds Vulkan swapchain related functions.
 
file  oxr_system.c
 Holds system related entrypoints.
 
file  oxr_two_call.h
 Two call helper functions.
 
file  oxr_verify.c
 File for verifying app input into api functions.
 
file  oxr_vulkan.c
 Holds Vulkan related functions.
 
file  oxr_xdev.c
 Various helpers for accessing xrt_device.
 
file  oxr_xret.h
 File holding helper for xrt_result_t results.
 

Data Structures

struct  oxr_logger
 Logger struct that lives on the stack, one for each call client call. More...
 
struct  oxr_sink_logger
 Allocate on the stack, make sure to zero initialize. More...
 
struct  oxr_handle_base
 Used to hold diverse child handles and ensure orderly destruction. More...
 
struct  oxr_system
 Single or multiple devices grouped together to form a system that sessions can be created from. More...
 
struct  oxr_extension_status
 Structure tracking which extensions are enabled for a given instance. More...
 
struct  oxr_instance
 Main object that ties everything together. More...
 
struct  oxr_session
 Object that client program interact with. More...
 
struct  oxr_dpad_settings
 dpad settings we need extracted from XrInteractionProfileDpadBindingEXT More...
 
struct  oxr_dpad_binding_modification
 dpad binding extracted from XrInteractionProfileDpadBindingEXT More...
 
struct  oxr_dpad_entry
 A entry in the dpad state for one action set. More...
 
struct  oxr_dpad_state
 Holds dpad binding state for a single interaction profile. More...
 
struct  oxr_dpad_emulation
 dpad emulation settings from oxr_interaction_profile More...
 
struct  oxr_interaction_profile
 A single interaction profile. More...
 
struct  oxr_binding
 Interaction profile binding state. More...
 
struct  oxr_subaction_paths
 A parsed equivalent of a list of sub-action paths. More...
 
struct  oxr_action_set_attachment
 The data associated with the attachment of an Action Set (oxr_action_set) to as Session (oxr_session). More...
 
struct  oxr_action_state
 The state of a action input. More...
 
struct  oxr_action_input
 A input action pair of a xrt_input and a xrt_device, along with the required transform. More...
 
struct  oxr_action_output
 A output action pair of a xrt_output_name and a xrt_device. More...
 
struct  oxr_action_cache
 The set of inputs/outputs for a single sub-action path for an action. More...
 
struct  oxr_action_attachment
 Data associated with an Action that has been attached to a Session. More...
 
struct  oxr_space
 Can be one of several reference space types, or a space that is bound to an action. More...
 
struct  oxr_swapchain
 A set of images used for rendering. More...
 
struct  oxr_refcounted
 
struct  oxr_action_set_ref
 The reference-counted data of an action set. More...
 
struct  oxr_action_set
 A group of actions. More...
 
struct  oxr_action_ref
 The reference-counted data of an action. More...
 
struct  oxr_action
 A single action. More...
 
struct  oxr_debug_messenger
 Debug object created by the client program. More...
 
struct  oxr_hand_tracker
 A hand tracker. More...
 
struct  oxr_path
 Internal representation of a path, item follows this struct in memory and that in turn is followed by the string. More...
 

Macros

#define OXR_WARN_ONCE(log, ...)
 Helper macro to log a warning just once. More...
 
#define XRT_MAX_HANDLE_CHILDREN   256
 
#define OXR_MAX_BINDINGS_PER_ACTION   32
 
#define OXR_XRT_POSE_TO_XRPOSEF(FROM, TO)
 Safely copy an xrt_pose to an XrPosef. More...
 
#define OXR_XRT_FOV_TO_XRFOVF(FROM, TO)
 Safely copy an xrt_fov to an XrFovf. More...
 
#define OXR_CHECK_XRET(LOG, SESS, RESULTS, FUNCTION)
 Helper define to check results from 'xrt_` functions (xrt_result_t) and also set any needed state. More...
 

Typedefs

typedef XrResult(* oxr_handle_destroyer) (struct oxr_logger *log, struct oxr_handle_base *hb)
 Function pointer type for a handle destruction function. More...
 

Enumerations

enum  oxr_handle_state { OXR_HANDLE_STATE_UNINITIALIZED = 0 , OXR_HANDLE_STATE_LIVE , OXR_HANDLE_STATE_DESTROYED }
 State of a handle base, to reduce likelihood of going "boom" on out-of-order destruction or other unsavory behavior. More...
 
enum  oxr_subaction_path {
  OXR_SUB_ACTION_PATH_USER , OXR_SUB_ACTION_PATH_HEAD , OXR_SUB_ACTION_PATH_LEFT , OXR_SUB_ACTION_PATH_RIGHT ,
  OXR_SUB_ACTION_PATH_GAMEPAD , OXR_SUB_ACTION_PATH_EYES
}
 Sub action paths. More...
 
enum  oxr_dpad_region {
  OXR_DPAD_REGION_CENTER = 0u , OXR_DPAD_REGION_UP = (1u << 0u) , OXR_DPAD_REGION_DOWN = (1u << 1u) , OXR_DPAD_REGION_LEFT = (1u << 2u) ,
  OXR_DPAD_REGION_RIGHT = (1u << 3u)
}
 Region of a dpad binding that an input is mapped to. More...
 
enum  oxr_image_state { OXR_IMAGE_STATE_READY , OXR_IMAGE_STATE_ACQUIRED , OXR_IMAGE_STATE_WAITED }
 Tracks the state of a image that belongs to a oxr_swapchain. More...
 
enum  oxr_space_type {
  OXR_SPACE_TYPE_REFERENCE_VIEW , OXR_SPACE_TYPE_REFERENCE_LOCAL , OXR_SPACE_TYPE_REFERENCE_LOCAL_FLOOR , OXR_SPACE_TYPE_REFERENCE_STAGE ,
  OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_MSFT , OXR_SPACE_TYPE_REFERENCE_COMBINED_EYE_VARJO , OXR_SPACE_TYPE_REFERENCE_LOCALIZATION_MAP_ML , OXR_SPACE_TYPE_ACTION ,
  OXR_SPACE_TYPE_XDEV_POSE
}
 Internal enum for the type of space, lets us reason about action spaces. More...
 
enum  oxr_session_graphics_ext {
  OXR_SESSION_GRAPHICS_EXT_HEADLESS , OXR_SESSION_GRAPHICS_EXT_VULKAN , OXR_SESSION_GRAPHICS_EXT_D3D11 , OXR_SESSION_GRAPHICS_EXT_D3D12 ,
  OXR_SESSION_GRAPHICS_EXT_WIN32_GL , OXR_SESSION_GRAPHICS_EXT_XLIB_GL , OXR_SESSION_GRAPHICS_EXT_ANDROID_GLES , OXR_SESSION_GRAPHICS_EXT_EGL
}
 What graphics API was this session created with. More...
 

Functions

void oxr_log_init (struct oxr_logger *logger, const char *api_func_name)
 
void oxr_log_set_instance (struct oxr_logger *logger, struct oxr_instance *inst)
 
void oxr_log (struct oxr_logger *logger, const char *fmt,...) XRT_PRINTF_FORMAT(2
 
void void oxr_warn (struct oxr_logger *logger, const char *fmt,...) XRT_PRINTF_FORMAT(2
 
void void XrResult oxr_error (struct oxr_logger *logger, XrResult result, const char *fmt,...) XRT_PRINTF_FORMAT(3
 Output an error and return the result code. More...
 
void oxr_slog (struct oxr_sink_logger *slog, const char *fmt,...) XRT_PRINTF_FORMAT(2
 Log string to sink logger. More...
 
void void oxr_slog_add_array (struct oxr_sink_logger *slog, const char *str, size_t size)
 Add the string to the slog struct. More...
 
static u_pp_delegate_t oxr_slog_dg (struct oxr_sink_logger *slog)
 Get a pretty print delegate from a oxr_sink_logger. More...
 
void oxr_slog_cancel (struct oxr_sink_logger *slog)
 Cancel logging, frees all internal data. More...
 
void oxr_log_slog (struct oxr_logger *log, struct oxr_sink_logger *slog)
 Flush sink as a log message, frees all internal data. More...
 
void oxr_warn_slog (struct oxr_logger *log, struct oxr_sink_logger *slog)
 Flush sink as a warning message, frees all internal data. More...
 
XrResult oxr_error_slog (struct oxr_logger *log, XrResult res, struct oxr_sink_logger *slog)
 Flush sink as a error message, frees all internal data. More...
 
static bool oxr_space_type_is_reference (enum oxr_space_type space_type)
 
static void oxr_refcounted_ref (struct oxr_refcounted *orc)
 Increase the reference count of orc. More...
 
static void oxr_refcounted_unref (struct oxr_refcounted *orc)
 Decrease the reference count of orc, destroying it if it reaches 0. More...
 
void oxr_pp_fov_indented_as_object (struct oxr_sink_logger *slog, const struct xrt_fov *fov, const char *name)
 Prints a fov to a oxr_sink_logger, on the form of \n\t${name}->fov .... More...
 
void oxr_pp_pose_indented_as_object (struct oxr_sink_logger *slog, const struct xrt_pose *pose, const char *name)
 Prints a pose to a oxr_sink_logger, on the form of \n\t${name}->pose .... More...
 
void oxr_pp_space_indented (struct oxr_sink_logger *slog, const struct oxr_space *spc, const char *name)
 Prints a space to a oxr_sink_logger, on the form of \n\t${name}-><field> .... More...
 
void oxr_pp_relation_indented (struct oxr_sink_logger *slog, const struct xrt_space_relation *relation, const char *name)
 Prints a space to a oxr_sink_logger, on the form of \n\t${name}-><field> .... More...
 
XrResult oxr_handle_base::oxr_handle_destroy (struct oxr_logger *log, struct oxr_handle_base *hb)
 Destroy the handle's object, as well as all child handles recursively. More...
 
const char * oxr_handle_state_to_string (enum oxr_handle_state state)
 Returns a human-readable label for a handle state. More...
 
static XrActionSet oxr_action_set_to_openxr (struct oxr_action_set *act_set)
 To go back to a OpenXR object. More...
 
static XrHandTrackerEXT oxr_hand_tracker_to_openxr (struct oxr_hand_tracker *hand_tracker)
 To go back to a OpenXR object. More...
 
static XrAction oxr_action_to_openxr (struct oxr_action *act)
 To go back to a OpenXR object. More...
 

oxr_input.c

XrResult oxr_session_update_action_bindings (struct oxr_logger *log, struct oxr_session *sess)
 
bool oxr_instance::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. More...
 
XrResult oxr_session::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. More...
 
XrResult oxr_instance::oxr_action_set_create (struct oxr_logger *log, struct oxr_instance *inst, const XrActionSetCreateInfo *createInfo, struct oxr_action_set **out_act_set)
 
XrResult oxr_action::oxr_action_create (struct oxr_logger *log, struct oxr_action_set *act_set, const XrActionCreateInfo *createInfo, struct oxr_action **out_act)
 
XrResult oxr_session::oxr_session_attach_action_sets (struct oxr_logger *log, struct oxr_session *sess, const XrSessionActionSetsAttachInfo *bindInfo)
 
XrResult oxr_session::oxr_action_sync_data (struct oxr_logger *log, struct oxr_session *sess, uint32_t countActionSets, const XrActiveActionSet *actionSets)
 
XrResult oxr_session::oxr_action_enumerate_bound_sources (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, uint32_t sourceCapacityInput, uint32_t *sourceCountOutput, XrPath *sources)
 
XrResult oxr_session::oxr_action_get_boolean (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths, XrActionStateBoolean *data)
 
XrResult oxr_session::oxr_action_get_vector1f (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths, XrActionStateFloat *data)
 
XrResult oxr_session::oxr_action_get_vector2f (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths, XrActionStateVector2f *data)
 
XrResult oxr_session::oxr_action_get_pose (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths, XrActionStatePose *data)
 
XrResult oxr_session::oxr_action_apply_haptic_feedback (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths, const XrHapticBaseHeader *hapticEvent)
 
XrResult oxr_session::oxr_action_stop_haptic_feedback (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths)
 
XrResult oxr_instance::oxr_hand_tracker_create (struct oxr_logger *log, struct oxr_session *sess, const XrHandTrackerCreateInfoEXT *createInfo, struct oxr_hand_tracker **out_hand_tracker)
 

oxr_binding.c

void oxr_get_profile_for_device_name (struct oxr_logger *log, struct oxr_session *sess, enum xrt_device_name name, struct oxr_interaction_profile **out_p)
 
struct oxr_interaction_profileoxr_clone_profile (const struct oxr_interaction_profile *src_profile)
 
void oxr_session::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. More...
 
void oxr_instance::oxr_binding_destroy_all (struct oxr_logger *log, struct oxr_instance *inst)
 Free all memory allocated by the binding system. More...
 
void oxr_instance::oxr_session_binding_destroy_all (struct oxr_logger *log, struct oxr_session *sess)
 Free all memory allocated by the binding system. More...
 
void oxr_interaction_profile::oxr_binding_find_bindings_from_key (struct oxr_logger *log, struct oxr_interaction_profile *p, uint32_t key, size_t max_bounding_count, struct oxr_binding **bindings, size_t *out_binding_count)
 Find all bindings that is the given action key is bound to. More...
 
XrResult oxr_instance::oxr_action_suggest_interaction_profile_bindings (struct oxr_logger *log, struct oxr_instance *inst, const XrInteractionProfileSuggestedBinding *suggestedBindings, struct oxr_dpad_state *state)
 
XrResult oxr_instance::oxr_action_get_current_interaction_profile (struct oxr_logger *log, struct oxr_session *sess, XrPath topLevelUserPath, XrInteractionProfileState *interactionProfile)
 
XrResult oxr_session::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)
 

oxr_session.c

XrResult oxr_session_create (struct oxr_logger *log, struct oxr_system *sys, const XrSessionCreateInfo *createInfo, struct oxr_session **out_session)
 
XrResult oxr_session_enumerate_formats (struct oxr_logger *log, struct oxr_session *sess, uint32_t formatCapacityInput, uint32_t *formatCountOutput, int64_t *formats)
 
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. More...
 
XrResult oxr_session_begin (struct oxr_logger *log, struct oxr_session *sess, const XrSessionBeginInfo *beginInfo)
 
XrResult oxr_session_end (struct oxr_logger *log, struct oxr_session *sess)
 
XrResult oxr_session_request_exit (struct oxr_logger *log, struct oxr_session *sess)
 
XRT_CHECK_RESULT XrResult oxr_session_poll (struct oxr_logger *log, struct oxr_session *sess)
 
XrResult oxr_session_locate_views (struct oxr_logger *log, struct oxr_session *sess, const XrViewLocateInfo *viewLocateInfo, XrViewState *viewState, uint32_t viewCapacityInput, uint32_t *viewCountOutput, XrView *views)
 
XrResult oxr_session_frame_wait (struct oxr_logger *log, struct oxr_session *sess, XrFrameState *frameState)
 
XrResult oxr_session_frame_begin (struct oxr_logger *log, struct oxr_session *sess)
 
XrResult oxr_session_frame_end (struct oxr_logger *log, struct oxr_session *sess, const XrFrameEndInfo *frameEndInfo)
 
XrResult oxr_session_hand_joints (struct oxr_logger *log, struct oxr_hand_tracker *hand_tracker, const XrHandJointsLocateInfoEXT *locateInfo, XrHandJointLocationsEXT *locations)
 
XrResult oxr_get_base_body_pose (struct oxr_logger *log, const struct xrt_body_joint_set *body_joint_set, struct oxr_space *base_spc, struct xrt_device *body_xdev, XrTime at_time, struct xrt_space_relation *out_base_body)
 
XrResult oxr_session_apply_force_feedback (struct oxr_logger *log, struct oxr_hand_tracker *hand_tracker, const XrForceFeedbackCurlApplyLocationsMNDX *locations)
 
static XrSpace oxr_space_to_openxr (struct oxr_space *spc)
 To go back to a OpenXR object. More...
 
XrResult oxr_space_action_create (struct oxr_logger *log, struct oxr_session *sess, uint32_t key, const XrActionSpaceCreateInfo *createInfo, struct oxr_space **out_space)
 
XrResult oxr_space_get_reference_bounds_rect (struct oxr_logger *log, struct oxr_session *sess, XrReferenceSpaceType referenceSpaceType, XrExtent2Df *bounds)
 
XrResult oxr_space_reference_create (struct oxr_logger *log, struct oxr_session *sess, const XrReferenceSpaceCreateInfo *createInfo, struct oxr_space **out_space)
 
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 bypass the action binding system for instance. More...
 
XrResult oxr_space_locate (struct oxr_logger *log, struct oxr_space *spc, struct oxr_space *baseSpc, XrTime time, XrSpaceLocation *location)
 
XrResult oxr_spaces_locate (struct oxr_logger *log, struct oxr_space **spcs, uint32_t spc_count, struct oxr_space *baseSpc, XrTime time, XrSpaceLocations *locations)
 
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 ups and the like. More...
 
static XrSwapchain oxr_swapchain_to_openxr (struct oxr_swapchain *sc)
 To go back to a OpenXR object. More...
 
static XrDebugUtilsMessengerEXT oxr_messenger_to_openxr (struct oxr_debug_messenger *mssngr)
 To go back to a OpenXR object. More...
 
XrResult oxr_create_messenger (struct oxr_logger *, struct oxr_instance *inst, const XrDebugUtilsMessengerCreateInfoEXT *, struct oxr_debug_messenger **out_mssngr)
 
XrResult oxr_destroy_messenger (struct oxr_logger *log, struct oxr_debug_messenger *mssngr)
 
XrResult oxr_system_select (struct oxr_logger *log, struct oxr_system **systems, uint32_t system_count, XrFormFactor form_factor, struct oxr_system **out_selected)
 
XrResult oxr_system_fill_in (struct oxr_logger *log, struct oxr_instance *inst, XrSystemId systemId, uint32_t view_count, struct oxr_system *sys)
 
XrResult oxr_system_verify_id (struct oxr_logger *log, const struct oxr_instance *inst, XrSystemId systemId)
 
XrResult oxr_system_get_by_id (struct oxr_logger *log, struct oxr_instance *inst, XrSystemId systemId, struct oxr_system **system)
 
XrResult oxr_system_get_properties (struct oxr_logger *log, struct oxr_system *sys, XrSystemProperties *properties)
 
XrResult oxr_system_enumerate_view_confs (struct oxr_logger *log, struct oxr_system *sys, uint32_t viewConfigurationTypeCapacityInput, uint32_t *viewConfigurationTypeCountOutput, XrViewConfigurationType *viewConfigurationTypes)
 
XrResult oxr_system_enumerate_blend_modes (struct oxr_logger *log, struct oxr_system *sys, XrViewConfigurationType viewConfigurationType, uint32_t environmentBlendModeCapacityInput, uint32_t *environmentBlendModeCountOutput, XrEnvironmentBlendMode *environmentBlendModes)
 
XrResult oxr_system_get_view_conf_properties (struct oxr_logger *log, struct oxr_system *sys, XrViewConfigurationType viewConfigurationType, XrViewConfigurationProperties *configurationProperties)
 
XrResult oxr_system_enumerate_view_conf_views (struct oxr_logger *log, struct oxr_system *sys, XrViewConfigurationType viewConfigurationType, uint32_t viewCapacityInput, uint32_t *viewCountOutput, XrViewConfigurationView *views)
 
bool oxr_system_get_hand_tracking_support (struct oxr_logger *log, struct oxr_instance *inst)
 
bool oxr_system_get_eye_gaze_support (struct oxr_logger *log, struct oxr_instance *inst)
 
bool oxr_system_get_force_feedback_support (struct oxr_logger *log, struct oxr_instance *inst)
 
void oxr_system_get_face_tracking_htc_support (struct oxr_logger *log, struct oxr_instance *inst, bool *supports_eye, bool *supports_lip)
 
void oxr_system_get_face_tracking2_fb_support (struct oxr_logger *log, struct oxr_instance *inst, bool *supports_audio, bool *supports_visual)
 
bool oxr_system_get_body_tracking_fb_support (struct oxr_logger *log, struct oxr_instance *inst)
 
XrResult oxr_event_push_XrEventDataSessionStateChanged (struct oxr_logger *log, struct oxr_session *sess, XrSessionState state, XrTime time)
 
XrResult oxr_event_push_XrEventDataInteractionProfileChanged (struct oxr_logger *log, struct oxr_session *sess)
 
XrResult oxr_event_push_XrEventDataReferenceSpaceChangePending (struct oxr_logger *log, struct oxr_session *sess, XrReferenceSpaceType referenceSpaceType, XrTime changeTime, XrBool32 poseValid, const XrPosef *poseInPreviousSpace)
 
XrResult oxr_event_remove_session_events (struct oxr_logger *log, struct oxr_session *sess)
 This clears all pending events refers to the given session. More...
 
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. More...
 
void oxr_xdev_destroy (struct xrt_device **xdev_ptr)
 
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. More...
 
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. More...
 
void oxr_xdev_get_hand_tracking_at (struct oxr_logger *log, struct oxr_instance *inst, struct xrt_device *xdev, enum xrt_input_name name, XrTime at_time, struct xrt_hand_joint_set *out_value)
 Returns the hand tracking value of the named input from the device. More...
 
XrResult oxr_session_populate_gl_xlib (struct oxr_logger *log, struct oxr_system *sys, XrGraphicsBindingOpenGLXlibKHR const *next, struct oxr_session *sess)
 
XrResult oxr_swapchain_gl_create (struct oxr_logger *, struct oxr_session *sess, const XrSwapchainCreateInfo *, struct oxr_swapchain **out_swapchain)
 
XrResult oxr_vk_get_instance_exts (struct oxr_logger *log, struct oxr_system *sys, uint32_t namesCapacityInput, uint32_t *namesCountOutput, char *namesString)
 
XrResult oxr_vk_get_device_exts (struct oxr_logger *log, struct oxr_system *sys, uint32_t namesCapacityInput, uint32_t *namesCountOutput, char *namesString)
 
XrResult oxr_vk_get_requirements (struct oxr_logger *log, struct oxr_system *sys, XrGraphicsRequirementsVulkanKHR *graphicsRequirements)
 
XrResult oxr_vk_create_vulkan_instance (struct oxr_logger *log, struct oxr_system *sys, const XrVulkanInstanceCreateInfoKHR *createInfo, VkInstance *vulkanInstance, VkResult *vulkanResult)
 
XrResult oxr_vk_create_vulkan_device (struct oxr_logger *log, struct oxr_system *sys, const XrVulkanDeviceCreateInfoKHR *createInfo, VkDevice *vulkanDevice, VkResult *vulkanResult)
 
XrResult oxr_vk_get_physical_device (struct oxr_logger *log, struct oxr_instance *inst, struct oxr_system *sys, VkInstance vkInstance, PFN_vkGetInstanceProcAddr getProc, VkPhysicalDevice *vkPhysicalDevice)
 
XrResult oxr_session_populate_vk (struct oxr_logger *log, struct oxr_system *sys, XrGraphicsBindingVulkanKHR const *next, struct oxr_session *sess)
 
XrResult oxr_swapchain_vk_create (struct oxr_logger *, struct oxr_session *sess, const XrSwapchainCreateInfo *, struct oxr_swapchain **out_swapchain)
 
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. More...
 
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. More...
 
static struct xrt_deviceget_role_head (struct oxr_system *sys)
 
static struct xrt_deviceget_role_eyes (struct oxr_system *sys)
 
static struct xrt_deviceget_role_face (struct oxr_system *sys)
 
static struct xrt_deviceget_role_body (struct oxr_system *sys)
 
static struct xrt_deviceget_role_hand_tracking_left (struct oxr_system *sys)
 
static struct xrt_deviceget_role_hand_tracking_right (struct oxr_system *sys)
 
static struct xrt_deviceget_role_left (struct oxr_system *sys)
 
static struct xrt_deviceget_role_right (struct oxr_system *sys)
 
static struct xrt_deviceget_role_gamepad (struct oxr_system *sys)
 
static enum xrt_device_name get_role_profile_head (struct oxr_system *sys)
 
static enum xrt_device_name get_role_profile_eyes (struct oxr_system *sys)
 
static enum xrt_device_name get_role_profile_face (struct oxr_system *sys)
 
static enum xrt_device_name get_role_profile_body (struct oxr_system *sys)
 
static enum xrt_device_name get_role_profile_hand_tracking_left (struct oxr_system *sys)
 
static enum xrt_device_name get_role_profile_hand_tracking_right (struct oxr_system *sys)
 
static enum xrt_device_name get_role_profile_left (struct oxr_system *sys)
 
static enum xrt_device_name get_role_profile_right (struct oxr_system *sys)
 
static enum xrt_device_name get_role_profile_gamepad (struct oxr_system *sys)
 
static XrSession oxr_session_to_openxr (struct oxr_session *sess)
 To go back to a OpenXR object. More...
 
static XrResult oxr_session::oxr_session_success_result (struct oxr_session *session)
 Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate. More...
 
static XrResult oxr_session::oxr_session_success_focused_result (struct oxr_session *session)
 Returns XR_SUCCESS, XR_SESSION_LOSS_PENDING, or XR_SESSION_NOT_FOCUSED, as appropriate. More...
 
static bool oxr_subaction_paths::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. More...
 
void oxr_action_set_attachment::oxr_action_set_attachment_teardown (struct oxr_action_set_attachment *act_set_attached)
 De-initialize an action set attachment and its action attachments. More...
 
#define MAKE_GET_DYN_ROLES_FN(ROLE)
 
#define GET_XDEV_BY_ROLE(SYS, ROLE)   (get_role_##ROLE((SYS)))
 
#define MAKE_GET_DYN_ROLE_PROFILE_FN(ROLE)
 
#define GET_PROFILE_NAME_BY_ROLE(SYS, ROLE)   (get_role_profile_##ROLE((SYS)))
 
#define MAKE_EXT_STATUS(mixed_case, all_caps)   bool mixed_case;
 

oxr_instance.c

static XrInstance oxr_instance_to_openxr (struct oxr_instance *inst)
 To go back to a OpenXR object. More...
 
XrResult oxr_instance::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. More...
 
XrResult oxr_instance::oxr_instance_get_properties (struct oxr_logger *log, struct oxr_instance *inst, XrInstanceProperties *instanceProperties)
 
XrResult oxr_instance::oxr_instance_convert_time_to_timespec (struct oxr_logger *log, struct oxr_instance *inst, XrTime time, struct timespec *timespecTime)
 
XrResult oxr_instance::oxr_instance_convert_timespec_to_time (struct oxr_logger *log, struct oxr_instance *inst, const struct timespec *timespecTime, XrTime *time)
 

oxr_path.c

bool oxr_instance::oxr_path_is_valid (struct oxr_logger *log, struct oxr_instance *inst, XrPath path)
 
void * oxr_instance::oxr_path_get_attached (struct oxr_logger *log, struct oxr_instance *inst, XrPath path)
 
XrResult oxr_instance::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. More...
 
XrResult oxr_instance::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. More...
 
XrResult oxr_instance::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. More...
 

Detailed Description

Gets called from OpenXR entrypoints functions and talks to devices and Compositor using XRT interfaces.

Macro Definition Documentation

◆ MAKE_GET_DYN_ROLE_PROFILE_FN

#define MAKE_GET_DYN_ROLE_PROFILE_FN (   ROLE)

#include <state_trackers/oxr/oxr_objects.h>

Value:
static inline enum xrt_device_name get_role_profile_##ROLE(struct oxr_system *sys) \
{ \
const bool is_locked = 0 == os_mutex_trylock(&sys->sync_actions_mutex); \
const enum xrt_device_name profile_name = sys->dynamic_roles_cache.ROLE##_profile; \
if (is_locked) { \
os_mutex_unlock(&sys->sync_actions_mutex); \
} \
return profile_name; \
}
static int os_mutex_trylock(struct os_mutex *om)
Try to lock, but do not block.
Definition: os_threading.h:98
Single or multiple devices grouped together to form a system that sessions can be created from.
Definition: oxr_objects.h:1453
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:712

◆ MAKE_GET_DYN_ROLES_FN

#define MAKE_GET_DYN_ROLES_FN (   ROLE)

#include <state_trackers/oxr/oxr_objects.h>

Value:
static inline struct xrt_device *get_role_##ROLE(struct oxr_system *sys) \
{ \
const bool is_locked = 0 == os_mutex_trylock(&sys->sync_actions_mutex); \
const int32_t xdev_idx = sys->dynamic_roles_cache.ROLE; \
if (is_locked) { \
os_mutex_unlock(&sys->sync_actions_mutex); \
} \
if (xdev_idx < 0 || xdev_idx >= (int32_t)ARRAY_SIZE(sys->xsysd->xdevs)) \
return NULL; \
return sys->xsysd->xdevs[xdev_idx]; \
}
A single HMD or input device.
Definition: xrt_device.h:241
#define ARRAY_SIZE(a)
Array size helper.
Definition: xrt_compiler.h:30

◆ OXR_CHECK_XRET

#define OXR_CHECK_XRET (   LOG,
  SESS,
  RESULTS,
  FUNCTION 
)

#include <state_trackers/oxr/oxr_xret.h>

Value:
do { \
xrt_result_t check_ret = (RESULTS); \
if (check_ret == XRT_ERROR_IPC_FAILURE) { \
(SESS)->has_lost = true; \
return oxr_error(log, XR_ERROR_INSTANCE_LOST, "Call to " #FUNCTION " failed"); \
} \
if (check_ret != XRT_SUCCESS) { \
return oxr_error(log, XR_ERROR_RUNTIME_FAILURE, "Call to " #FUNCTION " failed"); \
} \
} while (false)
@ XRT_SUCCESS
The operation succeeded.
Definition: xrt_results.h:26
@ XRT_ERROR_IPC_FAILURE
A problem occurred either with the IPC transport itself, with invalid commands from the client,...
Definition: xrt_results.h:44
XrResult oxr_error(struct oxr_logger *logger, XrResult result, const char *fmt,...)
Definition: oxr_logger.c:203

Helper define to check results from 'xrt_` functions (xrt_result_t) and also set any needed state.

◆ OXR_WARN_ONCE

#define OXR_WARN_ONCE (   log,
  ... 
)

#include <state_trackers/oxr/oxr_logger.h>

Value:
do { \
static bool _once = false; \
if (!_once) { \
_once = true; \
oxr_warn(log, __VA_ARGS__); \
} \
} while (false)

Helper macro to log a warning just once.

◆ OXR_XRT_FOV_TO_XRFOVF

#define OXR_XRT_FOV_TO_XRFOVF (   FROM,
  TO 
)

#include <state_trackers/oxr/oxr_objects.h>

Value:
do { \
union { \
struct xrt_fov xrt; \
XrFovf oxr; \
} safe_copy = {FROM}; \
TO = safe_copy.oxr; \
} while (false)
Describes a projection matrix fov.
Definition: xrt_defines.h:486

Safely copy an xrt_fov to an XrFovf.

◆ OXR_XRT_POSE_TO_XRPOSEF

#define OXR_XRT_POSE_TO_XRPOSEF (   FROM,
  TO 
)

#include <state_trackers/oxr/oxr_objects.h>

Value:
do { \
union { \
struct xrt_pose xrt; \
XrPosef oxr; \
} safe_copy = {FROM}; \
TO = safe_copy.oxr; \
} while (false)
A pose composed of a position and orientation.
Definition: xrt_defines.h:465

Safely copy an xrt_pose to an XrPosef.

Typedef Documentation

◆ oxr_handle_destroyer

typedef XrResult(* oxr_handle_destroyer) (struct oxr_logger *log, struct oxr_handle_base *hb)
related

Function pointer type for a handle destruction function.

Enumeration Type Documentation

◆ oxr_dpad_region

#include <state_trackers/oxr/oxr_defines.h>

Region of a dpad binding that an input is mapped to.

◆ oxr_handle_state

#include <state_trackers/oxr/oxr_defines.h>

State of a handle base, to reduce likelihood of going "boom" on out-of-order destruction or other unsavory behavior.

Enumerator
OXR_HANDLE_STATE_UNINITIALIZED 

State during/before oxr_handle_init, or after failure.

OXR_HANDLE_STATE_LIVE 

State after successful oxr_handle_init.

OXR_HANDLE_STATE_DESTROYED 

State after successful oxr_handle_destroy.

◆ oxr_image_state

#include <state_trackers/oxr/oxr_defines.h>

Tracks the state of a image that belongs to a oxr_swapchain.

◆ oxr_session_graphics_ext

#include <state_trackers/oxr/oxr_defines.h>

What graphics API was this session created with.

◆ oxr_space_type

#include <state_trackers/oxr/oxr_defines.h>

Internal enum for the type of space, lets us reason about action spaces.

◆ oxr_subaction_path

#include <state_trackers/oxr/oxr_defines.h>

Sub action paths.

Function Documentation

◆ oxr_action_get_pose_input()

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.

◆ oxr_action_set_attachment_teardown()

void oxr_action_set_attachment_teardown ( struct oxr_action_set_attachment act_set_attached)

De-initialize an action set attachment and its action attachments.

Frees the action attachments, but does not de-allocate the action set attachment.

References oxr_action_set_attachment::act_attachments, oxr_action_set_attachment::action_attachment_count, oxr_action_attachment::oxr_action_attachment_teardown(), and oxr_action_set_attachment::sess.

◆ oxr_action_set_to_openxr()

static XrActionSet oxr_action_set_to_openxr ( struct oxr_action_set act_set)
related

To go back to a OpenXR object.

References XRT_CAST_PTR_TO_OXR_HANDLE.

◆ oxr_action_to_openxr()

static XrAction oxr_action_to_openxr ( struct oxr_action act)
related

To go back to a OpenXR object.

References XRT_CAST_PTR_TO_OXR_HANDLE.

◆ oxr_binding_destroy_all()

void oxr_binding_destroy_all ( struct oxr_logger log,
struct oxr_instance inst 
)

Free all memory allocated by the binding system.

◆ oxr_binding_find_bindings_from_key()

void oxr_binding_find_bindings_from_key ( struct oxr_logger log,
struct oxr_interaction_profile p,
uint32_t  key,
size_t  max_bounding_count,
struct oxr_binding **  bindings,
size_t out_binding_count 
)

Find all bindings that is the given action key is bound to.

◆ oxr_classify_subaction_paths()

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.

Sets all members of subaction_paths ( oxr_subaction_paths ) as appropriate based on the subaction paths found in the list.

If no paths are provided, subaction_paths->any will be true.

Returns
false if an invalid subaction path is provided.
See also
oxr_subaction_paths

References OXR_FOR_EACH_VALID_SUBACTION_PATH, oxr_action_ref::subaction_paths, and U_ZERO.

Referenced by oxr_verify_subaction_path_sync().

◆ oxr_create_messenger()

XrResult oxr_create_messenger ( struct oxr_logger log,
struct oxr_instance inst,
const XrDebugUtilsMessengerCreateInfoEXT *  createInfo,
struct oxr_debug_messenger **  out_mssngr 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
call into inst to create this instead?

◆ oxr_d3d_check_luid()

XrResult oxr_d3d_check_luid ( struct oxr_logger log,
struct oxr_system sys,
LUID *  adapter_luid 
)

#include <state_trackers/oxr/oxr_objects.h>

Verify the provided LUID matches the expected one in sys.

References oxr_error(), and oxr_system::xsysc.

◆ oxr_d3d_get_requirements()

XrResult oxr_d3d_get_requirements ( struct oxr_logger log,
struct oxr_system sys,
LUID *  adapter_luid,
D3D_FEATURE_LEVEL *  min_feature_level 
)

◆ oxr_error()

void void XrResult oxr_error ( struct oxr_logger logger,
XrResult  result,
const char *  fmt,
  ... 
)

#include <state_trackers/oxr/oxr_logger.h>

Output an error and return the result code.

Intended for use in a return statement, to log error information and return the result code in a single line.

Note: The format string is appended to the function name with no spaces, so it should either start with a parenthesized argument name followed by a space and the message, or should start with a space then the message. That is, a format string of "(arg) info" becomes XR_ERROR: xrFunc(arg) info, and a format string of " info msg" becomes XR_ERROR: xrFunc info msg.

◆ oxr_error_slog()

XrResult oxr_error_slog ( struct oxr_logger log,
XrResult  res,
struct oxr_sink_logger slog 
)

#include <state_trackers/oxr/oxr_logger.h>

Flush sink as a error message, frees all internal data.

References oxr_error().

◆ oxr_event_remove_session_events()

XrResult oxr_event_remove_session_events ( struct oxr_logger log,
struct oxr_session sess 
)

#include <state_trackers/oxr/oxr_objects.h>

This clears all pending events refers to the given session.

References oxr_session::oxr_session_to_openxr().

◆ oxr_find_profile_for_device()

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.

Parameters
logLogger.
sessSession.
xdevCan be null.
[out]out_pReturned interaction profile.

◆ oxr_hand_tracker_to_openxr()

static XrHandTrackerEXT oxr_hand_tracker_to_openxr ( struct oxr_hand_tracker hand_tracker)
related

To go back to a OpenXR object.

References XRT_CAST_PTR_TO_OXR_HANDLE.

◆ oxr_handle_destroy()

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.

This should be how all handle-associated objects are destroyed.

◆ oxr_handle_state_to_string()

const char * oxr_handle_state_to_string ( enum oxr_handle_state  state)
related

Returns a human-readable label for a handle state.

References OXR_HANDLE_STATE_DESTROYED, OXR_HANDLE_STATE_LIVE, and OXR_HANDLE_STATE_UNINITIALIZED.

◆ oxr_instance_create()

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 
)
static

Creates a instance, does minimal validation of createInfo.

Parameters
[in]logLogger
[in]createInfoOpenXR creation info.
[in]extensionsParsed extension list to be enabled.
[out]out_instPointer to pointer to a instance, returned instance.

References oxr_handle_base::OXR_ALLOCATE_HANDLE_OR_RETURN.

◆ oxr_instance_to_openxr()

static XrInstance oxr_instance_to_openxr ( struct oxr_instance inst)
related

To go back to a OpenXR object.

References XRT_CAST_PTR_TO_OXR_HANDLE.

◆ oxr_log_slog()

void oxr_log_slog ( struct oxr_logger log,
struct oxr_sink_logger slog 
)

#include <state_trackers/oxr/oxr_logger.h>

Flush sink as a log message, frees all internal data.

◆ oxr_messenger_to_openxr()

static XrDebugUtilsMessengerEXT oxr_messenger_to_openxr ( struct oxr_debug_messenger mssngr)
inlinestatic

#include <state_trackers/oxr/oxr_objects.h>

To go back to a OpenXR object.

References XRT_CAST_PTR_TO_OXR_HANDLE.

◆ oxr_path_get_or_create()

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.

◆ oxr_path_get_string()

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.

The pointer has the same life time as the instance. The length is the number of valid characters, not including the null termination character (but an extra null byte is always reserved at the end so can strings can be given to functions expecting null terminated strings).

Referenced by oxr_verify_subaction_path_sync().

◆ oxr_path_only_get()

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.

◆ oxr_poll_event()

XrResult oxr_poll_event ( struct oxr_logger log,
struct oxr_instance inst,
XrEventDataBuffer *  eventData 
)

#include <state_trackers/oxr/oxr_objects.h>

Will return one event if available, also drain the sessions event queues.

◆ oxr_pp_fov_indented_as_object()

void oxr_pp_fov_indented_as_object ( struct oxr_sink_logger slog,
const struct xrt_fov fov,
const char *  name 
)

#include <state_trackers/oxr/oxr_pretty_print.h>

Prints a fov to a oxr_sink_logger, on the form of \n\t${name}->fov ....

Note no trailing line break and but a starting line break, see Pretty printing functions and helpers.

References oxr_slog().

◆ oxr_pp_pose_indented_as_object()

void oxr_pp_pose_indented_as_object ( struct oxr_sink_logger slog,
const struct xrt_pose pose,
const char *  name 
)

#include <state_trackers/oxr/oxr_pretty_print.h>

Prints a pose to a oxr_sink_logger, on the form of \n\t${name}->pose ....

Note no trailing line break and but a starting line break, see Pretty printing functions and helpers.

◆ oxr_pp_relation_indented()

void oxr_pp_relation_indented ( struct oxr_sink_logger slog,
const struct xrt_space_relation relation,
const char *  name 
)

#include <state_trackers/oxr/oxr_pretty_print.h>

Prints a space to a oxr_sink_logger, on the form of \n\t${name}-><field> ....

Note no trailing line break and but a starting line break, see Pretty printing functions and helpers.

◆ oxr_pp_space_indented()

void oxr_pp_space_indented ( struct oxr_sink_logger slog,
const struct oxr_space spc,
const char *  name 
)

#include <state_trackers/oxr/oxr_pretty_print.h>

Prints a space to a oxr_sink_logger, on the form of \n\t${name}-><field> ....

Note no trailing line break and but a starting line break, see Pretty printing functions and helpers.

References oxr_slog(), and oxr_space::space_type.

◆ oxr_refcounted_ref()

static void oxr_refcounted_ref ( struct oxr_refcounted orc)
inlinestatic

#include <state_trackers/oxr/oxr_objects.h>

Increase the reference count of orc.

◆ oxr_refcounted_unref()

static void oxr_refcounted_unref ( struct oxr_refcounted orc)
inlinestatic

#include <state_trackers/oxr/oxr_objects.h>

Decrease the reference count of orc, destroying it if it reaches 0.

◆ oxr_session_attach_action_sets()

XrResult oxr_session_attach_action_sets ( struct oxr_logger log,
struct oxr_session sess,
const XrSessionActionSetsAttachInfo *  bindInfo 
)

◆ oxr_session_begin()

XrResult oxr_session_begin ( struct oxr_logger log,
struct oxr_session sess,
const XrSessionBeginInfo *  beginInfo 
)

◆ oxr_session_binding_destroy_all()

void oxr_session_binding_destroy_all ( struct oxr_logger log,
struct oxr_session sess 
)

Free all memory allocated by the binding system.

Referenced by oxr_session::oxr_session_attach_action_sets().

◆ oxr_session_change_state()

void oxr_session_change_state ( struct oxr_logger log,
struct oxr_session sess,
XrSessionState  state,
XrTime  time 
)

#include <state_trackers/oxr/oxr_objects.h>

Change the state of the session, queues a event.

Referenced by oxr_session_begin(), and oxr_session_request_exit().

◆ oxr_session_frame_end()

XrResult oxr_session_frame_end ( struct oxr_logger log,
struct oxr_session sess,
const XrFrameEndInfo *  frameEndInfo 
)

◆ oxr_session_frame_wait()

XrResult oxr_session_frame_wait ( struct oxr_logger log,
struct oxr_session sess,
XrFrameState *  frameState 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
this should be carefully synchronized, because there may be more than one session per instance.

◆ oxr_session_request_exit()

XrResult oxr_session_request_exit ( struct oxr_logger log,
struct oxr_session sess 
)

◆ oxr_session_success_focused_result()

static XrResult oxr_session_success_focused_result ( struct oxr_session session)
inlinestatic

Returns XR_SUCCESS, XR_SESSION_LOSS_PENDING, or XR_SESSION_NOT_FOCUSED, as appropriate.

◆ oxr_session_success_result()

static XrResult oxr_session_success_result ( struct oxr_session session)
inlinestatic

Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate.

Referenced by oxr_session_begin(), and oxr_session_request_exit().

◆ oxr_session_to_openxr()

static XrSession oxr_session_to_openxr ( struct oxr_session sess)
related

To go back to a OpenXR object.

References XRT_CAST_PTR_TO_OXR_HANDLE.

Referenced by oxr_event_remove_session_events().

◆ oxr_slog()

◆ oxr_slog_add_array()

void void oxr_slog_add_array ( struct oxr_sink_logger slog,
const char *  str,
size_t  size 
)

#include <state_trackers/oxr/oxr_logger.h>

Add the string to the slog struct.

Referenced by oxr_slog_dg().

◆ oxr_slog_cancel()

void oxr_slog_cancel ( struct oxr_sink_logger slog)

#include <state_trackers/oxr/oxr_logger.h>

Cancel logging, frees all internal data.

◆ oxr_slog_dg()

static u_pp_delegate_t oxr_slog_dg ( struct oxr_sink_logger slog)
inlinestatic

#include <state_trackers/oxr/oxr_logger.h>

Get a pretty print delegate from a oxr_sink_logger.

References oxr_slog_add_array().

◆ oxr_space_locate()

XrResult oxr_space_locate ( struct oxr_logger log,
struct oxr_space spc,
struct oxr_space baseSpc,
XrTime  time,
XrSpaceLocation *  location 
)

◆ oxr_space_locate_device()

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 
)

#include <state_trackers/oxr/oxr_objects.h>

Locate the xrt_device in the given base space, useful for implementing hand tracking location look ups and the like.

Parameters
logLogging struct.
xdevDevice to locate in the base space.
baseSpcBase space where the device is to be located.
[in]timeTime in OpenXR domain.
[out]out_relationReturns T_base_xdev, aka xdev in base space.
Returns
Any errors, XR_SUCCESS, pose might not be valid on XR_SUCCESS.

◆ oxr_space_to_openxr()

static XrSpace oxr_space_to_openxr ( struct oxr_space spc)
inlinestatic

#include <state_trackers/oxr/oxr_objects.h>

To go back to a OpenXR object.

References XRT_CAST_PTR_TO_OXR_HANDLE.

◆ oxr_space_xdev_pose_create()

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 
)

#include <state_trackers/oxr/oxr_objects.h>

Monado special space that always points to a specific xrt_device and pose, useful when you want to bypass the action binding system for instance.

References xrt_pose::math_pose_validate(), oxr_handle_base::OXR_ALLOCATE_HANDLE_OR_RETURN, OXR_CHECK_XRET, oxr_error(), oxr_space::pose, xrt_space_overseer::xrt_space_overseer_create_pose_space(), and oxr_system::xso.

◆ oxr_spaces_locate()

XrResult oxr_spaces_locate ( struct oxr_logger log,
struct oxr_space **  spcs,
uint32_t  spc_count,
struct oxr_space baseSpc,
XrTime  time,
XrSpaceLocations *  locations 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
results locationFlags should still be 0. But should this hard fail? goto "Print"?
Todo:
spec: function not specified to return out of memory

◆ oxr_subaction_paths_is_subset_of()

static bool oxr_subaction_paths_is_subset_of ( const struct oxr_subaction_paths a,
const struct oxr_subaction_paths b 
)
inlinestatic

Helper function to determine if the set of paths in a is a subset of the paths in b.

References OXR_FOR_EACH_SUBACTION_PATH.

Referenced by oxr_verify_subaction_path_sync().

◆ oxr_swapchain_to_openxr()

static XrSwapchain oxr_swapchain_to_openxr ( struct oxr_swapchain sc)
inlinestatic

#include <state_trackers/oxr/oxr_objects.h>

To go back to a OpenXR object.

References XRT_CAST_PTR_TO_OXR_HANDLE.

◆ oxr_system_enumerate_blend_modes()

XrResult oxr_system_enumerate_blend_modes ( struct oxr_logger log,
struct oxr_system sys,
XrViewConfigurationType  viewConfigurationType,
uint32_t  environmentBlendModeCapacityInput,
uint32_t *  environmentBlendModeCountOutput,
XrEnvironmentBlendMode *  environmentBlendModes 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
Take into account viewConfigurationType

◆ oxr_system_fill_in()

XrResult oxr_system_fill_in ( struct oxr_logger log,
struct oxr_instance inst,
XrSystemId  systemId,
uint32_t  view_count,
struct oxr_system sys 
)

◆ oxr_vk_create_vulkan_device()

XrResult oxr_vk_create_vulkan_device ( struct oxr_logger log,
struct oxr_system sys,
const XrVulkanDeviceCreateInfoKHR *  createInfo,
VkDevice *  vulkanDevice,
VkResult *  vulkanResult 
)

◆ oxr_vk_create_vulkan_instance()

XrResult oxr_vk_create_vulkan_instance ( struct oxr_logger log,
struct oxr_system sys,
const XrVulkanInstanceCreateInfoKHR *  createInfo,
VkInstance *  vulkanInstance,
VkResult *  vulkanResult 
)

#include <state_trackers/oxr/oxr_objects.h>

Todo:
: clarify in spec

◆ oxr_warn_slog()

void oxr_warn_slog ( struct oxr_logger log,
struct oxr_sink_logger slog 
)

#include <state_trackers/oxr/oxr_logger.h>

Flush sink as a warning message, frees all internal data.

◆ oxr_xdev_find_input()

bool oxr_xdev_find_input ( struct xrt_device xdev,
enum xrt_input_name  name,
struct xrt_input **  out_input 
)

#include <state_trackers/oxr/oxr_objects.h>

Return true if it finds an input of that name on this device.

References xrt_device::input_count, xrt_device::inputs, and xrt_device::name.

◆ oxr_xdev_find_output()

bool oxr_xdev_find_output ( struct xrt_device xdev,
enum xrt_output_name  name,
struct xrt_output **  out_output 
)

#include <state_trackers/oxr/oxr_objects.h>

Return true if it finds an output of that name on this device.

References xrt_device::name, xrt_device::output_count, and xrt_device::outputs.

◆ oxr_xdev_get_hand_tracking_at()

void oxr_xdev_get_hand_tracking_at ( struct oxr_logger log,
struct oxr_instance inst,
struct xrt_device xdev,
enum xrt_input_name  name,
XrTime  at_time,
struct xrt_hand_joint_set out_value 
)

#include <state_trackers/oxr/oxr_objects.h>

Returns the hand tracking value of the named input from the device.

Does NOT apply tracking origin offset to each joint.

Convert at_time to monotonic and give to device.

References time_state::time_state_ts_to_monotonic_ns(), and xrt_device::xrt_device_get_hand_tracking().