Monado OpenXR Runtime
Data Structures | Macros | Typedefs | Enumerations | Functions
oxr_objects.h File Reference

Contains the instance struct that a lot of things hang from. More...

#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 "util/u_hashset.h"
#include "util/u_hashmap.h"
#include "oxr_extension_support.h"
Include dependency graph for oxr_objects.h:
This graph shows which files directly or indirectly include this file:

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_interaction_profile
 A single interaction profile. More...
 
struct  oxr_binding
 Interaction profile binding state. More...
 
struct  oxr_sub_paths
 To carry around a sementic selection of sub action paths. More...
 
struct  oxr_source_set
 Session input source. More...
 
struct  oxr_source_state
 The state of a action input source. More...
 
struct  oxr_source_input
 A input source pair of a xrt_input and a xrt_device. More...
 
struct  oxr_source_output
 A output source pair of a xrt_output_name and a xrt_device. More...
 
struct  oxr_source_cache
 A set of inputs for a single sub action path. More...
 
struct  oxr_source
 Session input source. More...
 
struct  oxr_space
 Can be one of 3 references or a space that are bound to actions. More...
 
struct  oxr_swapchain
 A set of images used for rendering. More...
 
struct  oxr_action_set
 A group of actions. More...
 
struct  oxr_action
 A single action. More...
 
struct  oxr_debug_messenger
 Debug object created by the client program. More...
 

Macros

#define OXR_XR_DEBUG_INSTANCE   (*(uint64_t *)"oxrinst\0")
 
#define OXR_XR_DEBUG_SESSION   (*(uint64_t *)"oxrsess\0")
 
#define OXR_XR_DEBUG_SPACE   (*(uint64_t *)"oxrspac\0")
 
#define OXR_XR_DEBUG_PATH   (*(uint64_t *)"oxrpath\0")
 
#define OXR_XR_DEBUG_ACTION   (*(uint64_t *)"oxracti\0")
 
#define OXR_XR_DEBUG_SWAPCHAIN   (*(uint64_t *)"oxrswap\0")
 
#define OXR_XR_DEBUG_ACTIONSET   (*(uint64_t *)"oxraset\0")
 
#define OXR_XR_DEBUG_MESSENGER   (*(uint64_t *)"oxrmess\0")
 
#define OXR_XR_DEBUG_SOURCESET   (*(uint64_t *)"oxrsrcs\0")
 
#define OXR_XR_DEBUG_SOURCE   (*(uint64_t *)"oxrsrc_\0")
 
#define XRT_MAX_HANDLE_CHILDREN   256
 
#define MAKE_EXT_STATUS(mixed_case, all_caps)   bool mixed_case;
 

Typedefs

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

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_sub_action_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
}
 Sub action paths. More...
 

Functions

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. More...
 
const char * oxr_handle_state_to_string (enum oxr_handle_state state)
 Returns a human-readable label for a handle state. More...
 
XrResult oxr_instance_create (struct oxr_logger *log, const XrInstanceCreateInfo *createInfo, struct oxr_instance **out_inst)
 
XrResult oxr_instance_get_properties (struct oxr_logger *log, struct oxr_instance *inst, XrInstanceProperties *instanceProperties)
 
XrResult oxr_instance_convert_time_to_timespec (struct oxr_logger *log, struct oxr_instance *inst, XrTime time, struct timespec *timespecTime)
 
XrResult oxr_instance_convert_timespec_to_time (struct oxr_logger *log, struct oxr_instance *inst, const struct timespec *timespecTime, XrTime *time)
 
void * oxr_path_get_attached (struct oxr_logger *log, struct oxr_instance *inst, XrPath path)
 
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. More...
 
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. More...
 
XrResult oxr_path_get_string (struct oxr_logger *log, struct oxr_instance *inst, XrPath path, const char **out_str, size_t *out_length)
 Get a pointer and length of the internal string. More...
 
void oxr_path_destroy_all (struct oxr_logger *log, struct oxr_instance *inst)
 Destroy all paths that the instance has created. More...
 
void oxr_classify_sub_action_paths (struct oxr_logger *log, struct oxr_instance *inst, uint32_t num_subaction_paths, const XrPath *subaction_paths, struct oxr_sub_paths *sub_paths)
 Helper function to classify sub_paths. More...
 
XrResult oxr_source_get_pose_input (struct oxr_logger *log, struct oxr_session *sess, uint32_t key, const struct oxr_sub_paths *sub_paths, struct oxr_source_input **out_input)
 Find the pose input for the set of sub_paths. More...
 
