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