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_future.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 "oxr_frame_sync.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_view_config_properties
 Holds the properties that a system supports for a view configuration type. 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...
 

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 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 PRINT(name, value)    case name: return #name;
 
#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 const char * xr_action_type_to_str (XrActionType type)
 
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, const struct oxr_roles *roles)
 
oxr_binding.c
bool 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_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_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)
 
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...
 
XRT_CHECK_RESULT XrResult oxr_space_get_xrt_space (struct oxr_logger *log, struct oxr_space *spc, struct xrt_space **out_xspace)
 Get the xrt_space associated with this oxr_space, the xrt_space will be reference counted by this function so the caller will need to call xrt_space_reference to decrement the reference count. 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_android_support (struct oxr_logger *log, struct oxr_instance *inst, bool *supported)
 
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)
 
bool oxr_system_get_full_body_tracking_meta_support (struct oxr_logger *log, struct oxr_instance *inst)
 
bool oxr_system_get_body_tracking_calibration_meta_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...
 
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...
 

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.