XrResult 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_create (struct oxr_logger *log, struct oxr_action_set *act_set, const XrActionCreateInfo *createInfo, struct oxr_action **out_act)
 
XrResult oxr_session_attach_action_sets (struct oxr_logger *log, struct oxr_session *sess, const XrSessionActionSetsAttachInfo *bindInfo)
 
XrResult oxr_action_sync_data (struct oxr_logger *log, struct oxr_session *sess, uint32_t countActionSets, const XrActiveActionSet *actionSets)
 
XrResult oxr_action_get_boolean (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStateBoolean *data)
 
XrResult oxr_action_get_vector1f (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStateFloat *data)
 
XrResult oxr_action_get_vector2f (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStateVector2f *data)
 
XrResult oxr_action_get_pose (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, XrActionStatePose *data)
 
XrResult oxr_action_apply_haptic_feedback (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths, const XrHapticBaseHeader *hapticEvent)
 
XrResult oxr_action_stop_haptic_feedback (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, struct oxr_sub_paths sub_paths)
 
void oxr_find_profile_for_device (struct oxr_logger *log, struct oxr_instance *inst, struct xrt_device *xdev, struct oxr_interaction_profile **out_p)
 Find the best matching profile for the given xrt_device. More...
 
void oxr_binding_destroy_all (struct oxr_logger *log, struct oxr_instance *inst)
 Free all memory allocated by the binding system. More...
 
void oxr_binding_find_bindings_from_key (struct oxr_logger *log, struct oxr_interaction_profile *profile, uint32_t key, struct oxr_binding *bindings[32], size_t *num_bindings)
 Find all bindings that is the given action key is bound to. More...
 
XrResult oxr_action_suggest_interaction_profile_bindings (struct oxr_logger *log, struct oxr_instance *inst, const XrInteractionProfileSuggestedBinding *suggestedBindings)
 
XrResult oxr_action_get_current_interaction_profile (struct oxr_logger *log, struct oxr_session *sess, XrPath topLevelUserPath, XrInteractionProfileState *interactionProfile)
 
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)
 
XrResult oxr_action_enumerate_bound_sources (struct oxr_logger *log, struct oxr_session *sess, uint64_t key, uint32_t sourceCapacityInput, uint32_t *sourceCountOutput, XrPath *sources)
 
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)
 
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)
 
void oxr_session_poll (struct oxr_session *sess)
 
XrResult oxr_session_get_view_pose_at (struct oxr_logger *, struct oxr_session *sess, XrTime at_time, struct xrt_pose *)
 Get the view space position at the given time in relation to the local or stage space. More...
 
XrResult oxr_session_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_space_action_create (struct oxr_logger *log, struct oxr_session *sess, uint64_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)
 
XrResult oxr_space_ref_relation (struct oxr_logger *log, struct oxr_session *sess, XrReferenceSpaceType space, XrReferenceSpaceType baseSpc, XrTime time, struct xrt_space_relation *out_relation)
 This returns only the relation between two spaces without any of the app given relations applied, assumes that both spaces are reference spaces. More...
 
XrResult oxr_create_swapchain (struct oxr_logger *, struct oxr_session *sess, const XrSwapchainCreateInfo *, struct oxr_swapchain **out_swapchain)
 
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 num_systems, XrFormFactor form_factor, struct oxr_system **out_selected)
 
XrResult oxr_system_fill_in (struct oxr_logger *log, struct oxr_instance *inst, XrSystemId systemId, struct oxr_system *sys, struct xrt_device **xdevs, size_t num_xdevs)
 
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)
 
XrResult oxr_poll_event (struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuffer *eventData)
 
XrResult oxr_event_push_XrEventDataSessionStateChanged (struct oxr_logger *log, struct oxr_session *sess, XrSessionState state, XrTime time)
 
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_pose_at (struct oxr_logger *log, struct oxr_instance *inst, struct xrt_device *xdev, enum xrt_input_name name, XrTime at_time, uint64_t *out_pose_timestamp_ns, struct xrt_pose *out_pose)
 Returns the pose of the named input from the device, if the pose isn't valid uses the device offset instead. More...
 
void oxr_xdev_get_relation_at (struct oxr_logger *log, struct oxr_instance *inst, struct xrt_device *xdev, enum xrt_input_name name, XrTime at_time, uint64_t *out_relation_timestamp_ns, struct xrt_space_relation *out_relation)
 Returns the relation of the named input from the device, always ensures that position and orientation is valid by using the device offset. 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_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)
 

Detailed Description

Contains the instance struct that a lot of things hang from.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m