Monado OpenXR Runtime
oxr_objects.h File Reference

The objects representing OpenXR handles, and prototypes for internal functions used in the state tracker. More...

#include "xrt/xrt_space.h"
#include "xrt/xrt_limits.h"
#include "xrt/xrt_system.h"
#include "xrt/xrt_device.h"
#include "xrt/xrt_tracking.h"
#include "xrt/xrt_compositor.h"
#include "xrt/xrt_vulkan_includes.h"
#include "xrt/xrt_openxr_includes.h"
#include "xrt/xrt_config_os.h"
#include "xrt/xrt_config_have.h"
#include "os/os_threading.h"
#include "util/u_index_fifo.h"
#include "util/u_hashset.h"
#include "util/u_hashmap.h"
#include "util/u_device.h"
#include "oxr_extension_support.h"
#include "oxr_subaction.h"
#include "oxr_defines.h"
Include dependency graph for oxr_objects.h:

Go to the source code of this file.

Data Structures

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_facial_tracker_htc
 HTC specific Facial tracker. More...
 

Macros

#define XRT_CAST_PTR_TO_OXR_HANDLE(HANDLE_TYPE, PTR)   ((HANDLE_TYPE)(uint64_t)(uintptr_t)(PTR))
 Cast a pointer to an OpenXR handle in such a way as to avoid warnings. More...
 
#define XRT_CAST_OXR_HANDLE_TO_PTR(PTR_TYPE, HANDLE)   ((PTR_TYPE)(uintptr_t)(uint64_t)(HANDLE))
 Cast an OpenXR handle to a pointer in such a way as to avoid warnings. More...
 
#define XRT_MAX_HANDLE_CHILDREN   256
 
#define OXR_MAX_BINDINGS_PER_ACTION   32
 
#define OXR_XRT_POSE_TO_XRPOSEF(FROM, TO)
 Safely copy a xrt_pose to a XrPosef. More...
 
#define OXR_XRT_FOV_TO_XRFOVF(FROM, TO)
 Safely copy a xrt_fov to a XrFovf. More...
 
#define SUBACTION_PATH_MEMBER(X)   XrPath X;
 
#define OXR_SUBPATH_MEMBER(X)   bool X;
 
#define OXR_CHECK_SUBACTION_PATHS(X)
 
#define OXR_CACHE_MEMBER(X)   struct oxr_action_cache X;
 
#define OXR_PATH_MEMBER(X)   XrPath X;
 Currently bound interaction profile. More...
 

Functions

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...
 
oxr_input.c
XrResult oxr_session_update_action_bindings (struct oxr_logger *log, struct oxr_session *sess)
 
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)
 

oxr_session.c

#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;
 
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_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_reference_create (struct oxr_logger *log, struct oxr_session *sess, const XrReferenceSpaceCreateInfo *createInfo, struct oxr_space **out_space)
 
XrResult oxr_space_locate (struct oxr_logger *log, struct oxr_space *spc, struct oxr_space *baseSpc, XrTime time, XrSpaceLocation *location)
 
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)
 
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)
 
void oxr_xdev_update (struct xrt_device *xdev)
 
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_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_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)
 

Detailed Description

The objects representing OpenXR handles, and prototypes for internal functions used in the state tracker.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Korcan Hussein korca.nosp@m.n.hu.nosp@m.ssein.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Macro Definition Documentation

◆ OXR_CHECK_SUBACTION_PATHS

#define OXR_CHECK_SUBACTION_PATHS (   X)
Value:
if (a->X && !b->X) { \
return false; \
}

◆ OXR_PATH_MEMBER

#define OXR_PATH_MEMBER (   X)    XrPath X;

Currently bound interaction profile.