Monado OpenXR Runtime
Files | Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
XRT interfaces

The main interface shared between the different components of Monado. More...

Collaboration diagram for XRT interfaces:

Files

file  t_hand_tracking.h
 Hand tracking interfaces.
 
file  xrt_compiler.h
 Header holding common defines.
 
file  xrt_compositor.h
 Header declaring XRT graphics interfaces.
 
file  xrt_config.h
 Includes all config headers, use separate headers instead.
 
file  xrt_config_os.h
 Auto detect OS and certain features.
 
file  xrt_defines.h
 Common defines and enums for XRT.
 
file  xrt_deleters.hpp
 Generic unique_ptr deleters for Monado types.
 
file  xrt_device.h
 Header defining an xrt display or controller device.
 
file  xrt_device.hpp
 C++ helpers for xrt_device.
 
file  xrt_documentation.h
 Header with just documentation.
 
file  xrt_frame.h
 Data frame header.
 
file  xrt_frameserver.h
 Frameserver interface for video drivers.
 
file  xrt_gfx_d3d11.h
 Header defining a D3D11 graphics interface.
 
file  xrt_gfx_d3d12.h
 Header defining a D3D12 graphics interface.
 
file  xrt_gfx_egl.h
 Header defining a XRT graphics provider.
 
file  xrt_gfx_gl.h
 Header for misc OpenGL code, not a complete graphics provider.
 
file  xrt_gfx_gles.h
 Header for misc OpenGL ES code, not a complete graphics provider.
 
file  xrt_gfx_native.h
 Header defining a XRT graphics provider.
 
file  xrt_gfx_vk.h
 Header defining a XRT graphics provider.
 
file  xrt_gfx_xlib.h
 Header defining a XRT graphics provider.
 
file  xrt_handles.h
 Native handle types.
 
file  xrt_instance.h
 Header for xrt_instance object.
 
file  xrt_openxr_includes.h
 Include all of the openxr headers in one place.
 
file  xrt_prober.h
 Common interface to probe for devices.
 
file  xrt_results.h
 Internal result type for XRT.
 
file  xrt_settings.h
 Common settings structs to be transferred between different parts of Monado, mainly for tracking and camera usage.
 
file  xrt_system.h
 Header for system objects.
 
file  xrt_tracking.h
 Header defining the tracking system integration in Monado.
 
file  xrt_vulkan_includes.h
 Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.
 
file  xrt_windows.h
 A minimal way to include Windows.h.
 
file  target_builder_legacy.c
 Fallback builder the old method of probing devices.
 
file  target_builder_lighthouse.c
 Builder for Lighthouse-tracked devices (vive, index, tundra trackers, etc.)
 
file  target_builder_remote.c
 Remote driver builder.
 
file  target_builder_rgb_tracking.c
 Builder to setup rgb tracking devices into a system.
 

Data Structures

struct  t_image_boundary_circle
 Circular image boundary. More...
 
struct  t_image_boundary_info_one_view
 Image boundary for one view. More...
 
struct  t_image_boundary_info
 Image boundaries for all the cameras used in a tracking system. More...
 
struct  xrt_sub_image
 Specifies a sub-image in a layer. More...
 
struct  xrt_layer_projection_view_data
 All of the pure data values associated with a single view in a projection layer. More...
 
struct  xrt_layer_stereo_projection_data
 All the pure data values associated with a stereo projection layer. More...
 
struct  xrt_layer_depth_data
 All the pure data values associated with a depth information attached to a layer. More...
 
struct  xrt_layer_stereo_projection_depth_data
 All the pure data values associated with a stereo projection layer with depth swapchain attached. More...
 
struct  xrt_layer_quad_data
 All the pure data values associated with a quad layer. More...
 
struct  xrt_layer_cube_data
 All the pure data values associated with a cube layer. More...
 
struct  xrt_layer_cylinder_data
 All the pure data values associated with a cylinder layer. More...
 
struct  xrt_layer_equirect1_data
 All the pure data values associated with a equirect1 layer. More...
 
struct  xrt_layer_equirect2_data
 All the pure data values associated with a equirect2 layer. More...
 
struct  xrt_layer_data
 All the pure data values associated with a composition layer. More...
 
interface  xrt_swapchain
 Common swapchain interface/base. More...
 
struct  xrt_compositor_fence
 Compositor fence used for syncornization. More...
 
struct  xrt_compositor_semaphore
 Compositor semaphore used for synchronization, needs to be as capable as a Vulkan pipeline semaphore. More...
 
struct  xrt_compositor_event_state_change
 Session state changes event. More...
 
struct  xrt_compositor_event_overlay
 Primary session state changes event. More...
 
union  xrt_compositor_event
 Compositor events union. More...
 
struct  xrt_swapchain_create_info
 Swapchain creation info. More...
 
struct  xrt_swapchain_create_properties
 Struct used to negotiate properties of a swapchain that is created outside of the compositor. More...
 
struct  xrt_session_info
 Session information, mostly overlay extension data. More...
 
struct  xrt_compositor_info
 Capabilities and information about the compositor and device together. More...
 
interface  xrt_compositor
 Common compositor client interface/base. More...
 
struct  xrt_swapchain_gl
 Base class for an OpenGL (ES) client swapchain. More...
 
struct  xrt_compositor_gl
 Base class for an OpenGL (ES) client compositor. More...
 
struct  xrt_swapchain_vk
 Base class for a Vulkan client swapchain. More...
 
struct  xrt_compositor_vk
 Base class for a Vulkan client compositor. More...
 
struct  xrt_swapchain_d3d11
 Base class for a D3D11 client swapchain. More...
 
struct  xrt_compositor_d3d11
 Base class for a D3D11 client compositor. More...
 
struct  xrt_d3d_requirements
 Graphics usage requirements for D3D APIs. More...
 
struct  xrt_swapchain_d3d12
 Base class for a D3D12 client swapchain. More...
 
struct  xrt_compositor_d3d12
 Base class for a D3D12 client compositor. More...
 
struct  xrt_image_native
 A single image of a swapchain based on native buffer handles. More...
 
interface  xrt_swapchain_native
 Base class for a swapchain that exposes a native buffer handle to be imported into a client API. More...
 
interface  xrt_compositor_native
 Main compositor server interface. More...
 
struct  xrt_system_compositor_info
 Capabilities and information about the system compositor and device together. More...
 
interface  xrt_multi_compositor_control
 Special functions to control multi session/clients. More...
 
struct  xrt_system_compositor
 The system compositor is a long lived object, it has the same life time as a XrSystemID. More...
 
struct  xrt_image_native_allocator
 Allocator for system native images, in general you do not need to free the images as they will be consumed by importing them to the graphics API. More...
 
struct  xrt_uuid
 To transport UUIDs between different APIs. More...
 
struct  xrt_luid
 To transport LUIDs between different APIs. More...
 
struct  xrt_reference
 A base class for reference counted objects. More...
 
struct  xrt_quat
 A quaternion with single floats. More...
 
struct  xrt_vec1
 A 1 element vector with single floats. More...
 
struct  xrt_vec2
 A 2 element vector with single floats. More...
 
struct  xrt_vec3
 A 3 element vector with single floats. More...
 
struct  xrt_vec3_f64
 A 3 element vector with single doubles. More...
 
struct  xrt_vec3_i32
 A 3 element vector with 32 bit integers. More...
 
struct  xrt_vec2_i32
 A 2 element vector with 32 bit integers. More...
 
struct  xrt_colour_rgb_u8
 A 3 element colour with 8 bits per channel. More...
 
struct  xrt_colour_rgba_u8
 A 4 element colour with 8 bits per channel. More...
 
struct  xrt_colour_rgb_f32
 A 3 element colour with floating point channels. More...
 
struct  xrt_colour_rgba_f32
 A 4 element colour with floating point channels. More...
 
struct  xrt_size
 Image size. More...
 
struct  xrt_offset
 Image offset. More...
 
struct  xrt_rect
 Image rectangle. More...
 
struct  xrt_normalized_rect
 Normalized image rectangle, coordinates and size in 0 . More...
 
struct  xrt_pose
 A pose composed of a position and orientation. More...
 
struct  xrt_fov
 Describes a projection matrix fov. More...
 
struct  xrt_matrix_2x2
 A tightly packed 2x2 matrix of floats. More...
 
struct  xrt_matrix_3x3
 A tightly packed 3x3 matrix of floats. More...
 
struct  xrt_matrix_3x3_f64
 A tightly packed 3x3 matrix of doubles. More...
 
struct  xrt_matrix_4x4
 A tightly packed 4x4 matrix of floats. More...
 
struct  xrt_matrix_4x4_f64
 A tightly packed 4x4 matrix of double. More...
 
struct  xrt_api_requirements
 A range of API versions supported. More...
 
struct  xrt_space_relation
 A relation with two spaces, includes velocity and acceleration. More...
 
struct  xrt_relation_chain
 A chain of space relations and their associated validity flags. More...
 
struct  xrt_hand_joint_value
 Location of a single hand joint. More...
 
struct  xrt_hand_joint_set
 Joint set type used for hand tracking. More...
 
union  xrt_input_value
 A union of all input types. More...
 
union  xrt_output_value
 A union of all output types. More...
 
struct  xrt_view
 A per-lens/display view information. More...
 
struct  xrt_hmd_parts
 All of the device components that deals with interfacing to a users head. More...
 
struct  xrt_input
 A single named input, that sits on a xrt_device. More...
 
struct  xrt_output
 A single named output, that sits on a xrt_device. More...
 
struct  xrt_binding_input_pair
 A binding pair, going from a binding point to a device input. More...
 
struct  xrt_binding_output_pair
 A binding pair, going from a binding point to a device output. More...
 
struct  xrt_binding_profile
 A binding profile, has lists of binding pairs to goes from device in name to the device it hangs off on. More...
 
struct  xrt_frame
 Basic frame data structure - holds a pointer to buffer. More...
 
struct  xrt_frame_context
 Object used to track all sinks and frame producers in a graph. More...
 
struct  xrt_fs_capture_parameters
 Controlling the camera capture parameters. More...
 
struct  xrt_fs_mode
 
struct  xrt_instance_info
 Information provided by the application at instance create time. More...
 
interface  xrt_instance
 This interface acts as a root object for Monado. More...
 
struct  xrt_prober_device
 A probed device, may or may not be opened. More...
 
struct  xrt_prober
 The main prober that probes and manages found but not opened HMD devices that are connected to the system. More...
 
struct  xrt_builder_estimate
 A estimate from a setter upper about how many devices they can open. More...
 
struct  xrt_builder
 Sets up a collection of devices and builds a system, a setter upper. More...
 
struct  xrt_prober_entry
 Entry for a single device. More...
 
struct  xrt_prober_entry_lists
 Main root of all of the probing device. More...
 
struct  xrt_tracking_override
 
struct  xrt_settings_tracking
 Holding enough information to recreate a tracking pipeline. More...
 
struct  xrt_tracking_origin
 A tracking system or device origin. More...
 
interface  xrt_tracking_factory
 Tracking factory. More...
 
struct  xrt_tracking_sample
 IMU Sample. More...
 
struct  xrt_imu_sample
 IMU Sample. More...
 
interface  xrt_imu_sink
 An object to send IMU samples to. More...
 
interface  xrt_pose_sink
 An object to send pairs of timestamps and poses to. More...
 
struct  xrt_slam_sinks
 Container of pointers to sinks that could be used for a SLAM system. More...
 
interface  xrt_tracked_psmv
 A single tracked PS Move controller, camera and ball are not synced. More...
 
interface  xrt_tracked_psvr
 A tracked PSVR headset. More...
 
interface  xrt_tracked_slam
 An adapter that wraps an external SLAM tracker to provide SLAM tracking. More...
 
interface  xrt_device
 A single HMD or input device. More...
 
interface  xrt_frame_sink
 A object that is sent frames. More...
 
interface  xrt_frame_node
 A interface object used for destroying a frame graph. More...
 
interface  xrt_fs
 Frameserver that generates frames. More...
 
