Monado OpenXR Runtime
oxr_defines.h
Go to the documentation of this file.
1// Copyright 2018-2024, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Shared internal defines and enums in the state tracker.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @author Korcan Hussein <korcan.hussein@collabora.com>
8 * @ingroup oxr_main
9 */
10
11#pragma once
12
13#include "xrt/xrt_compiler.h"
14
15
16// For corruption and layer checking.
17// clang-format off
18#define OXR_XR_DEBUG_INSTANCE (*(uint64_t *)"oxrinst\0")
19#define OXR_XR_DEBUG_SESSION (*(uint64_t *)"oxrsess\0")
20#define OXR_XR_DEBUG_SPACE (*(uint64_t *)"oxrspac\0")
21#define OXR_XR_DEBUG_PATH (*(uint64_t *)"oxrpath\0")
22#define OXR_XR_DEBUG_ACTION (*(uint64_t *)"oxracti\0")
23#define OXR_XR_DEBUG_SWAPCHAIN (*(uint64_t *)"oxrswap\0")
24#define OXR_XR_DEBUG_ACTIONSET (*(uint64_t *)"oxraset\0")
25#define OXR_XR_DEBUG_MESSENGER (*(uint64_t *)"oxrmess\0")
26#define OXR_XR_DEBUG_SOURCESET (*(uint64_t *)"oxrsrcs\0")
27#define OXR_XR_DEBUG_SOURCE (*(uint64_t *)"oxrsrc_\0")
28#define OXR_XR_DEBUG_HTRACKER (*(uint64_t *)"oxrhtra\0")
29#define OXR_XR_DEBUG_PASSTHROUGH (*(uint64_t *)"oxrpass\0")
30#define OXR_XR_DEBUG_PASSTHROUGH_LAYER (*(uint64_t *)"oxrptla\0")
31#define OXR_XR_DEBUG_FTRACKER (*(uint64_t *)"oxrftra\0")
32// body tracker
33#define OXR_XR_DEBUG_BTRACKER (*(uint64_t *)"oxrbtra\0")
34#define OXR_XR_DEBUG_XDEVLIST (*(uint64_t *)"oxrxdli\0")
35// plane detection
36#define OXR_XR_DEBUG_PLANEDET (*(uint64_t *)"oxrplan\0")
37// futures
38#define OXR_XR_DEBUG_FUTURE (*(uint64_t *)"oxrfutr\0")
39// clang-format on
40
41/*!
42 * State of a handle base, to reduce likelihood of going "boom" on
43 * out-of-order destruction or other unsavory behavior.
44 *
45 * @ingroup oxr_main
46 */
48{
49 /*! State during/before oxr_handle_init, or after failure */
51
52 /*! State after successful oxr_handle_init */
54
55 /*! State after successful oxr_handle_destroy */
57};
58
59/*!
60 * Sub action paths.
61 *
62 * @ingroup oxr_main
63 */
65{
66 OXR_SUB_ACTION_PATH_USER,
67 OXR_SUB_ACTION_PATH_HEAD,
68 OXR_SUB_ACTION_PATH_LEFT,
69 OXR_SUB_ACTION_PATH_RIGHT,
70 OXR_SUB_ACTION_PATH_GAMEPAD,
71 OXR_SUB_ACTION_PATH_EYES,
72};
73
74/*!
75 * Region of a dpad binding that an input is mapped to
76 *
77 * @ingroup oxr_main
78 */
80{
81 OXR_DPAD_REGION_CENTER = 0u,
82 OXR_DPAD_REGION_UP = (1u << 0u),
83 OXR_DPAD_REGION_DOWN = (1u << 1u),
84 OXR_DPAD_REGION_LEFT = (1u << 2u),
85 OXR_DPAD_REGION_RIGHT = (1u << 3u),
86};
87
88/*!
89 * Tracks the state of a image that belongs to a @ref oxr_swapchain.
90 *
91 * @ingroup oxr_main
92 */
94{
95 OXR_IMAGE_STATE_READY,
96 OXR_IMAGE_STATE_ACQUIRED,
97 OXR_IMAGE_STATE_WAITED,
98};
99
100/*!
101 * Internal enum for the type of space, lets us reason about action spaces.
102 *
103 * @ingroup oxr_main
104 */
106{
107 OXR_SPACE_TYPE_REFERENCE_VIEW,
108 OXR_SPACE_TYPE_REFERENCE_LOCAL,
109 OXR_SPACE_TYPE_REFERENCE_LOCAL_FLOOR,
110 OXR_SPACE_TYPE_REFERENCE_STAGE,
111 OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_MSFT,
112 OXR_SPACE_TYPE_REFERENCE_COMBINED_EYE_VARJO,
113 OXR_SPACE_TYPE_REFERENCE_LOCALIZATION_MAP_ML,
114
115 OXR_SPACE_TYPE_ACTION,
116 OXR_SPACE_TYPE_XDEV_POSE,
117};
118
119/*!
120 * What graphics API was this session created with.
121 *
122 * @ingroup oxr_main
123 */
125{
126 OXR_SESSION_GRAPHICS_EXT_HEADLESS,
127 // Can't reliable tell the difference between Vulkan 1 & 2.
128 OXR_SESSION_GRAPHICS_EXT_VULKAN,
129 OXR_SESSION_GRAPHICS_EXT_D3D11,
130 OXR_SESSION_GRAPHICS_EXT_D3D12,
131 OXR_SESSION_GRAPHICS_EXT_WIN32_GL,
132 OXR_SESSION_GRAPHICS_EXT_XLIB_GL,
133 OXR_SESSION_GRAPHICS_EXT_ANDROID_GLES,
134 OXR_SESSION_GRAPHICS_EXT_EGL,
135};
oxr_image_state
Tracks the state of a image that belongs to a oxr_swapchain.
Definition: oxr_defines.h:94
oxr_session_graphics_ext
What graphics API was this session created with.
Definition: oxr_defines.h:125
oxr_dpad_region
Region of a dpad binding that an input is mapped to.
Definition: oxr_defines.h:80
oxr_space_type
Internal enum for the type of space, lets us reason about action spaces.
Definition: oxr_defines.h:106
oxr_handle_state
State of a handle base, to reduce likelihood of going "boom" on out-of-order destruction or other uns...
Definition: oxr_defines.h:48
oxr_subaction_path
Sub action paths.
Definition: oxr_defines.h:65
@ OXR_HANDLE_STATE_DESTROYED
State after successful oxr_handle_destroy.
Definition: oxr_defines.h:56
@ OXR_HANDLE_STATE_LIVE
State after successful oxr_handle_init.
Definition: oxr_defines.h:53
@ OXR_HANDLE_STATE_UNINITIALIZED
State during/before oxr_handle_init, or after failure.
Definition: oxr_defines.h:50
Header holding common defines.