interface  xrt_auto_prober
 An interface to be exposed by a device driver that should probe for the existence of its own device on the system, rather than using shared probers with vendor/product IDs, etc. More...
 

Macros

#define XRT_DEBUGBREAK()
 To trigger a trap/break in the debugger. More...
 
#define container_of(ptr, type, field)   (type *)((char *)ptr - offsetof(type, field))
 Get the holder from a pointer to a field. More...
 
#define XRT_MAX_SWAPCHAIN_IMAGES   8
 Max swapchain images, artificial limit. More...
 
#define XRT_MAX_SWAPCHAIN_FORMATS   16
 Max formats supported by a compositor, artificial limit. More...
 
#define XRT_UUID_SIZE   16
 Internal define for VK_UUID_SIZE and XR_UUID_SIZE_EXT. More...
 
#define XRT_LUID_SIZE   8
 Internal define for VK_LUID_SIZE. More...
 
#define XRT_MATRIX_2X2_ELEMENTS   4
 The number of values in xrt_matrix_2x2. More...
 
#define XRT_MATRIX_2X2_VECS   2
 The number of 2d vectors in xrt_matrix_2x2. More...
 
#define XRT_MATRIX_3X3_ELEMENTS   9
 The number of values in xrt_matrix_3x3. More...
 
#define XRT_MATRIX_4X4_ELEMENTS   16
 The number of values in a 4x4 matrix like xrt_matrix_4x4 and xrt_matrix_4x4_f64. More...
 
#define XRT_INPUT_NAME(id, type)   ((id << 8) | XRT_INPUT_TYPE_##type)
 Create an enum value for xrt_input_name that packs an ID and input type. More...
 
#define XRT_GET_INPUT_TYPE(name)   ((enum xrt_input_type)(name & 0xff))
 Extract the xrt_input_type from an xrt_input_name. More...
 
#define XRT_GET_INPUT_ID(name)   ((uint32_t)(name >> 8))
 Extract the xrt_input_name id from an xrt_input_name. More...
 
#define XRT_HAND_JOINT_COUNT   26
 Number of joints in a hand. More...
 
#define XRT_FINGER_COUNT   5
 Number of fingers on a hand. More...
 
#define XRT_MIN_HAPTIC_DURATION   -1
 Value used to indicate a haptic pulse of the minimal supported duration. More...
 
#define XRT_FREQUENCY_UNSPECIFIED   0
 Value used to indicate a haptic pulse of some runtime defined optimal frequency. More...
 
#define XRT_INFINITE_DURATION   (0x7fffffffffffffffLL)
 Value used as a timeout to indicate the timeout should never occur. More...
 
#define XRT_MAX_APPLICATION_NAME_SIZE   128
 
#define XRT_MAX_DEVICES_PER_PROBE   16
 The maximum number of devices that a single xrt_prober_entry::found or xrt_auto_prober::lelo_dallas_autoprobe function called by the prober can create per-call. More...
 
#define XRT_MAX_AUTO_PROBERS   16
 The maximum number of xrt_auto_prober instances that can be handled. More...
 
#define XRT_SETTINGS_CAMERA_NAME_LENGTH   256
 
#define XRT_SETTINGS_PATH_LENGTH   1024
 
#define XRT_MAX_TRACKING_OVERRIDES   16
 

Typedefs

typedef struct xrt_uuid xrt_uuid_t
 Typedef for xrt_uuid. More...
 
typedef struct xrt_luid xrt_luid_t
 Typedef for xrt_luid. More...
 
typedef void(* xrt_prober_list_video_func_t) (struct xrt_prober *xp, struct xrt_prober_device *pdev, const char *product, const char *manufacturer, const char *serial, void *ptr)
 Callback for listing video devices. More...
 
typedef struct xrt_builder *(* xrt_builder_create_func_t) (void)
 Function pointer type for creating a xrt_builder. More...
 
typedef struct xrt_auto_prober *(* xrt_auto_prober_create_func_t) ()
 Function pointer type for creating a auto prober. More...
 
typedef enum xrt_result xrt_result_t
 Result type used across Monado. More...
 

Enumerations

enum  t_image_boundary_type { HT_IMAGE_BOUNDARY_NONE , HT_IMAGE_BOUNDARY_CIRCLE }
 Image boundary type. More...
 
enum  t_hand_tracking_algorithm { HT_ALGORITHM_MERCURY , HT_ALGORITHM_OLD_RGB }
 Which hand-tracking algorithm should we use? More...
 
enum  xrt_swapchain_create_flags { XRT_SWAPCHAIN_CREATE_PROTECTED_CONTENT = (1 << 0) , XRT_SWAPCHAIN_CREATE_STATIC_IMAGE = (1 << 1) }
 Special flags for creating swapchain images. More...
 
enum  xrt_swapchain_usage_bits {
  XRT_SWAPCHAIN_USAGE_COLOR = 0x00000001 , XRT_SWAPCHAIN_USAGE_DEPTH_STENCIL = 0x00000002 , XRT_SWAPCHAIN_USAGE_UNORDERED_ACCESS = 0x00000004 , XRT_SWAPCHAIN_USAGE_TRANSFER_SRC = 0x00000008 ,
  XRT_SWAPCHAIN_USAGE_TRANSFER_DST = 0x00000010 , XRT_SWAPCHAIN_USAGE_SAMPLED = 0x00000020 , XRT_SWAPCHAIN_USAGE_MUTABLE_FORMAT = 0x00000040 , XRT_SWAPCHAIN_USAGE_INPUT_ATTACHMENT = 0x00000080
}
 Usage of the swapchain images. More...
 
enum  xrt_view_type { XRT_VIEW_TYPE_MONO = 1 , XRT_VIEW_TYPE_STEREO = 2 }
 View type to be rendered to by the compositor. More...
 
enum  xrt_layer_type {
  XRT_LAYER_STEREO_PROJECTION , XRT_LAYER_STEREO_PROJECTION_DEPTH , XRT_LAYER_QUAD , XRT_LAYER_CUBE ,
  XRT_LAYER_CYLINDER , XRT_LAYER_EQUIRECT1 , XRT_LAYER_EQUIRECT2
}
 Layer type. More...
 
enum  xrt_layer_composition_flags { XRT_LAYER_COMPOSITION_CORRECT_CHROMATIC_ABERRATION_BIT = 1 << 0 , XRT_LAYER_COMPOSITION_BLEND_TEXTURE_SOURCE_ALPHA_BIT = 1 << 1 , XRT_LAYER_COMPOSITION_UNPREMULTIPLIED_ALPHA_BIT = 1 << 2 , XRT_LAYER_COMPOSITION_VIEW_SPACE_BIT = 1 << 3 }
 Bit field for holding information about how a layer should be composited. More...
 
enum  xrt_layer_eye_visibility { XRT_LAYER_EYE_VISIBILITY_NONE = 0x0 , XRT_LAYER_EYE_VISIBILITY_LEFT_BIT = 0x1 , XRT_LAYER_EYE_VISIBILITY_RIGHT_BIT = 0x2 , XRT_LAYER_EYE_VISIBILITY_BOTH = 0x3 }
 Which view is the layer visible to? More...
 
enum  xrt_compositor_event_type { XRT_COMPOSITOR_EVENT_NONE = 0 , XRT_COMPOSITOR_EVENT_STATE_CHANGE = 1 , XRT_COMPOSITOR_EVENT_OVERLAY_CHANGE = 2 }
 Event type for compositor events, none means no event was returned. More...
 
enum  xrt_compositor_frame_point { XRT_COMPOSITOR_FRAME_POINT_WOKE }
 
enum  xrt_blend_mode { XRT_BLEND_MODE_OPAQUE = 1 , XRT_BLEND_MODE_ADDITIVE = 2 , XRT_BLEND_MODE_ALPHA_BLEND = 3 , XRT_BLEND_MODE_MAX_ENUM }
 Blend mode that the device supports, exact mirror of XrEnvironmentBlendMode. More...
 
enum  xrt_stereo_format { XRT_STEREO_FORMAT_NONE , XRT_STEREO_FORMAT_SBS , XRT_STEREO_FORMAT_INTERLEAVED , XRT_STEREO_FORMAT_OAU }
 What type of stereo format a frame has. More...
 
enum  xrt_space_relation_flags {
  XRT_SPACE_RELATION_ORIENTATION_VALID_BIT = (1 << 0) , XRT_SPACE_RELATION_POSITION_VALID_BIT = (1 << 1) , XRT_SPACE_RELATION_LINEAR_VELOCITY_VALID_BIT = (1 << 2) , XRT_SPACE_RELATION_ANGULAR_VELOCITY_VALID_BIT = (1 << 3) ,
  XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT = (1 << 4) , XRT_SPACE_RELATION_POSITION_TRACKED_BIT = (1 << 5) , XRT_SPACE_RELATION_BITMASK_ALL , XRT_SPACE_RELATION_BITMASK_NONE = 0
}
 Flags of which components of a xrt_space_relation is valid. More...
 
enum  xrt_device_type {
  XRT_DEVICE_TYPE_UNKNOWN = 0 , XRT_DEVICE_TYPE_HMD , XRT_DEVICE_TYPE_RIGHT_HAND_CONTROLLER , XRT_DEVICE_TYPE_LEFT_HAND_CONTROLLER ,
  XRT_DEVICE_TYPE_ANY_HAND_CONTROLLER , XRT_DEVICE_TYPE_GENERIC_TRACKER , XRT_DEVICE_TYPE_HAND_TRACKER
}
 How an xrt_device can be used. More...
 
enum  xrt_input_type {
  XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE = 0x00 , XRT_INPUT_TYPE_VEC1_MINUS_ONE_TO_ONE = 0x01 , XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE = 0x02 , XRT_INPUT_TYPE_VEC3_MINUS_ONE_TO_ONE = 0x03 ,
  XRT_INPUT_TYPE_BOOLEAN = 0x04 , XRT_INPUT_TYPE_POSE = 0x05 , XRT_INPUT_TYPE_HAND_TRACKING = 0x06
}
 Base type of this inputs. More...
 
enum  xrt_input_name {
  XRT_INPUT_GENERIC_HEAD_POSE = (( 0x0000 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_GENERIC_HEAD_DETECT = (( 0x0001 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_GENERIC_HAND_TRACKING_LEFT = (( 0x0002 << 8) | XRT_INPUT_TYPE_HAND_TRACKING ) , XRT_INPUT_GENERIC_HAND_TRACKING_RIGHT = (( 0x0004 << 8) | XRT_INPUT_TYPE_HAND_TRACKING ) ,
  XRT_INPUT_GENERIC_TRACKER_POSE = (( 0x0005 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_SIMPLE_SELECT_CLICK = (( 0x0010 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_SIMPLE_MENU_CLICK = (( 0x0011 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_SIMPLE_GRIP_POSE = (( 0x0012 << 8) | XRT_INPUT_TYPE_POSE ) ,
  XRT_INPUT_SIMPLE_AIM_POSE = (( 0x0013 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_PSMV_PS_CLICK = (( 0x0020 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_PSMV_MOVE_CLICK = (( 0x0021 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_PSMV_START_CLICK = (( 0x0022 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_PSMV_SELECT_CLICK = (( 0x0023 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_PSMV_SQUARE_CLICK = (( 0x0024 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_PSMV_CROSS_CLICK = (( 0x0025 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_PSMV_CIRCLE_CLICK = (( 0x0026 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_PSMV_TRIANGLE_CLICK = (( 0x0027 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_PSMV_TRIGGER_VALUE = (( 0x0028 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) , XRT_INPUT_PSMV_GRIP_POSE = (( 0x0029 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_PSMV_AIM_POSE = (( 0x002A << 8) | XRT_INPUT_TYPE_POSE ) ,
  XRT_INPUT_PSMV_BODY_CENTER_POSE = (( 0x002B << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_PSMV_BALL_CENTER_POSE = (( 0x002C << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_HYDRA_1_CLICK = (( 0x0030 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_HYDRA_2_CLICK = (( 0x0031 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_HYDRA_3_CLICK = (( 0x0032 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_HYDRA_4_CLICK = (( 0x0033 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_HYDRA_MIDDLE_CLICK = (( 0x0034 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_HYDRA_BUMPER_CLICK = (( 0x0035 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_HYDRA_JOYSTICK_CLICK = (( 0x0036 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_HYDRA_JOYSTICK_VALUE = (( 0x0037 << 8) | XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE ) , XRT_INPUT_HYDRA_TRIGGER_VALUE = (( 0x0038 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) , XRT_INPUT_HYDRA_POSE = (( 0x0039 << 8) | XRT_INPUT_TYPE_POSE ) ,
  XRT_INPUT_DAYDREAM_TOUCHPAD_CLICK = (( 0x0040 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_DAYDREAM_BAR_CLICK = (( 0x0041 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_DAYDREAM_CIRCLE_CLICK = (( 0x0042 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_DAYDREAM_VOLUP_CLICK = (( 0x0043 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_DAYDREAM_VOLDN_CLICK = (( 0x0044 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_DAYDREAM_TOUCHPAD = (( 0x0045 << 8) | XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE ) , XRT_INPUT_DAYDREAM_POSE = (( 0x0046 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_DAYDREAM_TOUCHPAD_TOUCH = (( 0x0047 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_INDEX_SYSTEM_CLICK = (( 0x0050 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_INDEX_SYSTEM_TOUCH = (( 0x0051 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_INDEX_A_CLICK = (( 0x0052 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_INDEX_A_TOUCH = (( 0x0053 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_INDEX_B_CLICK = (( 0x0054 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_INDEX_B_TOUCH = (( 0x0055 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_INDEX_SQUEEZE_VALUE = (( 0x0056 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) , XRT_INPUT_INDEX_SQUEEZE_FORCE = (( 0x0057 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) ,
  XRT_INPUT_INDEX_TRIGGER_CLICK = (( 0x0058 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_INDEX_TRIGGER_VALUE = (( 0x0059 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) , XRT_INPUT_INDEX_TRIGGER_TOUCH = (( 0x005A << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_INDEX_THUMBSTICK = (( 0x005B << 8) | XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE ) ,
  XRT_INPUT_INDEX_THUMBSTICK_CLICK = (( 0x005D << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_INDEX_THUMBSTICK_TOUCH = (( 0x005E << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_INDEX_TRACKPAD = (( 0x005F << 8) | XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE ) , XRT_INPUT_INDEX_TRACKPAD_FORCE = (( 0x0061 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) ,
  XRT_INPUT_INDEX_TRACKPAD_TOUCH = (( 0x0062 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_INDEX_GRIP_POSE = (( 0x0063 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_INDEX_AIM_POSE = (( 0x0064 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_VIVE_SYSTEM_CLICK = (( 0x0070 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_VIVE_SQUEEZE_CLICK = (( 0x0071 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_VIVE_MENU_CLICK = (( 0x0072 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_VIVE_TRIGGER_CLICK = (( 0x0073 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_VIVE_TRIGGER_VALUE = (( 0x0074 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) ,
  XRT_INPUT_VIVE_TRACKPAD = (( 0x0075 << 8) | XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE ) , XRT_INPUT_VIVE_TRACKPAD_CLICK = (( 0x0076 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_VIVE_TRACKPAD_TOUCH = (( 0x0077 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_VIVE_GRIP_POSE = (( 0x0078 << 8) | XRT_INPUT_TYPE_POSE ) ,
  XRT_INPUT_VIVE_AIM_POSE = (( 0x0079 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_VIVEPRO_SYSTEM_CLICK = (( 0x0080 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_VIVEPRO_VOLUP_CLICK = (( 0x0081 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_VIVEPRO_VOLDN_CLICK = (( 0x0082 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_VIVEPRO_MUTE_MIC_CLICK = (( 0x0083 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_WMR_MENU_CLICK = (( 0x0090 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_WMR_SQUEEZE_CLICK = (( 0x0091 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_WMR_TRIGGER_VALUE = (( 0x0092 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) ,
  XRT_INPUT_WMR_THUMBSTICK_CLICK = (( 0x0093 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_WMR_THUMBSTICK = (( 0x0094 << 8) | XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE ) , XRT_INPUT_WMR_TRACKPAD_CLICK = (( 0x0095 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_WMR_TRACKPAD_TOUCH = (( 0x0096 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_WMR_TRACKPAD = (( 0x0097 << 8) | XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE ) , XRT_INPUT_WMR_GRIP_POSE = (( 0x0098 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_WMR_AIM_POSE = (( 0x0099 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_XBOX_MENU_CLICK = (( 0x00A0 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_XBOX_VIEW_CLICK = (( 0x00A1 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_XBOX_A_CLICK = (( 0x00A2 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_XBOX_B_CLICK = (( 0x00A3 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_XBOX_X_CLICK = (( 0x00A4 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_XBOX_Y_CLICK = (( 0x00A5 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_XBOX_DPAD_DOWN_CLICK = (( 0x00A6 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_XBOX_DPAD_RIGHT_CLICK = (( 0x00A7 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_XBOX_DPAD_UP_CLICK = (( 0x00A8 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_XBOX_DPAD_LEFT_CLICK = (( 0x00A9 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_XBOX_SHOULDER_LEFT_CLICK = (( 0x00AA << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_XBOX_SHOULDER_RIGHT_CLICK = (( 0x00AB << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_XBOX_THUMBSTICK_LEFT_CLICK = (( 0x00AC << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_XBOX_THUMBSTICK_LEFT = (( 0x00AD << 8) | XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE ) , XRT_INPUT_XBOX_THUMBSTICK_RIGHT_CLICK = (( 0x00AE << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_XBOX_THUMBSTICK_RIGHT = (( 0x00AF << 8) | XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE ) , XRT_INPUT_XBOX_LEFT_TRIGGER_VALUE = (( 0x00B0 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) ,
  XRT_INPUT_XBOX_RIGHT_TRIGGER_VALUE = (( 0x00B1 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) , XRT_INPUT_GO_SYSTEM_CLICK = (( 0x00B0 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_GO_TRIGGER_CLICK = (( 0x00B1 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_GO_BACK_CLICK = (( 0x00B2 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_GO_TRACKPAD_CLICK = (( 0x00B3 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_GO_TRACKPAD_TOUCH = (( 0x00B4 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_GO_TRACKPAD = (( 0x00B5 << 8) | XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE ) , XRT_INPUT_GO_GRIP_POSE = (( 0x00B6 << 8) | XRT_INPUT_TYPE_POSE ) ,
  XRT_INPUT_GO_AIM_POSE = (( 0x00B7 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_TOUCH_X_CLICK = (( 0x00C0 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_TOUCH_X_TOUCH = (( 0x00C1 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_TOUCH_Y_CLICK = (( 0x00C2 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_TOUCH_Y_TOUCH = (( 0x00C3 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_TOUCH_MENU_CLICK = (( 0x00C4 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_TOUCH_A_CLICK = (( 0x00C5 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_TOUCH_A_TOUCH = (( 0x00C6 << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_TOUCH_B_CLICK = (( 0x00C7 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_TOUCH_B_TOUCH = (( 0x00C8 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_TOUCH_SYSTEM_CLICK = (( 0x00C9 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_TOUCH_SQUEEZE_VALUE = (( 0x00CA << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) ,
  XRT_INPUT_TOUCH_TRIGGER_TOUCH = (( 0x00CB << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_TOUCH_TRIGGER_VALUE = (( 0x00CC << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) , XRT_INPUT_TOUCH_THUMBSTICK_CLICK = (( 0x00CD << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_TOUCH_THUMBSTICK_TOUCH = (( 0x00CE << 8) | XRT_INPUT_TYPE_BOOLEAN ) ,
  XRT_INPUT_TOUCH_THUMBSTICK = (( 0x00CF << 8) | XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE ) , XRT_INPUT_TOUCH_THUMBREST_TOUCH = (( 0x00D0 << 8) | XRT_INPUT_TYPE_BOOLEAN ) , XRT_INPUT_TOUCH_GRIP_POSE = (( 0x00D1 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_TOUCH_AIM_POSE = (( 0x00D2 << 8) | XRT_INPUT_TYPE_POSE ) ,
  XRT_INPUT_HAND_SELECT_VALUE = (( 0x00E0 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) , XRT_INPUT_HAND_SQUEEZE_VALUE = (( 0x00E1 << 8) | XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE ) , XRT_INPUT_HAND_GRIP_POSE = (( 0x00E2 << 8) | XRT_INPUT_TYPE_POSE ) , XRT_INPUT_HAND_AIM_POSE = (( 0x00E3 << 8) | XRT_INPUT_TYPE_POSE )
}
 Every internal input source known to monado with a baked in type. More...
 
enum  xrt_hand_joint {
  XRT_HAND_JOINT_PALM = 0 , XRT_HAND_JOINT_WRIST = 1 , XRT_HAND_JOINT_THUMB_METACARPAL = 2 , XRT_HAND_JOINT_THUMB_PROXIMAL = 3 ,
  XRT_HAND_JOINT_THUMB_DISTAL = 4 , XRT_HAND_JOINT_THUMB_TIP = 5 , XRT_HAND_JOINT_INDEX_METACARPAL = 6 , XRT_HAND_JOINT_INDEX_PROXIMAL = 7 ,
  XRT_HAND_JOINT_INDEX_INTERMEDIATE = 8 , XRT_HAND_JOINT_INDEX_DISTAL = 9 , XRT_HAND_JOINT_INDEX_TIP = 10 , XRT_HAND_JOINT_MIDDLE_METACARPAL = 11 ,
  XRT_HAND_JOINT_MIDDLE_PROXIMAL = 12 , XRT_HAND_JOINT_MIDDLE_INTERMEDIATE = 13 , XRT_HAND_JOINT_MIDDLE_DISTAL = 14 , XRT_HAND_JOINT_MIDDLE_TIP = 15 ,
  XRT_HAND_JOINT_RING_METACARPAL = 16 , XRT_HAND_JOINT_RING_PROXIMAL = 17 , XRT_HAND_JOINT_RING_INTERMEDIATE = 18 , XRT_HAND_JOINT_RING_DISTAL = 19 ,
  XRT_HAND_JOINT_RING_TIP = 20 , XRT_HAND_JOINT_LITTLE_METACARPAL = 21 , XRT_HAND_JOINT_LITTLE_PROXIMAL = 22 , XRT_HAND_JOINT_LITTLE_INTERMEDIATE = 23 ,
  XRT_HAND_JOINT_LITTLE_DISTAL = 24 , XRT_HAND_JOINT_LITTLE_TIP = 25 , XRT_HAND_JOINT_MAX_ENUM = 0x7FFFFFFF
}
 Number of joints in a hand. More...
 
enum  xrt_hand { XRT_HAND_LEFT = 0 , XRT_HAND_RIGHT = 1 }
 Enumeration for left and right hand. More...
 
enum  xrt_finger {
  XRT_FINGER_LITTLE = 0 , XRT_FINGER_RING , XRT_FINGER_MIDDLE , XRT_FINGER_INDEX ,
  XRT_FINGER_THUMB
}
 Names for fingers on a hand. More...
 
enum  xrt_output_type { XRT_OUTPUT_TYPE_VIBRATION = 0x00 }
 Base type of this output. More...
 
enum  xrt_output_name {
  XRT_OUTPUT_NAME_SIMPLE_VIBRATION = (( 0x0010 << 8) | XRT_OUTPUT_TYPE_VIBRATION ) , XRT_OUTPUT_NAME_PSMV_RUMBLE_VIBRATION = (( 0x0020 << 8) | XRT_OUTPUT_TYPE_VIBRATION ) , XRT_OUTPUT_NAME_INDEX_HAPTIC = (( 0x0030 << 8) | XRT_OUTPUT_TYPE_VIBRATION ) , XRT_OUTPUT_NAME_VIVE_HAPTIC = (( 0x0040 << 8) | XRT_OUTPUT_TYPE_VIBRATION ) ,
  XRT_OUTPUT_NAME_WMR_HAPTIC = (( 0x0050 << 8) | XRT_OUTPUT_TYPE_VIBRATION ) , XRT_OUTPUT_NAME_XBOX_HAPTIC_LEFT = (( 0x0060 << 8) | XRT_OUTPUT_TYPE_VIBRATION ) , XRT_OUTPUT_NAME_XBOX_HAPTIC_RIGHT = (( 0x0061 << 8) | XRT_OUTPUT_TYPE_VIBRATION ) , XRT_OUTPUT_NAME_XBOX_HAPTIC_LEFT_TRIGGER = (( 0x0062 << 8) | XRT_OUTPUT_TYPE_VIBRATION ) ,
  XRT_OUTPUT_NAME_XBOX_HAPTIC_RIGHT_TRIGGER = (( 0x0063 << 8) | XRT_OUTPUT_TYPE_VIBRATION ) , XRT_OUTPUT_NAME_TOUCH_HAPTIC = (( 0x0070 << 8) | XRT_OUTPUT_TYPE_VIBRATION )
}
 Name of a output with a baked in type. More...
 
enum  xrt_fs_capture_type { XRT_FS_CAPTURE_TYPE_TRACKING = 0 , XRT_FS_CAPTURE_TYPE_CALIBRATION = 1 }
 Enum describing which type of capture we are doing. More...
 
enum  xrt_result {
  XRT_SUCCESS = 0 , XRT_TIMEOUT = 2 , XRT_ERROR_IPC_FAILURE = -1 , XRT_ERROR_NO_IMAGE_AVAILABLE = -2 ,
  XRT_ERROR_VULKAN = -3 , XRT_ERROR_OPENGL = -4 , XRT_ERROR_FAILED_TO_SUBMIT_VULKAN_COMMANDS = -5 , XRT_ERROR_SWAPCHAIN_FLAG_VALID_BUT_UNSUPPORTED = -6 ,
  XRT_ERROR_ALLOCATION = -7 , XRT_ERROR_POSE_NOT_ACTIVE = -8 , XRT_ERROR_FENCE_CREATE_FAILED = -9 , XRT_ERROR_NATIVE_HANDLE_FENCE_ERROR = -10 ,
  XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED = -11 , XRT_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED = -12 , XRT_ERROR_EGL_CONFIG_MISSING = -13 , XRT_ERROR_THREADING_INIT_FAILURE = -14 ,
  XRT_ERROR_IPC_SESSION_NOT_CREATED = -15 , XRT_ERROR_IPC_SESSION_ALREADY_CREATED = -16 , XRT_ERROR_PROBER_NOT_SUPPORTED = -17 , XRT_ERROR_PROBER_CREATION_FAILED = -18 ,
  XRT_ERROR_PROBER_LIST_LOCKED = -19 , XRT_ERROR_PROBER_LIST_NOT_LOCKED = -20 , XRT_ERROR_PROBING_FAILED = -21 , XRT_ERROR_DEVICE_CREATION_FAILED = -22 ,
  XRT_ERROR_D3D = -23 , XRT_ERROR_D3D11 = -24 , XRT_ERROR_D3D12 = -25
}
 Result type used across Monado. More...
 
enum  xrt_settings_camera_type {
  XRT_SETTINGS_CAMERA_TYPE_REGULAR_MONO = 0 , XRT_SETTINGS_CAMERA_TYPE_REGULAR_SBS = 1 , XRT_SETTINGS_CAMERA_TYPE_SLAM = 2 , XRT_SETTINGS_CAMERA_TYPE_PS4 = 3 ,
  XRT_SETTINGS_CAMERA_TYPE_LEAP_MOTION = 4
}
 Camera type. More...
 
enum  xrt_tracking_override_type { XRT_TRACKING_OVERRIDE_DIRECT = 0 , XRT_TRACKING_OVERRIDE_ATTACHED }
 Tracking override type. More...
 
enum  xrt_tracking_type {
  XRT_TRACKING_TYPE_NONE , XRT_TRACKING_TYPE_RGB , XRT_TRACKING_TYPE_LIGHTHOUSE , XRT_TRACKING_TYPE_HYDRA ,
  XRT_TRACKING_TYPE_EXTERNAL_SLAM , XRT_TRACKING_TYPE_OTHER
}
 What kind of tracking system is this. More...
 

Functions

void xrt_gfx_gl_get_versions (struct xrt_api_requirements *ver)
 
void xrt_gfx_gles_get_versions (struct xrt_api_requirements *ver)
 
void xrt_gfx_vk_get_versions (struct xrt_api_requirements *ver)
 
static void xrt_swapchain_reference (struct xrt_swapchain **dst, struct xrt_swapchain *src)
 Update the reference counts on swapchain(s). More...
 
static xrt_result_t xrt_swapchain::xrt_swapchain_acquire_image (struct xrt_swapchain *xsc, uint32_t *out_index)
 Obtain the index of the next image to use, without blocking on being able to write to it. More...
 
static xrt_result_t xrt_swapchain::xrt_swapchain_wait_image (struct xrt_swapchain *xsc, uint64_t timeout_ns, uint32_t index)
 Wait until image index is available for exclusive use, or until timeout_ns expires. More...
 
static xrt_result_t xrt_swapchain::xrt_swapchain_release_image (struct xrt_swapchain *xsc, uint32_t index)
 See xrReleaseSwapchainImage, state tracker needs to track index. More...
 
static xrt_result_t xrt_compositor_fence::xrt_compositor_fence_wait (struct xrt_compositor_fence *xcf, uint64_t timeout)
 Waits on the fence with the given timeout. More...
 
static void xrt_compositor_fence::xrt_compositor_fence_destroy (struct xrt_compositor_fence **xcf_ptr)
 Destroys the fence. More...
 
static void xrt_compositor_semaphore_reference (struct xrt_compositor_semaphore **dst, struct xrt_compositor_semaphore *src)
 Update the reference counts on compositor semaphore(s). More...
 
static xrt_result_t xrt_compositor_semaphore::xrt_compositor_semaphore_wait (struct xrt_compositor_semaphore *xcsem, uint64_t value, uint64_t timeout)
 Does a CPU side wait on the semaphore to reach the given value. More...
 
static xrt_result_t xrt_compositor::xrt_comp_get_swapchain_create_properties (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain_create_properties *xsccp)
 For a given xrt_swapchain_create_info struct returns a filled out xrt_swapchain_create_properties. More...
 
static xrt_result_t xrt_compositor::xrt_comp_poll_events (struct xrt_compositor *xc, union xrt_compositor_event *out_xce)
 Poll events from this compositor. More...
 
static void xrt_compositor::xrt_comp_destroy (struct xrt_compositor **xc_ptr)
 Teardown the compositor. More...
 
static void xrt_swapchain_native_reference (struct xrt_swapchain_native **dst, struct xrt_swapchain_native *src)
 Update the reference counts on swapchain(s). More...
 
static xrt_result_t xrt_compositor_native::xrt_comp_native_create_swapchain (struct xrt_compositor_native *xcn, const struct xrt_swapchain_create_info *info, struct xrt_swapchain_native **out_xscn)
 Create a native swapchain with a set of images. More...
 
static void xrt_compositor_native::xrt_comp_native_destroy (struct xrt_compositor_native **xcn_ptr)
 Teardown the compositor. More...
 
static xrt_result_t xrt_system_compositor::xrt_syscomp_set_state (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, bool visible, bool focused)
 Sets the state of the compositor, generating any events to the client if the state is actually changed. More...
 
static xrt_result_t xrt_system_compositor::xrt_syscomp_set_z_order (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, int64_t z_order)
 Set the rendering Z order for rendering, visible has higher priority then z_order but is still saved until visible again. More...
 
static xrt_result_t xrt_system_compositor::xrt_syscomp_set_main_app_visibility (struct xrt_system_compositor *xsc, struct xrt_compositor *xc, bool visible)
 Tell this client/session if the main application is visible or not. More...
 
static xrt_result_t xrt_system_compositor::xrt_syscomp_create_native_compositor (struct xrt_system_compositor *xsc, const struct xrt_session_info *xsi, struct xrt_compositor_native **out_xcn)
 Create a new native compositor. More...
 
static void xrt_system_compositor::xrt_syscomp_destroy (struct xrt_system_compositor **xsc_ptr)
 Teardown the system compositor. More...
 
static void xrt_image_native_allocator::xrt_images_destroy (struct xrt_image_native_allocator **xina_ptr)
 Destroy the image allocator. More...
 
static void xrt_frame_reference (struct xrt_frame **dst, struct xrt_frame *src)
 Update the reference counts on frame(s). More...
 
struct xrt_compositor_d3d11xrt_compositor_native::xrt_gfx_d3d11_provider_create (struct xrt_compositor_native *xcn, ID3D11Device *device)
 Create a D3D11 compositor client. More...
 
struct xrt_compositor_d3d12xrt_compositor_native::xrt_gfx_d3d12_provider_create (struct xrt_compositor_native *xcn, ID3D12Device *device, ID3D12CommandQueue *queue)
 Create a D3D12 compositor client. More...
 
xrt_result_t xrt_compositor_native::xrt_gfx_provider_create_gl_egl (struct xrt_compositor_native *xcn, EGLDisplay display, EGLConfig config, EGLContext context, PFNEGLGETPROCADDRESSPROC get_gl_procaddr, struct xrt_compositor_gl **out_xcgl)
 Create an OpenGL(ES) compositor client using EGL. More...
 
xrt_result_t xrt_gfx_provider_create_system (struct xrt_device *xdev, struct xrt_system_compositor **out_xsysc)
 Creates the main system compositor. More...
 
struct xrt_compositor_vkxrt_compositor_native::xrt_gfx_vk_provider_create (struct xrt_compositor_native *xcn, VkInstance instance, PFN_vkGetInstanceProcAddr get_instance_proc_addr, VkPhysicalDevice physical_device, VkDevice device, bool external_fence_fd_enabled, bool external_semaphore_fd_enabled, bool timeline_semaphore_enabled, uint32_t queue_family_index, uint32_t queue_index)
 Create a Vulkan compositor client. More...
 
struct xrt_compositor_glxrt_compositor_native::xrt_gfx_provider_create_gl_xlib (struct xrt_compositor_native *xcn, Display *xDisplay, uint32_t visualid, GLXFBConfig glxFBConfig, GLXDrawable glxDrawable, GLXContext glxContext)
 Create an OpenGL compositor client using xlib. More...
 
static xrt_result_t xrt_instance::xrt_instance_create_system (struct xrt_instance *xinst, struct xrt_system_devices **out_xsysd, struct xrt_system_compositor **out_xsysc)
 Creates all of the system resources like the devices and system compositor. More...
 
static xrt_result_t xrt_instance::xrt_instance_get_prober (struct xrt_instance *xinst, struct xrt_prober **out_xp)
 Get the instance xrt_prober, if any. More...
 
static void xrt_instance::xrt_instance_destroy (struct xrt_instance **xinst_ptr)
 Destroy an xrt_instance - helper function. More...
 
static void xrt_imu_sink::xrt_sink_push_imu (struct xrt_imu_sink *sink, struct xrt_imu_sample *sample)
 
static void xrt_pose_sink::xrt_sink_push_pose (struct xrt_pose_sink *sink, timepoint_ns ts, struct xrt_pose *pose)
 
static void xrt_tracked_psmv::xrt_tracked_psmv_get_tracked_pose (struct xrt_tracked_psmv *psmv, enum xrt_input_name name, timepoint_ns when_ns, struct xrt_space_relation *out_relation)
 
static void xrt_tracked_psmv::xrt_tracked_psmv_push_imu (struct xrt_tracked_psmv *psmv, timepoint_ns timestamp_ns, struct xrt_tracking_sample *sample)
 
static void xrt_tracked_psmv::xrt_tracked_psmv_destroy (struct xrt_tracked_psmv **xtmv_ptr)
 
static void xrt_tracked_psmv::xrt_tracked_psvr_get_tracked_pose (struct xrt_tracked_psvr *psvr, timepoint_ns when_ns, struct xrt_space_relation *out_relation)
 
static void xrt_tracked_psmv::xrt_tracked_psvr_push_imu (struct xrt_tracked_psvr *psvr, timepoint_ns timestamp_ns, struct xrt_tracking_sample *sample)
 
static void xrt_tracked_psmv::xrt_tracked_psvr_destroy (struct xrt_tracked_psvr **xtvr_ptr)
 
static void xrt_tracked_slam::xrt_tracked_slam_get_tracked_pose (struct xrt_tracked_slam *slam, timepoint_ns when_ns, struct xrt_space_relation *out_relation)
 

Variables

const char * xrt_gfx_vk_instance_extensions
 A space-delimited string of Vulkan instance extensions required from a client. More...
 
const char * xrt_gfx_vk_device_extensions
 A space-delimited string of Vulkan device extensions required from a client. More...
 

Swapchain and sync creation and import methods

static xrt_result_t xrt_compositor::xrt_comp_create_swapchain (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain **out_xsc)
 Create a swapchain with a set of images. More...
 
static xrt_result_t xrt_compositor::xrt_comp_import_swapchain (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_image_native *native_images, uint32_t image_count, struct xrt_swapchain **out_xsc)
 Create a swapchain from a set of native images. More...
 
static xrt_result_t xrt_compositor::xrt_comp_import_fence (struct xrt_compositor *xc, xrt_graphics_sync_handle_t handle, struct xrt_compositor_fence **out_xcf)
 Create a compositor fence from a native sync handle. More...
 
static xrt_result_t xrt_compositor::xrt_comp_create_semaphore (struct xrt_compositor *xc, xrt_graphics_sync_handle_t *out_handle, struct xrt_compositor_semaphore **out_xcsem)
 Create a compositor semaphore, also returns a native handle. More...
 

Session methods

static xrt_result_t xrt_compositor::xrt_comp_begin_session (struct xrt_compositor *xc, enum xrt_view_type view_type)
 See xrBeginSession. More...
 
static xrt_result_t xrt_compositor::xrt_comp_end_session (struct xrt_compositor *xc)
 See xrEndSession, unlike the OpenXR one the state tracker is responsible to call discard frame before calling this function. More...
 

Frame-related methods

Related to the OpenXR xr*Frame functions

static xrt_result_t xrt_compositor::xrt_comp_predict_frame (struct xrt_compositor *xc, int64_t *out_frame_id, uint64_t *out_wake_time_ns, uint64_t *out_predicted_gpu_time_ns, uint64_t *out_predicted_display_time_ns, uint64_t *out_predicted_display_period_ns)
 This function and mark_frame function calls are a alternative to wait_frame. More...
 
static xrt_result_t xrt_compositor::xrt_comp_mark_frame (struct xrt_compositor *xc, int64_t frame_id, enum xrt_compositor_frame_point point, uint64_t when_ns)
 This function and predict_frame function calls are a alternative to wait_frame. More...
 
static xrt_result_t xrt_compositor::xrt_comp_wait_frame (struct xrt_compositor *xc, int64_t *out_frame_id, uint64_t *out_predicted_display_time, uint64_t *out_predicted_display_period)
 See xrWaitFrame. More...
 
static xrt_result_t xrt_compositor::xrt_comp_begin_frame (struct xrt_compositor *xc, int64_t frame_id)
 See xrBeginFrame. More...
 
static xrt_result_t xrt_compositor::xrt_comp_discard_frame (struct xrt_compositor *xc, int64_t frame_id)
 Explicitly discard a frame. More...
 

Layer submission methods

Equivalent to xrEndFrame, but split across multiple calls.

static xrt_result_t xrt_compositor::xrt_comp_layer_begin (struct xrt_compositor *xc, int64_t frame_id, uint64_t display_time_ns, enum xrt_blend_mode env_blend_mode)
 Begins layer submission. More...
 
static xrt_result_t xrt_compositor::xrt_comp_layer_stereo_projection (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *l_xsc, struct xrt_swapchain *r_xsc, const struct xrt_layer_data *data)
 Adds a stereo projection layer for submissions. More...
 
static xrt_result_t xrt_compositor::xrt_comp_layer_stereo_projection_depth (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *l_xsc, struct xrt_swapchain *r_xsc, struct xrt_swapchain *l_d_xsc, struct xrt_swapchain *r_d_xsc, const struct xrt_layer_data *data)
 Adds a stereo projection layer for submission, has depth information. More...
 
static xrt_result_t xrt_compositor::xrt_comp_layer_quad (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a quad layer for submission, the center of the quad is specified by the pose and extends outwards from it. More...
 
static xrt_result_t xrt_compositor::xrt_comp_layer_cube (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a cube layer for submission. More...
 
static xrt_result_t xrt_compositor::xrt_comp_layer_cylinder (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a cylinder layer for submission. More...
 
static xrt_result_t xrt_compositor::xrt_comp_layer_equirect1 (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a equirect1 layer for submission. More...
 
static xrt_result_t xrt_compositor::xrt_comp_layer_equirect2 (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a equirect2 layer for submission. More...
 
static xrt_result_t xrt_compositor::xrt_comp_layer_commit (struct xrt_compositor *xc, int64_t frame_id, xrt_graphics_sync_handle_t sync_handle)
 Commits all of the submitted layers. More...
 
static xrt_result_t xrt_compositor::xrt_comp_layer_commit_with_semaphore (struct xrt_compositor *xc, int64_t frame_id, struct xrt_compositor_semaphore *xcsem, uint64_t value)
 Commits all of the submitted layers, with a semaphore. More...
 

Factory

Implemented in each target.

xrt_result_t xrt_instance_create (struct xrt_instance_info *ii, struct xrt_instance **out_xinst)
 Create an implementation of the xrt_instance interface. More...
 

Detailed Description

The main interface shared between the different components of Monado.

Macro Definition Documentation

◆ container_of

#define container_of (   ptr,
  type,
  field 
)    (type *)((char *)ptr - offsetof(type, field))

#include <xrt/xrt_compiler.h>

Get the holder from a pointer to a field.

◆ XRT_DEBUGBREAK

#define XRT_DEBUGBREAK ( )

#include <xrt/xrt_compiler.h>

To trigger a trap/break in the debugger.

◆ XRT_FINGER_COUNT

#define XRT_FINGER_COUNT   5

#include <xrt/xrt_defines.h>

Number of fingers on a hand.

◆ XRT_FREQUENCY_UNSPECIFIED

#define XRT_FREQUENCY_UNSPECIFIED   0

#include <xrt/xrt_defines.h>

Value used to indicate a haptic pulse of some runtime defined optimal frequency.

◆ XRT_GET_INPUT_ID

#define XRT_GET_INPUT_ID (   name)    ((uint32_t)(name >> 8))

#include <xrt/xrt_defines.h>

Extract the xrt_input_name id from an xrt_input_name.

Parameters
nameA xrt_input_name value
Returns
xrt_input_type

◆ XRT_GET_INPUT_TYPE

#define XRT_GET_INPUT_TYPE (   name)    ((enum xrt_input_type)(name & 0xff))

#include <xrt/xrt_defines.h>

Extract the xrt_input_type from an xrt_input_name.

Parameters
nameA xrt_input_name value
Returns
xrt_input_type

◆ XRT_HAND_JOINT_COUNT

#define XRT_HAND_JOINT_COUNT   26

#include <xrt/xrt_defines.h>

Number of joints in a hand.

Corresponds to XR_HAND_JOINT_COUNT_EXT.

See also
xrt_hand_joint

◆ XRT_INFINITE_DURATION

#define XRT_INFINITE_DURATION   (0x7fffffffffffffffLL)

#include <xrt/xrt_defines.h>

Value used as a timeout to indicate the timeout should never occur.

◆ XRT_INPUT_NAME

#define XRT_INPUT_NAME (   id,
  type 
)    ((id << 8) | XRT_INPUT_TYPE_##type)

#include <xrt/xrt_defines.h>

Create an enum value for xrt_input_name that packs an ID and input type.

Parameters
idan integer
typeThe suffix of an xrt_input_type value name: XRT_INPUT_TYPE_ is prepended automatically.
See also
xrt_input_name

◆ XRT_LUID_SIZE

#define XRT_LUID_SIZE   8

#include <xrt/xrt_defines.h>

Internal define for VK_LUID_SIZE.

◆ XRT_MATRIX_2X2_ELEMENTS

#define XRT_MATRIX_2X2_ELEMENTS   4

#include <xrt/xrt_defines.h>

The number of values in xrt_matrix_2x2.

◆ XRT_MATRIX_2X2_VECS

#define XRT_MATRIX_2X2_VECS   2

#include <xrt/xrt_defines.h>

The number of 2d vectors in xrt_matrix_2x2.

◆ XRT_MATRIX_3X3_ELEMENTS

#define XRT_MATRIX_3X3_ELEMENTS   9

#include <xrt/xrt_defines.h>

The number of values in xrt_matrix_3x3.

◆ XRT_MATRIX_4X4_ELEMENTS

#define XRT_MATRIX_4X4_ELEMENTS   16

#include <xrt/xrt_defines.h>

The number of values in a 4x4 matrix like xrt_matrix_4x4 and xrt_matrix_4x4_f64.

◆ XRT_MAX_AUTO_PROBERS

#define XRT_MAX_AUTO_PROBERS   16

#include <xrt/xrt_prober.h>

The maximum number of xrt_auto_prober instances that can be handled.

◆ XRT_MAX_DEVICES_PER_PROBE

#define XRT_MAX_DEVICES_PER_PROBE   16

#include <xrt/xrt_prober.h>

The maximum number of devices that a single xrt_prober_entry::found or xrt_auto_prober::lelo_dallas_autoprobe function called by the prober can create per-call.

◆ XRT_MAX_SWAPCHAIN_FORMATS

#define XRT_MAX_SWAPCHAIN_FORMATS   16

#include <xrt/xrt_compositor.h>

Max formats supported by a compositor, artificial limit.

◆ XRT_MAX_SWAPCHAIN_IMAGES

#define XRT_MAX_SWAPCHAIN_IMAGES   8

#include <xrt/xrt_compositor.h>

Max swapchain images, artificial limit.

◆ XRT_MIN_HAPTIC_DURATION

#define XRT_MIN_HAPTIC_DURATION   -1

#include <xrt/xrt_defines.h>

Value used to indicate a haptic pulse of the minimal supported duration.

◆ XRT_UUID_SIZE

#define XRT_UUID_SIZE   16

#include <xrt/xrt_defines.h>

Internal define for VK_UUID_SIZE and XR_UUID_SIZE_EXT.

Typedef Documentation

◆ xrt_auto_prober_create_func_t

typedef struct xrt_auto_prober*(* xrt_auto_prober_create_func_t) ()

#include <xrt/xrt_prober.h>

Function pointer type for creating a auto prober.

◆ xrt_builder_create_func_t

typedef struct xrt_builder*(* xrt_builder_create_func_t) (void)

#include <xrt/xrt_prober.h>

Function pointer type for creating a xrt_builder.

◆ xrt_luid_t

typedef struct xrt_luid xrt_luid_t

#include <xrt/xrt_defines.h>

Typedef for xrt_luid.

◆ xrt_prober_list_video_func_t

typedef void(* xrt_prober_list_video_func_t) (struct xrt_prober *xp, struct xrt_prober_device *pdev, const char *product, const char *manufacturer, const char *serial, void *ptr)

#include <xrt/xrt_prober.h>

Callback for listing video devices.

Parameters
xpProber
pdevProber device being iterated
productProduct string, if available
manufacturerManufacturer string, if available
serialSerial number string, if available
ptrYour opaque userdata pointer as provided to xrt_prober_list_video_devices

◆ xrt_result_t

typedef enum xrt_result xrt_result_t

#include <xrt/xrt_results.h>

Result type used across Monado.

0 is XRT_SUCCESS, positive values are "special" non-error return codes (like timeout), negative values are errors.

See also
u_pp_xrt_result

◆ xrt_uuid_t

typedef struct xrt_uuid xrt_uuid_t

#include <xrt/xrt_defines.h>

Typedef for xrt_uuid.

Enumeration Type Documentation

◆ t_hand_tracking_algorithm

#include <tracking/t_hand_tracking.h>

Which hand-tracking algorithm should we use?

Never use HT_ALGORITHM_OLD_RGB. The tracking quality is extremely poor.

◆ t_image_boundary_type

#include <tracking/t_hand_tracking.h>

Image boundary type.

Currently used by hand-tracking to determine if parts of the hand are not visible to the camera, ie. they are outside of the camera's vignette.

◆ xrt_blend_mode

#include <xrt/xrt_defines.h>

Blend mode that the device supports, exact mirror of XrEnvironmentBlendMode.

This is not a bitmask because we want to be able to express a preference order that may vary by device, etc.

◆ xrt_compositor_event_type

#include <xrt/xrt_compositor.h>

Event type for compositor events, none means no event was returned.

◆ xrt_compositor_frame_point

#include <xrt/xrt_compositor.h>

Enumerator
XRT_COMPOSITOR_FRAME_POINT_WOKE 

The client woke up after waiting.

◆ xrt_device_type

#include <xrt/xrt_defines.h>

How an xrt_device can be used.

◆ xrt_finger

enum xrt_finger

#include <xrt/xrt_defines.h>

Names for fingers on a hand.

◆ xrt_fs_capture_type

#include <xrt/xrt_frameserver.h>

Enum describing which type of capture we are doing.

See also
xrt_fs

◆ xrt_hand

enum xrt_hand

#include <xrt/xrt_defines.h>

Enumeration for left and right hand.

◆ xrt_hand_joint

#include <xrt/xrt_defines.h>

Number of joints in a hand.

Corresponds to XrHandJointEXT.

◆ xrt_input_name

#include <xrt/xrt_defines.h>

Every internal input source known to monado with a baked in type.

See also
xrt_input_type
Enumerator
XRT_INPUT_GENERIC_HEAD_POSE 

Standard pose used for rendering.

◆ xrt_input_type

#include <xrt/xrt_defines.h>

Base type of this inputs.

Enumerator
XRT_INPUT_TYPE_VEC1_ZERO_TO_ONE 

Float input in [0, 1].

XRT_INPUT_TYPE_VEC1_MINUS_ONE_TO_ONE 

Float input in [-1, 1].

XRT_INPUT_TYPE_VEC2_MINUS_ONE_TO_ONE 

Vec2 input, components in [-1, 1].

XRT_INPUT_TYPE_VEC3_MINUS_ONE_TO_ONE 

Vec3 input, components in [-1, 1].

XRT_INPUT_TYPE_BOOLEAN 

Boolean (digital, binary) input.

XRT_INPUT_TYPE_POSE 

A tracked pose.

XRT_INPUT_TYPE_HAND_TRACKING 

A tracked hand.

◆ xrt_layer_composition_flags

#include <xrt/xrt_compositor.h>

Bit field for holding information about how a layer should be composited.

Enumerator
XRT_LAYER_COMPOSITION_VIEW_SPACE_BIT 

The layer is locked to the device and the pose should only be adjusted for the IPD.

◆ xrt_layer_eye_visibility

#include <xrt/xrt_compositor.h>

Which view is the layer visible to?

Used for quad layers.

Note
Doesn't have the same values as the OpenXR counterpart!

◆ xrt_layer_type

#include <xrt/xrt_compositor.h>

Layer type.

◆ xrt_output_name

#include <xrt/xrt_defines.h>

Name of a output with a baked in type.

See also
xrt_output_type

◆ xrt_output_type

#include <xrt/xrt_defines.h>

Base type of this output.

◆ xrt_result

enum xrt_result

#include <xrt/xrt_results.h>

Result type used across Monado.

0 is XRT_SUCCESS, positive values are "special" non-error return codes (like timeout), negative values are errors.

See also
u_pp_xrt_result
Enumerator
XRT_SUCCESS 

The operation succeeded.

XRT_TIMEOUT 

The operation was given a timeout and timed out.

The value 2 picked so it matches VK_TIMEOUT.

XRT_ERROR_IPC_FAILURE 

A problem occurred either with the IPC transport itself, with invalid commands from the client, or with invalid responses from the server.

XRT_ERROR_NO_IMAGE_AVAILABLE 

Returned when trying to acquire or release an image and there is no image left to acquire/no space in the queue left to release to.

XRT_ERROR_VULKAN 

Other unspecified error related to Vulkan.

XRT_ERROR_OPENGL 

Other unspecified error related to OpenGL.

XRT_ERROR_FAILED_TO_SUBMIT_VULKAN_COMMANDS 

The function tried to submit Vulkan commands but received an error.

XRT_ERROR_SWAPCHAIN_FLAG_VALID_BUT_UNSUPPORTED 

Returned when a swapchain create flag is passed that is valid, but not supported by the main compositor (and lack of support is also valid).

For use when e.g. the protected content image flag is requested but isn't supported.

XRT_ERROR_ALLOCATION 

Could not allocate native image buffer(s).

XRT_ERROR_POSE_NOT_ACTIVE 

The pose is no longer active, this happens when the application tries to get a pose that is no longer active.

XRT_ERROR_FENCE_CREATE_FAILED 

Creating a fence failed.

XRT_ERROR_NATIVE_HANDLE_FENCE_ERROR 

Getting or giving the native fence handle caused a error.

XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED 

Multiple not supported on this layer level (IPC, compositor).

XRT_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED 

The requested format is not supported by Monado.

XRT_ERROR_EGL_CONFIG_MISSING 

The given config was EGL_NO_CONFIG_KHR and EGL_KHR_no_config_context is not supported by the display.

XRT_ERROR_THREADING_INIT_FAILURE 

Failed to initialize threading components.

XRT_ERROR_IPC_SESSION_NOT_CREATED 

The client has not created a session on this IPC connection, which is needed for the given command.

XRT_ERROR_IPC_SESSION_ALREADY_CREATED 

The client has already created a session on this IPC connection.

XRT_ERROR_PROBER_NOT_SUPPORTED 

The prober list has not been locked before this call.

XRT_ERROR_PROBER_CREATION_FAILED 

Creating the xrt_prober failed.

XRT_ERROR_PROBER_LIST_LOCKED 

The prober list is locked (already).

XRT_ERROR_PROBER_LIST_NOT_LOCKED 

The prober list has not been locked before this call.

XRT_ERROR_PROBING_FAILED 

The probring failed.

XRT_ERROR_DEVICE_CREATION_FAILED 

Creating a xrt_device failed.

XRT_ERROR_D3D 

Some D3D error, from code shared between D3D11 and D3D12.

XRT_ERROR_D3D11 

Some D3D11 error.

XRT_ERROR_D3D12 

Some D3D12 error.

◆ xrt_settings_camera_type

#include <xrt/xrt_settings.h>

Camera type.

◆ xrt_space_relation_flags

#include <xrt/xrt_defines.h>

Flags of which components of a xrt_space_relation is valid.

See also
xrt_space_relation

◆ xrt_stereo_format

#include <xrt/xrt_defines.h>

What type of stereo format a frame has.

Enumerator
XRT_STEREO_FORMAT_SBS 

Side by side.

XRT_STEREO_FORMAT_INTERLEAVED 

Interleaved pixels.

XRT_STEREO_FORMAT_OAU 

Over & Under.

◆ xrt_swapchain_create_flags

#include <xrt/xrt_compositor.h>

Special flags for creating swapchain images.

Enumerator
XRT_SWAPCHAIN_CREATE_PROTECTED_CONTENT 

Our compositor just ignores this bit.

XRT_SWAPCHAIN_CREATE_STATIC_IMAGE 

Signals that the allocator should only allocate one image.

◆ xrt_swapchain_usage_bits

#include <xrt/xrt_compositor.h>

Usage of the swapchain images.

◆ xrt_tracking_override_type

#include <xrt/xrt_settings.h>

Tracking override type.

◆ xrt_tracking_type

#include <xrt/xrt_tracking.h>

What kind of tracking system is this.

Todo:
Is none, Colour, IR, Magnetic the kind of type we need to know about?

◆ xrt_view_type

#include <xrt/xrt_compositor.h>

View type to be rendered to by the compositor.

Function Documentation

◆ xrt_comp_begin_frame()

static xrt_result_t xrt_comp_begin_frame ( struct xrt_compositor xc,
int64_t  frame_id 
)
inline

See xrBeginFrame.

Must have made a call to either predict_frame or wait_frame before calling this function. After this function is called you must call layer_commit.

Parameters
[in]xcThe compositor
[in]frame_idFrame id

Helper for calling through the function pointer.

References xrt_compositor::begin_frame.

◆ xrt_comp_begin_session()

static xrt_result_t xrt_comp_begin_session ( struct xrt_compositor xc,
enum xrt_view_type  view_type 
)
inline

See xrBeginSession.

Helper for calling through the function pointer.

References xrt_compositor::begin_session.

◆ xrt_comp_create_semaphore()

static xrt_result_t xrt_comp_create_semaphore ( struct xrt_compositor xc,
xrt_graphics_sync_handle_t out_handle,
struct xrt_compositor_semaphore **  out_xcsem 
)
inline

Create a compositor semaphore, also returns a native handle.

Helper for calling through the function pointer.

References xrt_compositor::create_semaphore.

◆ xrt_comp_create_swapchain()

static xrt_result_t xrt_comp_create_swapchain ( struct xrt_compositor xc,
const struct xrt_swapchain_create_info info,
struct xrt_swapchain **  out_xsc 
)
inline

Create a swapchain with a set of images.

The pointer pointed to by out_xsc has to either be NULL or a valid xrt_swapchain pointer. If there is a valid xrt_swapchain pointed by the pointed pointer it will have it reference decremented.

Helper for calling through the function pointer.

References xrt_compositor::create_swapchain, and xrt_compositor::info.

Referenced by xrt_compositor_native::xrt_comp_native_create_swapchain().

◆ xrt_comp_destroy()

static void xrt_comp_destroy ( struct xrt_compositor **  xc_ptr)
inline

Teardown the compositor.

The state tracker must have made sure that no frames or sessions are currently pending.

See also
xrt_compositor::discard_frame or xrt_compositor::end_frame for a pending frame
xrt_compositor::end_session for an open session.

Helper for calling through the function pointer: does a null check and sets xc_ptr to null if freed.

References xrt_compositor::destroy.

◆ xrt_comp_discard_frame()

static xrt_result_t xrt_comp_discard_frame ( struct xrt_compositor xc,
int64_t  frame_id 
)
inline

Explicitly discard a frame.

This isn't in the OpenXR API but is explicit in the XRT interfaces.

Two calls to xrBeginFrame without intervening xrEndFrame will cause the state tracker to call:

// first xrBeginFrame
xrt_comp_begin_frame(xc, frame_id);
// second xrBeginFrame
xrt_comp_discard_frame(xc, frame_id);
xrt_comp_begin_frame(xc, frame_id);
static xrt_result_t xrt_comp_begin_frame(struct xrt_compositor *xc, int64_t frame_id)
See xrBeginFrame.
Definition: xrt_compositor.h:1329
static xrt_result_t xrt_comp_discard_frame(struct xrt_compositor *xc, int64_t frame_id)
Explicitly discard a frame.
Definition: xrt_compositor.h:1342

Helper for calling through the function pointer.

References xrt_compositor::discard_frame.

◆ xrt_comp_end_session()

static xrt_result_t xrt_comp_end_session ( struct xrt_compositor xc)
inline

See xrEndSession, unlike the OpenXR one the state tracker is responsible to call discard frame before calling this function.

See discard_frame.

Helper for calling through the function pointer.

References xrt_compositor::end_session.

◆ xrt_comp_get_swapchain_create_properties()

static xrt_result_t xrt_comp_get_swapchain_create_properties ( struct xrt_compositor xc,
const struct xrt_swapchain_create_info info,
struct xrt_swapchain_create_properties xsccp 
)
inline

For a given xrt_swapchain_create_info struct returns a filled out xrt_swapchain_create_properties.

Helper for calling through the function pointer.

References xrt_compositor::get_swapchain_create_properties, and xrt_compositor::info.

Referenced by client_d3d11_create_swapchain(), and client_d3d12_create_swapchain().

◆ xrt_comp_import_fence()

static xrt_result_t xrt_comp_import_fence ( struct xrt_compositor xc,
xrt_graphics_sync_handle_t  handle,
struct xrt_compositor_fence **  out_xcf 
)
inline

Create a compositor fence from a native sync handle.

Helper for calling through the function pointer.

References xrt_compositor::import_fence.

◆ xrt_comp_import_swapchain()

static xrt_result_t xrt_comp_import_swapchain ( struct xrt_compositor xc,
const struct xrt_swapchain_create_info info,
struct xrt_image_native native_images,
uint32_t  image_count,
struct xrt_swapchain **  out_xsc 
)
inline

Create a swapchain from a set of native images.

The pointer pointed to by out_xsc has to either be NULL or a valid xrt_swapchain pointer. If there is a valid xrt_swapchain pointed by the pointed pointer it will have it reference decremented.

Helper for calling through the function pointer.

References xrt_compositor::import_swapchain, and xrt_compositor::info.

◆ xrt_comp_layer_begin()

static xrt_result_t xrt_comp_layer_begin ( struct xrt_compositor xc,
int64_t  frame_id,
uint64_t  display_time_ns,
enum xrt_blend_mode  env_blend_mode 
)
inline

Begins layer submission.

This and the other layer_* calls are equivalent to xrEndFrame, except split over multiple calls. It's only after xrt_compositor::layer_commit that layers will be displayed. From the point of view of the swapchain, the image is used as soon as it's given in a call.

Helper for calling through the function pointer.

References xrt_compositor::layer_begin.

◆ xrt_comp_layer_commit()

static xrt_result_t xrt_comp_layer_commit ( struct xrt_compositor xc,
int64_t  frame_id,
xrt_graphics_sync_handle_t  sync_handle 
)
inline

Commits all of the submitted layers.

Only after this call will the compositor actually use the layers.

Helper for calling through the function pointer.

References xrt_compositor::layer_commit.

◆ xrt_comp_layer_commit_with_semaphore()

static xrt_result_t xrt_comp_layer_commit_with_semaphore ( struct xrt_compositor xc,
int64_t  frame_id,
struct xrt_compositor_semaphore xcsem,
uint64_t  value 
)
inline

Commits all of the submitted layers, with a semaphore.

Only after this call will the compositor actually use the layers.

Parameters
xcSelf pointer
frame_idThe frame id this commit is for.
xcsemSemaphore that will be signalled when the app GPU work has completed.
valueSemaphore value upone completion of GPU work.

Helper for calling through the function pointer.

References xrt_compositor::layer_commit_with_semaphore.

◆ xrt_comp_layer_cube()

static xrt_result_t xrt_comp_layer_cube ( struct xrt_compositor xc,
struct xrt_device xdev,
struct xrt_swapchain xsc,
const struct xrt_layer_data data 
)
inline

Adds a cube layer for submission.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
xscSwapchain.
dataAll of the pure data bits (not pointers/handles), including what part of the supplied swapchain object to use.

Helper for calling through the function pointer.

◆ xrt_comp_layer_cylinder()

static xrt_result_t xrt_comp_layer_cylinder ( struct xrt_compositor xc,
struct xrt_device xdev,
struct xrt_swapchain xsc,
const struct xrt_layer_data data 
)
inline

Adds a cylinder layer for submission.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
xscSwapchain.
dataAll of the pure data bits (not pointers/handles), including what part of the supplied swapchain object to use.

Helper for calling through the function pointer.

◆ xrt_comp_layer_equirect1()

static xrt_result_t xrt_comp_layer_equirect1 ( struct xrt_compositor xc,
struct xrt_device xdev,
struct xrt_swapchain xsc,
const struct xrt_layer_data data 
)
inline

Adds a equirect1 layer for submission.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
xscSwapchain.
dataAll of the pure data bits (not pointers/handles), including what part of the supplied swapchain object to use.

Helper for calling through the function pointer.

◆ xrt_comp_layer_equirect2()

static xrt_result_t xrt_comp_layer_equirect2 ( struct xrt_compositor xc,
struct xrt_device xdev,
struct xrt_swapchain xsc,
const struct xrt_layer_data data 
)
inline

Adds a equirect2 layer for submission.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
xscSwapchain.
dataAll of the pure data bits (not pointers/handles), including what part of the supplied swapchain object to use.

Helper for calling through the function pointer.

◆ xrt_comp_layer_quad()

static xrt_result_t xrt_comp_layer_quad ( struct xrt_compositor xc,
struct xrt_device xdev,
struct xrt_swapchain xsc,
const struct xrt_layer_data data 
)
inline

Adds a quad layer for submission, the center of the quad is specified by the pose and extends outwards from it.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
xscSwapchain.
dataAll of the pure data bits (not pointers/handles), including what part of the supplied swapchain object to use.

Helper for calling through the function pointer.

◆ xrt_comp_layer_stereo_projection()

static xrt_result_t xrt_comp_layer_stereo_projection ( struct xrt_compositor xc,
struct xrt_device xdev,
struct xrt_swapchain l_xsc,
struct xrt_swapchain r_xsc,
const struct xrt_layer_data data 
)
inline

Adds a stereo projection layer for submissions.

Note that e.g. the same swapchain object may be passed as both l_xsc and r_xsc - the parameters in data identify the subrect and array texture index to use for each of the views.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
l_xscSwapchain object containing left eye RGB data.
r_xscSwapchain object containing right eye RGB data.
dataAll of the pure data bits (not pointers/handles), including what parts of the supplied swapchain objects to use for each view.

Helper for calling through the function pointer.

◆ xrt_comp_layer_stereo_projection_depth()

static xrt_result_t xrt_comp_layer_stereo_projection_depth ( struct xrt_compositor xc,
struct xrt_device xdev,
struct xrt_swapchain l_xsc,
struct xrt_swapchain r_xsc,
struct xrt_swapchain l_d_xsc,
struct xrt_swapchain r_d_xsc,
const struct xrt_layer_data data 
)
inline

Adds a stereo projection layer for submission, has depth information.

Note that e.g. the same swapchain object may be passed as both l_xsc and r_xsc - the parameters in data identify the subrect and array texture index to use for each of the views. This flexibility is required by the OpenXR API and is passed through to the compositor to preserve the maximum information

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
l_xscSwapchain object containing left eye RGB data.
r_xscSwapchain object containing right eye RGB data.
l_d_xscSwapchain object containing left eye depth data.
r_d_xscSwapchain object containing right eye depth data.
dataAll of the pure data bits (not pointers/handles), including what parts of the supplied swapchain objects to use for each view.

Helper for calling through the function pointer.

◆ xrt_comp_mark_frame()

static xrt_result_t xrt_comp_mark_frame ( struct xrt_compositor xc,
int64_t  frame_id,
enum xrt_compositor_frame_point  point,
uint64_t  when_ns 
)
inline

This function and predict_frame function calls are a alternative to wait_frame.

If point is XRT_COMPOSITOR_FRAME_POINT_WOKE it is to mark that the client woke up from waiting on a frame.

Parameters
[in]xcThe compositor
[in]frame_idFrame id
[in]pointWhat type of frame point to mark.
[in]when_nsWhen this point happened.

Helper for calling through the function pointer.

References xrt_compositor::mark_frame.

◆ xrt_comp_native_create_swapchain()

static xrt_result_t xrt_comp_native_create_swapchain ( struct xrt_compositor_native xcn,
const struct xrt_swapchain_create_info info,
struct xrt_swapchain_native **  out_xscn 
)
inline

Create a native swapchain with a set of images.

A specialized version of xrt_comp_create_swapchain, for use only on xrt_compositor_native.

Helper for calling through the base's function pointer then performing the known-safe downcast.

The pointer pointed to by out_xsc has to either be NULL or a valid xrt_swapchain pointer. If there is a valid xrt_swapchain pointed by the pointed pointer it will have it reference decremented.

References xrt_compositor_native::base, xrt_compositor::xrt_comp_create_swapchain(), XRT_SUCCESS, and xrt_swapchain_native::xrt_swapchain_native_reference().

◆ xrt_comp_native_destroy()

static void xrt_comp_native_destroy ( struct xrt_compositor_native **  xcn_ptr)
inline

Teardown the compositor.

The state tracker must have made sure that no frames or sessions are currently pending.

See also
xrt_compositor::discard_frame or xrt_compositor::end_frame for a pending frame
xrt_compositor::end_session for an open session.

Helper for calling through the function pointer: does a null check and sets xcn_ptr to null if freed.

References xrt_compositor_native::base, and xrt_compositor::destroy.

◆ xrt_comp_poll_events()

static xrt_result_t xrt_comp_poll_events ( struct xrt_compositor xc,
union xrt_compositor_event out_xce 
)
inline

Poll events from this compositor.

This function is very much WIP.

Helper for calling through the function pointer.

References xrt_compositor::poll_events.

◆ xrt_comp_predict_frame()

static xrt_result_t xrt_comp_predict_frame ( struct xrt_compositor xc,
int64_t *  out_frame_id,
uint64_t *  out_wake_time_ns,
uint64_t *  out_predicted_gpu_time_ns,
uint64_t *  out_predicted_display_time_ns,
uint64_t *  out_predicted_display_period_ns 
)
inline

This function and mark_frame function calls are a alternative to wait_frame.

The only requirement on the compositor for the frame_id is that it is a positive number and larger then the last returned frame_id.

After a call to predict_frame, the state tracker is not allowed to call this function until after a call to mark_frame (with point XRT_COMPOSITOR_FRAME_POINT_WOKE), followed by either begin_frame or discard_frame.

Parameters
[in]xcThe compositor
[out]out_frame_idFrame id
[out]out_wake_time_nsWhen we want the client to be awoken to begin rendering.
[out]out_predicted_gpu_time_nsWhen we expect the client to finish the GPU work. If not computed/available, set to 0.
[out]out_predicted_display_time_nsWhen the pixels turns into photons.
[out]out_predicted_display_period_nsThe period for the frames.

Helper for calling through the function pointer.

References xrt_compositor::predict_frame.

◆ xrt_comp_wait_frame()

static xrt_result_t xrt_comp_wait_frame ( struct xrt_compositor xc,
int64_t *  out_frame_id,
uint64_t *  out_predicted_display_time,
uint64_t *  out_predicted_display_period 
)
inline

See xrWaitFrame.

This function has the same semantics as calling predict_frame, sleeping, and then calling mark_frame with a point of XRT_COMPOSITOR_FRAME_POINT_WOKE.

The only requirement on the compositor for the frame_id is that it is a positive number and larger then the last returned frame_id.

After a call to wait_frame, the state tracker is not allowed to call this function until after a call to either begin_frame or discard_frame.

If the caller can do its own blocking, use the pair of functions xrt_compositor::predict_frame and xrt_compositor::mark_frame instead of this single blocking function.

Helper for calling through the function pointer.

References xrt_compositor::wait_frame.

◆ xrt_compositor_fence_destroy()

static void xrt_compositor_fence_destroy ( struct xrt_compositor_fence **  xcf_ptr)
inline

Destroys the fence.

Helper for calling through the function pointer: does a null check and sets xcf_ptr to null if freed.

References xrt_compositor_fence::destroy.

◆ xrt_compositor_fence_wait()

static xrt_result_t xrt_compositor_fence_wait ( struct xrt_compositor_fence xcf,
uint64_t  timeout 
)
inline

Waits on the fence with the given timeout.

Helper for calling through the function pointer.

References xrt_compositor_fence::wait.

◆ xrt_compositor_semaphore_reference()

static void xrt_compositor_semaphore_reference ( struct xrt_compositor_semaphore **  dst,
struct xrt_compositor_semaphore src 
)
related

Update the reference counts on compositor semaphore(s).

Parameters
[in,out]dstPointer to a object reference: if the object reference is non-null will decrement its counter. The reference that dst points to will be set to src.
[in]srcNew object for dst to refer to (may be null). If non-null, will have its refcount increased.

◆ xrt_compositor_semaphore_wait()

static xrt_result_t xrt_compositor_semaphore_wait ( struct xrt_compositor_semaphore xcsem,
uint64_t  value,
uint64_t  timeout 
)
inline

Does a CPU side wait on the semaphore to reach the given value.

Helper for calling through the function pointer.

References xrt_compositor_semaphore::wait.

◆ xrt_frame_reference()

static void xrt_frame_reference ( struct xrt_frame **  dst,
struct xrt_frame src 
)
related

Update the reference counts on frame(s).

Parameters
[in,out]dstPointer to a object reference: if the object reference is non-null will decrement its counter. The reference that dst points to will be set to src.
[in]srcNew object for dst to refer to (may be null). If non-null, will have its refcount increased.

Referenced by queue_refclear(), and queue_try_refpush().

◆ xrt_gfx_d3d11_provider_create()

struct xrt_compositor_d3d11 * xrt_gfx_d3d11_provider_create ( struct xrt_compositor_native xcn,
ID3D11Device *  device 
)

Create a D3D11 compositor client.

References client_d3d11_compositor::client_d3d11_compositor_create().

◆ xrt_gfx_d3d12_provider_create()

struct xrt_compositor_d3d12 * xrt_gfx_d3d12_provider_create ( struct xrt_compositor_native xcn,
ID3D12Device *  device,
ID3D12CommandQueue *  queue 
)

Create a D3D12 compositor client.

References client_d3d12_compositor::client_d3d12_compositor_create().

◆ xrt_gfx_provider_create_gl_egl()

xrt_result_t xrt_gfx_provider_create_gl_egl ( struct xrt_compositor_native xcn,
EGLDisplay  display,
EGLConfig  config,
EGLContext  context,
PFNEGLGETPROCADDRESSPROC  get_gl_procaddr,
struct xrt_compositor_gl **  out_xcgl 
)

Create an OpenGL(ES) compositor client using EGL.

◆ xrt_gfx_provider_create_gl_xlib()

struct xrt_compositor_gl * xrt_gfx_provider_create_gl_xlib ( struct xrt_compositor_native xcn,
Display *  xDisplay,
uint32_t  visualid,
GLXFBConfig  glxFBConfig,
GLXDrawable  glxDrawable,
GLXContext  glxContext 
)

Create an OpenGL compositor client using xlib.

References client_gl_xlib_compositor::base, and client_gl_xlib_compositor::client_gl_xlib_compositor_create().

◆ xrt_gfx_provider_create_system()

xrt_result_t xrt_gfx_provider_create_system ( struct xrt_device xdev,
struct xrt_system_compositor **  out_xsysc 
)
related

Creates the main system compositor.

References comp_base::base, xrt_compositor_native::base, xrt_compositor::begin_session, and U_TYPED_CALLOC.

◆ xrt_gfx_vk_provider_create()

struct xrt_compositor_vk * xrt_gfx_vk_provider_create ( struct xrt_compositor_native xcn,
VkInstance  instance,
PFN_vkGetInstanceProcAddr  get_instance_proc_addr,
VkPhysicalDevice  physical_device,
VkDevice  device,
bool  external_fence_fd_enabled,
bool  external_semaphore_fd_enabled,
bool  timeline_semaphore_enabled,
uint32_t  queue_family_index,
uint32_t  queue_index 
)

Create a Vulkan compositor client.

◆ xrt_images_destroy()

static void xrt_images_destroy ( struct xrt_image_native_allocator **  xina_ptr)
inline

Destroy the image allocator.

Helper for calling through the function pointer: does a null check and sets xina_ptr to null if freed.

References xrt_image_native_allocator::destroy.

Referenced by ipc_syscomp_destroy().

◆ xrt_instance_create()

xrt_result_t xrt_instance_create ( struct xrt_instance_info ii,
struct xrt_instance **  out_xinst 
)
related

Create an implementation of the xrt_instance interface.

Creating more then one xrt_instance is probably never the right thing to do, so avoid it.

Each target must implement this function.

Parameters
[in]iiA pointer to a info struct containing information about the application.
[out]out_xinstA pointer to an xrt_instance pointer. Will be populated.
Returns
0 on success

References u_trace_marker_init(), and xrt_prober::xrt_prober_create_with_lists().

Referenced by gui_prober_init().

◆ xrt_instance_create_system()

static xrt_result_t xrt_instance_create_system ( struct xrt_instance xinst,
struct xrt_system_devices **  out_xsysd,
struct xrt_system_compositor **  out_xsysc 
)
inline

Creates all of the system resources like the devices and system compositor.

The system compositor is optional.

Should only be called once.

Note
Code consuming this interface should use xrt_instance_create_system()
Parameters
xinstPointer to self
[out]out_xsysdReturn of devices, required.
[out]out_xsyscReturn of system compositor, optional.
See also
xrt_prober::probe, xrt_prober::select, xrt_gfx_provider_create_native

Helper for calling through the function pointer.

References xrt_instance::create_system.

Referenced by gui_prober_select().

◆ xrt_instance_destroy()

static void xrt_instance_destroy ( struct xrt_instance **  xinst_ptr)
inline

Destroy an xrt_instance - helper function.

Parameters
[in,out]xinst_ptrA pointer to your instance implementation pointer.

Will destroy the instance if *xinst_ptr is not NULL. Will then set *xinst_ptr to NULL.

References xrt_instance::destroy.

Referenced by gui_prober_teardown().

◆ xrt_instance_get_prober()

static xrt_result_t xrt_instance_get_prober ( struct xrt_instance xinst,
struct xrt_prober **  out_xp 
)
inline

Get the instance xrt_prober, if any.

If the instance is not using an xrt_prober, it may return null.

The instance retains ownership of the prober and is responsible for destroying it.

Can be called multiple times. (The prober is usually created at instance construction time.)

Note
Code consuming this interface should use xrt_instance_get_prober().
Parameters
xinstPointer to self
[out]out_xpPointer to xrt_prober pointer, will be populated or set to NULL.
Returns
XRT_SUCCESS on success, other error code on error.

Helper for calling through the function pointer.

References xrt_instance::get_prober.

Referenced by u_system_devices_create_from_prober().

◆ xrt_swapchain_acquire_image()

static xrt_result_t xrt_swapchain_acquire_image ( struct xrt_swapchain xsc,
uint32_t *  out_index 
)
inline

Obtain the index of the next image to use, without blocking on being able to write to it.

See xrAcquireSwapchainImage.

Caller must make sure that no image is acquired before calling xrt_swapchain_acquire_image.

Parameters
xscSelf pointer
[out]out_indexImage index to use next

Call xrt_swapchain_wait_image before writing to the image index output from this function.

Helper for calling through the function pointer.

References xrt_swapchain::acquire_image.

◆ xrt_swapchain_native_reference()

static void xrt_swapchain_native_reference ( struct xrt_swapchain_native **  dst,
struct xrt_swapchain_native src 
)
related

Update the reference counts on swapchain(s).

Parameters
[in,out]dstPointer to a object reference: if the object reference is non-null will decrement its counter. The reference that dst points to will be set to src.
[in]srcNew object for dst to refer to (may be null). If non-null, will have its refcount increased.

References xrt_swapchain::xrt_swapchain_reference().

Referenced by xrt_compositor_native::xrt_comp_native_create_swapchain().

◆ xrt_swapchain_reference()

static void xrt_swapchain_reference ( struct xrt_swapchain **  dst,
struct xrt_swapchain src 
)
related

Update the reference counts on swapchain(s).

Parameters
[in,out]dstPointer to a object reference: if the object reference is non-null will decrement its counter. The reference that dst points to will be set to src.
[in]srcNew object for dst to refer to (may be null). If non-null, will have its refcount increased.

Referenced by xrt_swapchain_native::xrt_swapchain_native_reference().

◆ xrt_swapchain_release_image()

static xrt_result_t xrt_swapchain_release_image ( struct xrt_swapchain xsc,
uint32_t  index 
)
inline

See xrReleaseSwapchainImage, state tracker needs to track index.

Helper for calling through the function pointer.

References xrt_swapchain::release_image.

◆ xrt_swapchain_wait_image()

static xrt_result_t xrt_swapchain_wait_image ( struct xrt_swapchain xsc,
uint64_t  timeout_ns,
uint32_t  index 
)
inline

Wait until image index is available for exclusive use, or until timeout_ns expires.

See xrWaitSwapchainImage, which is the basis for this API. The state tracker needs to track image index, which should have come from xrt_swapchain_acquire_image

Parameters
xscSelf pointer
timeout_nsTimeout in nanoseconds,
indexImage index to wait for.

Helper for calling through the function pointer.

References xrt_swapchain::wait_image.

Referenced by client_d3d11_swapchain_wait_image(), and client_d3d12_swapchain_wait_image().

◆ xrt_syscomp_create_native_compositor()

static xrt_result_t xrt_syscomp_create_native_compositor ( struct xrt_system_compositor xsc,
const struct xrt_session_info xsi,
struct xrt_compositor_native **  out_xcn 
)
inline

Create a new native compositor.

This signals that you want to start XR, and as such implicitly brings up a new session. Does not "call" xrBeginSession.

Some system compositors might only support that one xrt_compositor is active at a time, will return XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED if this is the case.

Helper for calling through the function pointer.

References xrt_system_compositor::create_native_compositor.

◆ xrt_syscomp_destroy()

static void xrt_syscomp_destroy ( struct xrt_system_compositor **  xsc_ptr)
inline

Teardown the system compositor.

The state tracker must make sure that no compositors are alive.

Helper for calling through the function pointer: does a null check and sets xcn_ptr to null if freed.

References xrt_system_compositor::destroy.

◆ xrt_syscomp_set_main_app_visibility()

static xrt_result_t xrt_syscomp_set_main_app_visibility ( struct xrt_system_compositor xsc,
struct xrt_compositor xc,
bool  visible 
)
inline

Tell this client/session if the main application is visible or not.

Helper for calling through the function pointer.

References xrt_multi_compositor_control::set_main_app_visibility, xrt_system_compositor::xmcc, and XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED.

◆ xrt_syscomp_set_state()

static xrt_result_t xrt_syscomp_set_state ( struct xrt_system_compositor xsc,
struct xrt_compositor xc,
bool  visible,
bool  focused 
)
inline

Sets the state of the compositor, generating any events to the client if the state is actually changed.

Input focus is enforced/handled by a different component but is still signaled by the compositor.

Helper for calling through the function pointer.

References xrt_multi_compositor_control::set_state, xrt_system_compositor::xmcc, and XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED.

◆ xrt_syscomp_set_z_order()

static xrt_result_t xrt_syscomp_set_z_order ( struct xrt_system_compositor xsc,
struct xrt_compositor xc,
int64_t  z_order 
)
inline

Set the rendering Z order for rendering, visible has higher priority then z_order but is still saved until visible again.

This a signed 64 bit integer compared to a unsigned 32 bit integer in OpenXR, so that non-overlay clients can be handled like overlay ones.

Helper for calling through the function pointer.

References xrt_multi_compositor_control::set_z_order, xrt_system_compositor::xmcc, and XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED.

Variable Documentation

◆ xrt_gfx_vk_device_extensions

const char* xrt_gfx_vk_device_extensions
extern

#include <xrt/xrt_gfx_vk.h>

A space-delimited string of Vulkan device extensions required from a client.

Should be kept synchronized with the "Client" column in Vulkan extensions used by Monado

◆ xrt_gfx_vk_instance_extensions

const char* xrt_gfx_vk_instance_extensions
extern

#include <xrt/xrt_gfx_vk.h>

A space-delimited string of Vulkan instance extensions required from a client.

Should be kept synchronized with the "Client" column in Vulkan extensions used by Monado