Monado OpenXR Runtime
Loading...
Searching...
No Matches
oxr_objects.h
Go to the documentation of this file.
1// Copyright 2018-2024, Collabora, Ltd.
2// Copyright 2023-2026, NVIDIA CORPORATION.
3// Copyright 2026, Beyley Cardellio
4// SPDX-License-Identifier: BSL-1.0
5/*!
6 * @file
7 * @brief The objects representing OpenXR handles, and prototypes for internal functions used in the state tracker.
8 * @author Jakob Bornecrantz <jakob@collabora.com>
9 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
10 * @author Korcan Hussein <korcan.hussein@collabora.com>
11 * @ingroup oxr_main
12 */
13
14#pragma once
15
16#include "xrt/xrt_space.h"
17#include "xrt/xrt_limits.h"
18#include "xrt/xrt_system.h"
19#include "xrt/xrt_future.h"
20#include "xrt/xrt_device.h"
21#include "xrt/xrt_tracking.h"
22#include "xrt/xrt_compositor.h"
25#include "xrt/xrt_config_os.h"
26#include "xrt/xrt_config_have.h"
27
28#include "os/os_threading.h"
29
30#include "util/u_index_fifo.h"
31#include "util/u_hashset.h"
32#include "util/u_hashmap.h"
33#include "util/u_device.h"
34
35#include "oxr_extension_support.h"
36#include "oxr_defines.h"
37#include "oxr_handle_base.h"
38#include "oxr_frame_sync.h"
40#include "oxr_refcounted.h"
41
42#include "path/oxr_path_store.h"
43
51
52
53#if defined(XRT_HAVE_D3D11) || defined(XRT_HAVE_D3D12)
54#include <dxgi.h>
55#include <d3dcommon.h>
56#endif
57
58#ifdef XRT_FEATURE_RENDERDOC
59#include "renderdoc_app.h"
60#ifndef XRT_OS_WINDOWS
61#include <dlfcn.h>
62#endif // !XRT_OS_WINDOWS
63#endif // XRT_FEATURE_RENDERDOC
64
65#ifdef XRT_OS_ANDROID
66#include "xrt/xrt_android.h"
67#endif // #ifdef XRT_OS_ANDROID
68
69#ifdef __cplusplus
70extern "C" {
71#endif
72
73
74/*!
75 * @defgroup oxr OpenXR state tracker
76 *
77 * Client application facing code.
78 *
79 * @ingroup xrt
80 */
81
82/*!
83 * @brief Cast a pointer to an OpenXR handle in such a way as to avoid warnings.
84 *
85 * Avoids -Wpointer-to-int-cast by first casting to the same size int, then
86 * promoting to the 64-bit int, then casting to the handle type. That's a lot of
87 * no-ops on 64-bit, but a widening conversion on 32-bit.
88 *
89 * @ingroup oxr
90 */
91#define XRT_CAST_PTR_TO_OXR_HANDLE(HANDLE_TYPE, PTR) ((HANDLE_TYPE)(uint64_t)(uintptr_t)(PTR))
92
93/*!
94 * @brief Cast an OpenXR handle to a pointer in such a way as to avoid warnings.
95 *
96 * Avoids -Wint-to-pointer-cast by first casting to a 64-bit int, then to a
97 * pointer-sized int, then to the desired pointer type. That's a lot of no-ops
98 * on 64-bit, but a narrowing (!) conversion on 32-bit.
99 *
100 * @ingroup oxr
101 */
102#define XRT_CAST_OXR_HANDLE_TO_PTR(PTR_TYPE, HANDLE) ((PTR_TYPE)(uintptr_t)(uint64_t)(HANDLE))
103
104/*!
105 * @defgroup oxr_main OpenXR main code
106 *
107 * Gets called from @ref oxr_api functions and talks to devices and
108 * @ref comp using @ref xrt_iface.
109 *
110 * @ingroup oxr
111 * @{
112 */
113
114
115#define OXR_MAX_BINDINGS_PER_ACTION 32
116
117
118/*
119 *
120 * Helpers
121 *
122 */
123
124/*!
125 * Safely copy an xrt_pose to an XrPosef.
126 */
127#define OXR_XRT_POSE_TO_XRPOSEF(FROM, TO) \
128 do { \
129 union { \
130 struct xrt_pose xrt; \
131 XrPosef oxr; \
132 } safe_copy = {FROM}; \
133 TO = safe_copy.oxr; \
134 } while (false)
135
136/*!
137 * Safely copy an xrt_fov to an XrFovf.
138 */
139#define OXR_XRT_FOV_TO_XRFOVF(FROM, TO) \
140 do { \
141 union { \
142 struct xrt_fov xrt; \
143 XrFovf oxr; \
144 } safe_copy = {FROM}; \
145 TO = safe_copy.oxr; \
146 } while (false)
147
148
149static inline const char *
150xr_action_type_to_str(XrActionType type)
151{
152 // clang-format off
153 switch (type) {
154 #define PRINT(name, value) \
155 case name: return #name;
156 XR_LIST_ENUM_XrActionType(PRINT)
157 #undef PRINT
158 default: return "XR_ACTION_TYPE_UNKNOWN";
159 }
160 // clang-format on
161}
162
163
164/*!
165 *
166 * @name oxr_instance.c
167 * @{
168 *
169 */
170
171/*!
172 * To go back to a OpenXR object.
173 *
174 * @relates oxr_instance
175 */
176static inline XrInstance
178{
179 return XRT_CAST_PTR_TO_OXR_HANDLE(XrInstance, inst);
180}
181
182/*!
183 * Creates a instance, does minimal validation of @p createInfo.
184 *
185 * @param[in] log Logger
186 * @param[in] createInfo OpenXR creation info.
187 * @param[in] extensions Parsed extension list to be enabled.
188 * @param[out] out_inst Pointer to pointer to a instance, returned instance.
189 *
190 * @public @static @memberof oxr_instance
191 */
192XrResult
194 const XrInstanceCreateInfo *createInfo,
195 XrVersion major_minor,
196 const struct oxr_extension_status *extensions,
197 struct oxr_instance **out_inst);
198
199/*!
200 * Must be called with oxr_instance::system_init_lock held.
201 *
202 * @public @memberof oxr_instance
203 */
204XrResult
205oxr_instance_init_system_locked(struct oxr_logger *log, struct oxr_instance *inst);
206
207/*!
208 * @public @memberof oxr_instance
209 */
210XrResult
211oxr_instance_get_properties(struct oxr_logger *log,
212 struct oxr_instance *inst,
213 XrInstanceProperties *instanceProperties);
214
215#if XR_USE_TIMESPEC
216
217/*!
218 * @public @memberof oxr_instance
219 */
220XrResult
221oxr_instance_convert_time_to_timespec(struct oxr_logger *log,
222 struct oxr_instance *inst,
223 XrTime time,
224 struct timespec *timespecTime);
225
226/*!
227 * @public @memberof oxr_instance
228 */
229XrResult
230oxr_instance_convert_timespec_to_time(struct oxr_logger *log,
231 struct oxr_instance *inst,
232 const struct timespec *timespecTime,
233 XrTime *time);
234#endif // XR_USE_TIMESPEC
235
236#ifdef XR_USE_PLATFORM_WIN32
237
238/*!
239 * @public @memberof oxr_instance
240 */
241XrResult
242oxr_instance_convert_time_to_win32perfcounter(struct oxr_logger *log,
243 struct oxr_instance *inst,
244 XrTime time,
245 LARGE_INTEGER *win32perfcounterTime);
246
247/*!
248 * @public @memberof oxr_instance
249 */
250XrResult
251oxr_instance_convert_win32perfcounter_to_time(struct oxr_logger *log,
252 struct oxr_instance *inst,
253 const LARGE_INTEGER *win32perfcounterTime,
254 XrTime *time);
255
256#endif // XR_USE_PLATFORM_WIN32
257
258/*!
259 * @}
260 */
261
262/*!
263 * To go back to a OpenXR object.
264 *
265 * @relates oxr_action_set
266 */
267static inline XrActionSet
269{
270 return XRT_CAST_PTR_TO_OXR_HANDLE(XrActionSet, act_set);
271}
272
273/*!
274 * To go back to a OpenXR object.
275 *
276 * @relates oxr_hand_tracker
277 */
278static inline XrHandTrackerEXT
280{
281 return XRT_CAST_PTR_TO_OXR_HANDLE(XrHandTrackerEXT, hand_tracker);
282}
283
284#ifdef OXR_HAVE_EXT_plane_detection
285/*!
286 * To go back to a OpenXR object.
287 *
288 * @relates oxr_plane_detector
289 */
290static inline XrPlaneDetectorEXT
291oxr_plane_detector_to_openxr(struct oxr_plane_detector_ext *plane_detector)
292{
293 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPlaneDetectorEXT, plane_detector);
294}
295#endif // OXR_HAVE_EXT_plane_detection
296
297/*!
298 * To go back to a OpenXR object.
299 *
300 * @relates oxr_action
301 */
302static inline XrAction
304{
305 return XRT_CAST_PTR_TO_OXR_HANDLE(XrAction, act);
306}
307
308#ifdef OXR_HAVE_HTC_facial_tracking
309/*!
310 * To go back to a OpenXR object.
311 *
312 * @relates oxr_facial_tracker_htc
313 */
314static inline XrFacialTrackerHTC
315oxr_facial_tracker_htc_to_openxr(struct oxr_facial_tracker_htc *face_tracker_htc)
316{
317 return XRT_CAST_PTR_TO_OXR_HANDLE(XrFacialTrackerHTC, face_tracker_htc);
318}
319#endif
320
321#ifdef OXR_HAVE_FB_body_tracking
322/*!
323 * To go back to a OpenXR object.
324 *
325 * @relates oxr_facial_tracker_htc
326 */
327static inline XrBodyTrackerFB
328oxr_body_tracker_fb_to_openxr(struct oxr_body_tracker_fb *body_tracker_fb)
329{
330 return XRT_CAST_PTR_TO_OXR_HANDLE(XrBodyTrackerFB, body_tracker_fb);
331}
332#endif
333
334#ifdef OXR_HAVE_BD_body_tracking
335/*!
336 * To go back to a OpenXR object.
337 *
338 * @relates oxr_body_tracker_bd
339 */
340static inline XrBodyTrackerBD
341oxr_body_tracker_bd_to_openxr(struct oxr_body_tracker_bd *body_tracker_bd)
342{
343 return XRT_CAST_PTR_TO_OXR_HANDLE(XrBodyTrackerBD, body_tracker_bd);
344}
345#endif
346
347#ifdef OXR_HAVE_FB_face_tracking2
348/*!
349 * To go back to a OpenXR object.
350 *
351 * @relates oxr_face_tracker2_fb
352 */
353static inline XrFaceTracker2FB
354oxr_face_tracker2_fb_to_openxr(struct oxr_face_tracker2_fb *face_tracker2_fb)
355{
356 return XRT_CAST_PTR_TO_OXR_HANDLE(XrFaceTracker2FB, face_tracker2_fb);
357}
358#endif
359
360#ifdef OXR_HAVE_ANDROID_face_tracking
361/*!
362 * To go back to a OpenXR object.
363 *
364 * @relates oxr_facial_tracker_htc
365 */
366static inline XrFaceTrackerANDROID
367oxr_face_tracker_android_to_openxr(struct oxr_face_tracker_android *face_tracker_android)
368{
369 return XRT_CAST_PTR_TO_OXR_HANDLE(XrFaceTrackerANDROID, face_tracker_android);
370}
371#endif
372
373/*!
374 *
375 * @name oxr_session.c
376 * @{
377 *
378 */
379
380/*!
381 * To go back to a OpenXR object.
382 *
383 * @relates oxr_session
384 */
385static inline XrSession
387{
388 return XRT_CAST_PTR_TO_OXR_HANDLE(XrSession, sess);
389}
390
391XrResult
392oxr_session_create(struct oxr_logger *log,
393 struct oxr_system *sys,
394 const XrSessionCreateInfo *createInfo,
395 struct oxr_session **out_session);
396
397XrResult
398oxr_session_enumerate_formats(struct oxr_logger *log,
399 struct oxr_session *sess,
400 uint32_t formatCapacityInput,
401 uint32_t *formatCountOutput,
402 int64_t *formats);
403
404/*!
405 * Change the state of the session, queues a event.
406 */
407void
408oxr_session_change_state(struct oxr_logger *log, struct oxr_session *sess, XrSessionState state, XrTime time);
409
410XrResult
411oxr_session_begin(struct oxr_logger *log, struct oxr_session *sess, const XrSessionBeginInfo *beginInfo);
412
413XrResult
414oxr_session_end(struct oxr_logger *log, struct oxr_session *sess);
415
416XrResult
417oxr_session_request_exit(struct oxr_logger *log, struct oxr_session *sess);
418
419XRT_CHECK_RESULT XrResult
420oxr_session_poll(struct oxr_logger *log, struct oxr_session *sess);
421
422XrResult
423oxr_session_locate_views(struct oxr_logger *log,
424 struct oxr_session *sess,
425 const XrViewLocateInfo *viewLocateInfo,
426 XrViewState *viewState,
427 uint32_t viewCapacityInput,
428 uint32_t *viewCountOutput,
429 XrView *views);
430
431XrResult
432oxr_session_frame_wait(struct oxr_logger *log, struct oxr_session *sess, XrFrameState *frameState);
433
434XrResult
435oxr_session_frame_begin(struct oxr_logger *log, struct oxr_session *sess);
436
437XrResult
438oxr_session_frame_end(struct oxr_logger *log, struct oxr_session *sess, const XrFrameEndInfo *frameEndInfo);
439
440/*
441 * Gets the body pose in the base space.
442 */
443XrResult
444oxr_get_base_body_pose(struct oxr_logger *log,
445 const struct xrt_body_joint_set *body_joint_set,
446 struct oxr_space *base_spc,
447 struct xrt_device *body_xdev,
448 XrTime at_time,
449 struct xrt_space_relation *out_base_body);
450
451#ifdef OXR_HAVE_KHR_android_thread_settings
452XrResult
453oxr_session_android_thread_settings(struct oxr_logger *log,
454 struct oxr_session *sess,
455 XrAndroidThreadTypeKHR threadType,
456 uint32_t threadId);
457#endif // OXR_HAVE_KHR_android_thread_settings
458
459#ifdef OXR_HAVE_KHR_visibility_mask
460XrResult
461oxr_session_get_visibility_mask(struct oxr_logger *log,
462 struct oxr_session *session,
463 XrVisibilityMaskTypeKHR visibilityMaskType,
464 uint32_t viewIndex,
465 XrVisibilityMaskKHR *visibilityMask);
466
467XrResult
468oxr_event_push_XrEventDataVisibilityMaskChangedKHR(struct oxr_logger *log,
469 struct oxr_session *sess,
470 XrViewConfigurationType viewConfigurationType,
471 uint32_t viewIndex);
472#endif // OXR_HAVE_KHR_visibility_mask
473
474#ifdef OXR_HAVE_EXT_performance_settings
475XrResult
476oxr_session_set_perf_level(struct oxr_logger *log,
477 struct oxr_session *sess,
478 XrPerfSettingsDomainEXT domain,
479 XrPerfSettingsLevelEXT level);
480#endif // OXR_HAVE_EXT_performance_settings
481
482/*
483 *
484 * oxr_space.c
485 *
486 */
487
488/*!
489 * To go back to a OpenXR object.
490 */
491static inline XrSpace
493{
494 return XRT_CAST_PTR_TO_OXR_HANDLE(XrSpace, spc);
495}
496
497XrResult
499 struct oxr_session *sess,
500 uint32_t key,
501 const XrActionSpaceCreateInfo *createInfo,
502 struct oxr_space **out_space);
503
504XrResult
505oxr_space_get_reference_bounds_rect(struct oxr_logger *log,
506 struct oxr_session *sess,
507 XrReferenceSpaceType referenceSpaceType,
508 XrExtent2Df *bounds);
509
510XrResult
511oxr_space_reference_create(struct oxr_logger *log,
512 struct oxr_session *sess,
513 const XrReferenceSpaceCreateInfo *createInfo,
514 struct oxr_space **out_space);
515
516/*!
517 * Monado special space that always points to a specific @ref xrt_device and
518 * pose, useful when you want to bypass the action binding system for instance.
519 */
520XrResult
522 struct oxr_session *sess,
523 struct xrt_device *xdev,
524 enum xrt_input_name name,
525 const struct xrt_pose *pose,
526 struct oxr_space **out_space);
527
528XrResult
530 struct oxr_logger *log, struct oxr_space *spc, struct oxr_space *baseSpc, XrTime time, XrSpaceLocation *location);
531
532XrResult
533oxr_spaces_locate(struct oxr_logger *log,
534 struct oxr_space **spcs,
535 uint32_t spc_count,
536 struct oxr_space *baseSpc,
537 XrTime time,
538 XrSpaceLocations *locations);
539
540/*!
541 * Locate the @ref xrt_device in the given base space, useful for implementing
542 * hand tracking location look ups and the like.
543 *
544 * @param log Logging struct.
545 * @param xdev Device to locate in the base space.
546 * @param baseSpc Base space where the device is to be located.
547 * @param[in] time Time in OpenXR domain.
548 * @param[out] out_relation Returns T_base_xdev, aka xdev in base space.
549 *
550 * @return Any errors, XR_SUCCESS, pose might not be valid on XR_SUCCESS.
551 */
552XRT_CHECK_RESULT XrResult
554 struct xrt_device *xdev,
555 struct oxr_space *baseSpc,
556 XrTime time,
557 struct xrt_space_relation *out_relation);
558
559/*!
560 * Get the xrt_space associated with this oxr_space, the @ref xrt_space will
561 * be reference counted by this function so the caller will need to call
562 * @ref xrt_space_reference to decrement the reference count.
563 *
564 * @param log Logging struct.
565 * @param spc Oxr space to get the xrt_space from.
566 * @param[out] out_xspace Returns the xrt_space associated with this oxr_space.
567 * @return Any errors, XR_SUCCESS, xspace is not set on XR_ERROR_*.
568 */
569XRT_CHECK_RESULT XrResult
570oxr_space_get_xrt_space(struct oxr_logger *log, struct oxr_space *spc, struct xrt_space **out_xspace);
571
572
573/*
574 *
575 * oxr_swapchain.c
576 *
577 */
578
579/*!
580 * To go back to a OpenXR object.
581 */
582static inline XrSwapchain
584{
585 return XRT_CAST_PTR_TO_OXR_HANDLE(XrSwapchain, sc);
586}
587
588
589/*
590 *
591 * oxr_messenger.c
592 *
593 */
594
595/*!
596 * To go back to a OpenXR object.
597 */
598static inline XrDebugUtilsMessengerEXT
600{
601 return XRT_CAST_PTR_TO_OXR_HANDLE(XrDebugUtilsMessengerEXT, mssngr);
602}
603
604XrResult
606 struct oxr_instance *inst,
607 const XrDebugUtilsMessengerCreateInfoEXT *,
608 struct oxr_debug_messenger **out_mssngr);
609XrResult
610oxr_destroy_messenger(struct oxr_logger *log, struct oxr_debug_messenger *mssngr);
611
612
613/*
614 *
615 * oxr_system.c
616 *
617 */
618
619XrResult
620oxr_system_select(struct oxr_logger *log,
621 struct oxr_system **systems,
622 uint32_t system_count,
623 XrFormFactor form_factor,
624 struct oxr_system **out_selected);
625
626XrResult
628 struct oxr_instance *inst,
629 XrSystemId systemId,
630 uint32_t view_count,
631 struct oxr_system *sys);
632
633XrResult
634oxr_system_verify_id(struct oxr_logger *log, const struct oxr_instance *inst, XrSystemId systemId);
635
636XrResult
637oxr_system_get_by_id(struct oxr_logger *log,
638 struct oxr_instance *inst,
639 XrSystemId systemId,
640 struct oxr_system **system);
641
642XrResult
643oxr_system_get_properties(struct oxr_logger *log, struct oxr_system *sys, XrSystemProperties *properties);
644
645XrResult
646oxr_system_enumerate_view_confs(struct oxr_logger *log,
647 struct oxr_system *sys,
648 uint32_t viewConfigurationTypeCapacityInput,
649 uint32_t *viewConfigurationTypeCountOutput,
650 XrViewConfigurationType *viewConfigurationTypes);
651
652XrResult
653oxr_system_enumerate_blend_modes(struct oxr_logger *log,
654 struct oxr_system *sys,
655 XrViewConfigurationType viewConfigurationType,
656 uint32_t environmentBlendModeCapacityInput,
657 uint32_t *environmentBlendModeCountOutput,
658 XrEnvironmentBlendMode *environmentBlendModes);
659
660XrResult
661oxr_system_get_view_conf_properties(struct oxr_logger *log,
662 struct oxr_system *sys,
663 XrViewConfigurationType viewConfigurationType,
664 XrViewConfigurationProperties *configurationProperties);
665
666XrResult
667oxr_system_enumerate_view_conf_views(struct oxr_logger *log,
668 struct oxr_system *sys,
669 XrViewConfigurationType viewConfigurationType,
670 uint32_t viewCapacityInput,
671 uint32_t *viewCountOutput,
672 XrViewConfigurationView *views);
673
674bool
675oxr_system_get_hand_tracking_support(struct oxr_logger *log, struct oxr_instance *inst);
676
677bool
678oxr_system_get_eye_gaze_support(struct oxr_logger *log, struct oxr_instance *inst);
679
680bool
681oxr_system_get_force_feedback_support(struct oxr_logger *log, struct oxr_instance *inst);
682
683void
684oxr_system_get_face_tracking_android_support(struct oxr_logger *log, struct oxr_instance *inst, bool *supported);
685
686void
687oxr_system_get_face_tracking_htc_support(struct oxr_logger *log,
688 struct oxr_instance *inst,
689 bool *supports_eye,
690 bool *supports_lip);
691
692void
693oxr_system_get_face_tracking2_fb_support(struct oxr_logger *log,
694 struct oxr_instance *inst,
695 bool *supports_audio,
696 bool *supports_visual);
697
698bool
699oxr_system_get_body_tracking_fb_support(struct oxr_logger *log, struct oxr_instance *inst);
700
701bool
702oxr_system_get_full_body_tracking_meta_support(struct oxr_logger *log, struct oxr_instance *inst);
703
704bool
705oxr_system_get_body_tracking_calibration_meta_support(struct oxr_logger *log, struct oxr_instance *inst);
706
707bool
708oxr_system_get_body_tracking_fidelity_meta_support(struct oxr_logger *log, struct oxr_instance *inst);
709
710/*
711 *
712 * oxr_event.cpp
713 *
714 */
715
716XrResult
717oxr_event_push_XrEventDataSessionStateChanged(struct oxr_logger *log,
718 struct oxr_session *sess,
719 XrSessionState state,
720 XrTime time);
721
722XrResult
723oxr_event_push_XrEventDataInteractionProfileChanged(struct oxr_logger *log, struct oxr_session *sess);
724
725XrResult
726oxr_event_push_XrEventDataReferenceSpaceChangePending(struct oxr_logger *log,
727 struct oxr_session *sess,
728 XrReferenceSpaceType referenceSpaceType,
729 XrTime changeTime,
730 XrBool32 poseValid,
731 const XrPosef *poseInPreviousSpace);
732
733#ifdef OXR_HAVE_FB_display_refresh_rate
734XrResult
735oxr_event_push_XrEventDataDisplayRefreshRateChangedFB(struct oxr_logger *log,
736 struct oxr_session *sess,
737 float fromDisplayRefreshRate,
738 float toDisplayRefreshRate);
739#endif // OXR_HAVE_FB_display_refresh_rate
740
741#ifdef OXR_HAVE_EXTX_overlay
742XrResult
743oxr_event_push_XrEventDataMainSessionVisibilityChangedEXTX(struct oxr_logger *log,
744 struct oxr_session *sess,
745 bool visible);
746#endif // OXR_HAVE_EXTX_overlay
747
748#ifdef OXR_HAVE_EXT_performance_settings
749XrResult
750oxr_event_push_XrEventDataPerfSettingsEXTX(struct oxr_logger *log,
751 struct oxr_session *sess,
752 enum xrt_perf_domain domain,
753 enum xrt_perf_sub_domain subDomain,
754 enum xrt_perf_notify_level fromLevel,
755 enum xrt_perf_notify_level toLevel);
756#endif // OXR_HAVE_EXT_performance_settings
757/*!
758 * This clears all pending events refers to the given session.
759 */
760XrResult
762
763/*!
764 * Will return one event if available, also drain the sessions event queues.
765 */
766XrResult
767oxr_poll_event(struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuffer *eventData);
768
769
770/*
771 *
772 * oxr_xdev.c
773 *
774 */
775
776void
777oxr_xdev_destroy(struct xrt_device **xdev_ptr);
778
779/*!
780 * Return true if it finds an input of that name on this device.
781 */
782bool
783oxr_xdev_find_input(struct xrt_device *xdev, enum xrt_input_name name, struct xrt_input **out_input);
784
785/*!
786 * Return true if it finds an output of that name on this device.
787 */
788bool
789oxr_xdev_find_output(struct xrt_device *xdev, enum xrt_output_name name, struct xrt_output **out_output);
790
791#ifdef OXR_HAVE_MNDX_xdev_space
792static inline XrXDevListMNDX
793oxr_xdev_list_to_openxr(struct oxr_xdev_list *sc)
794{
795 return XRT_CAST_PTR_TO_OXR_HANDLE(XrXDevListMNDX, sc);
796}
797
798XrResult
799oxr_xdev_list_create(struct oxr_logger *log,
800 struct oxr_session *sess,
801 const XrCreateXDevListInfoMNDX *createInfo,
802 struct oxr_xdev_list **out_xdl);
803
804XrResult
805oxr_xdev_list_get_properties(struct oxr_logger *log,
806 struct oxr_xdev_list *xdl,
807 uint32_t index,
808 XrXDevPropertiesMNDX *properties);
809
810XrResult
811oxr_xdev_list_space_create(struct oxr_logger *log,
812 struct oxr_xdev_list *xdl,
813 const XrCreateXDevSpaceInfoMNDX *createInfo,
814 uint32_t index,
815 struct oxr_space **out_space);
816
817bool
818oxr_xdev_list_get_xdev(struct oxr_logger *log,
819 struct oxr_xdev_list *xdl,
820 XrXDevIdMNDX id,
821 struct xrt_device **out_xdev);
822
823#endif // OXR_HAVE_MNDX_xdev_space
824
825
826/*
827 *
828 * OpenGL, located in various files.
829 *
830 */
831
832#ifdef XR_USE_GRAPHICS_API_OPENGL
833#ifdef XR_USE_PLATFORM_XLIB
834
835XrResult
836oxr_session_populate_gl_xlib(struct oxr_logger *log,
837 struct oxr_system *sys,
838 XrGraphicsBindingOpenGLXlibKHR const *next,
839 struct oxr_session *sess);
840#endif // XR_USE_PLATFORM_XLIB
841
842#ifdef XR_USE_PLATFORM_WIN32
843XrResult
844oxr_session_populate_gl_win32(struct oxr_logger *log,
845 struct oxr_system *sys,
846 XrGraphicsBindingOpenGLWin32KHR const *next,
847 struct oxr_session *sess);
848#endif // XR_USE_PLATFORM_WIN32
849#endif // XR_USE_GRAPHICS_API_OPENGL
850
851#if defined(XR_USE_GRAPHICS_API_OPENGL) || defined(XR_USE_GRAPHICS_API_OPENGL_ES)
852XrResult
853oxr_swapchain_gl_create(struct oxr_logger * /*log*/,
854 struct oxr_session *sess,
855 const XrSwapchainCreateInfo * /*createInfo*/,
856 struct oxr_swapchain **out_swapchain);
857
858#endif // XR_USE_GRAPHICS_API_OPENGL || XR_USE_GRAPHICS_API_OPENGL_ES
859
860#if defined(XR_USE_GRAPHICS_API_OPENGL_ES)
861#if defined(XR_USE_PLATFORM_ANDROID)
862XrResult
863oxr_session_populate_gles_android(struct oxr_logger *log,
864 struct oxr_system *sys,
865 XrGraphicsBindingOpenGLESAndroidKHR const *next,
866 struct oxr_session *sess);
867#endif // XR_USE_PLATFORM_ANDROID
868#endif // XR_USE_GRAPHICS_API_OPENGL_ES
869
870
871/*
872 *
873 * Vulkan, located in various files.
874 *
875 */
876
877#ifdef XR_USE_GRAPHICS_API_VULKAN
878
879XrResult
880oxr_vk_get_instance_exts(struct oxr_logger *log,
881 struct oxr_system *sys,
882 uint32_t namesCapacityInput,
883 uint32_t *namesCountOutput,
884 char *namesString);
885
886XrResult
887oxr_vk_get_device_exts(struct oxr_logger *log,
888 struct oxr_system *sys,
889 uint32_t namesCapacityInput,
890 uint32_t *namesCountOutput,
891 char *namesString);
892
893XrResult
894oxr_vk_get_requirements(struct oxr_logger *log,
895 struct oxr_system *sys,
896 XrGraphicsRequirementsVulkanKHR *graphicsRequirements);
897
898XrResult
900 struct oxr_system *sys,
901 const XrVulkanInstanceCreateInfoKHR *createInfo,
902 VkInstance *vulkanInstance,
903 VkResult *vulkanResult);
904
905XrResult
907 struct oxr_system *sys,
908 const XrVulkanDeviceCreateInfoKHR *createInfo,
909 VkDevice *vulkanDevice,
910 VkResult *vulkanResult);
911
912XrResult
913oxr_vk_get_physical_device(struct oxr_logger *log,
914 struct oxr_instance *inst,
915 struct oxr_system *sys,
916 VkInstance vkInstance,
917 PFN_vkGetInstanceProcAddr getProc,
918 VkPhysicalDevice *vkPhysicalDevice);
919
920XrResult
921oxr_session_populate_vk(struct oxr_logger *log,
922 struct oxr_system *sys,
923 XrGraphicsBindingVulkanKHR const *next,
924 struct oxr_session *sess);
925
926XrResult
927oxr_swapchain_vk_create(struct oxr_logger * /*log*/,
928 struct oxr_session *sess,
929 const XrSwapchainCreateInfo * /*createInfo*/,
930 struct oxr_swapchain **out_swapchain);
931
932#endif
933
934
935/*
936 *
937 * EGL, located in various files.
938 *
939 */
940
941#ifdef XR_USE_PLATFORM_EGL
942
943XrResult
944oxr_session_populate_egl(struct oxr_logger *log,
945 struct oxr_system *sys,
946 XrGraphicsBindingEGLMNDX const *next,
947 struct oxr_session *sess);
948
949XrResult
950oxr_egl_get_device(struct oxr_logger *log,
951 struct oxr_system *sys,
952 PFN_xrEglGetProcAddressMNDX getProcAddress,
953 EGLDeviceEXT *out_egl_device);
954
955#endif
956
957/*
958 *
959 * D3D version independent routines, located in oxr_d3d.cpp
960 *
961 */
962
963#if defined(XRT_HAVE_D3D11) || defined(XRT_HAVE_D3D12) || defined(XRT_DOXYGEN)
964/// Common GetRequirements call for D3D11 and D3D12
965XrResult
967 struct oxr_system *sys,
968 LUID *adapter_luid,
969 D3D_FEATURE_LEVEL *min_feature_level);
970
971/// Verify the provided LUID matches the expected one in @p sys
972XrResult
973oxr_d3d_check_luid(struct oxr_logger *log, struct oxr_system *sys, LUID *adapter_luid);
974#endif
975
976/*
977 *
978 * D3D11, located in various files.
979 *
980 */
981
982#ifdef XR_USE_GRAPHICS_API_D3D11
983
984XrResult
985oxr_d3d11_get_requirements(struct oxr_logger *log,
986 struct oxr_system *sys,
987 XrGraphicsRequirementsD3D11KHR *graphicsRequirements);
988
989/**
990 * @brief Check to ensure the device provided at session create matches the LUID we returned earlier.
991 *
992 * @return XR_SUCCESS if the device matches the LUID
993 */
994XrResult
995oxr_d3d11_check_device(struct oxr_logger *log, struct oxr_system *sys, ID3D11Device *device);
996
997
998XrResult
999oxr_session_populate_d3d11(struct oxr_logger *log,
1000 struct oxr_system *sys,
1001 XrGraphicsBindingD3D11KHR const *next,
1002 struct oxr_session *sess);
1003
1004XrResult
1005oxr_swapchain_d3d11_create(struct oxr_logger *,
1006 struct oxr_session *sess,
1007 const XrSwapchainCreateInfo *,
1008 struct oxr_swapchain **out_swapchain);
1009
1010#endif
1011
1012/*
1013 *
1014 * D3D12, located in various files.
1015 *
1016 */
1017
1018#ifdef XR_USE_GRAPHICS_API_D3D12
1019
1020XrResult
1021oxr_d3d12_get_requirements(struct oxr_logger *log,
1022 struct oxr_system *sys,
1023 XrGraphicsRequirementsD3D12KHR *graphicsRequirements);
1024
1025/**
1026 * @brief Check to ensure the device provided at session create matches the LUID we returned earlier.
1027 *
1028 * @return XR_SUCCESS if the device matches the LUID
1029 */
1030XrResult
1031oxr_d3d12_check_device(struct oxr_logger *log, struct oxr_system *sys, ID3D12Device *device);
1032
1033
1034XrResult
1035oxr_session_populate_d3d12(struct oxr_logger *log,
1036 struct oxr_system *sys,
1037 XrGraphicsBindingD3D12KHR const *next,
1038 struct oxr_session *sess);
1039
1040XrResult
1041oxr_swapchain_d3d12_create(struct oxr_logger *,
1042 struct oxr_session *sess,
1043 const XrSwapchainCreateInfo *,
1044 struct oxr_swapchain **out_swapchain);
1045
1046#endif
1047
1048/*
1049 *
1050 * Structs
1051 *
1052 */
1053
1054
1055/*!
1056 * Holds the properties that a system supports for a view configuration type.
1057 *
1058 * @relates oxr_system
1059 */
1061{
1062 XrViewConfigurationType view_config_type;
1063
1064 uint32_t view_count;
1065 XrViewConfigurationView views[XRT_MAX_COMPOSITOR_VIEW_CONFIGS_VIEW_COUNT];
1066
1067 uint32_t blend_mode_count;
1068 XrEnvironmentBlendMode blend_modes[3];
1069};
1070
1071/*!
1072 * Single or multiple devices grouped together to form a system that sessions
1073 * can be created from. Might need to open devices to get all
1074 * properties from it, but shouldn't.
1075 *
1076 * Not strictly an object, but an atom.
1077 *
1078 * Valid only within an XrInstance (@ref oxr_instance)
1079 *
1080 * @obj{XrSystemId}
1081 */
1083{
1084 struct oxr_instance *inst;
1085
1086 //! The @ref xrt_iface level system.
1088
1089 //! System devices used in all session types.
1091
1092 //! Space overseer used in all session types.
1094
1095 //! System compositor, used to create session compositors.
1097
1098 XrSystemId systemId;
1099
1100 //! Have the client application called the gfx api requirements func?
1102
1103 uint32_t view_config_count;
1104 struct oxr_view_config_properties view_configs[XRT_MAX_COMPOSITOR_VIEW_CONFIGS_COUNT];
1105
1106 XrReferenceSpaceType reference_spaces[5];
1107 uint32_t reference_space_count;
1108
1109 struct xrt_visibility_mask *visibility_mask[XRT_MAX_COMPOSITOR_VIEW_CONFIGS_VIEW_COUNT];
1110
1111#ifdef OXR_HAVE_MNDX_xdev_space
1112 bool supports_xdev_space;
1113#endif
1114
1115#ifdef XR_USE_GRAPHICS_API_VULKAN
1116 //! The instance/device we create when vulkan_enable2 is used
1118 //! The device returned with the last xrGetVulkanGraphicsDeviceKHR or xrGetVulkanGraphicsDevice2KHR call.
1119 //! XR_NULL_HANDLE if neither has been called.
1121
1122 /*!
1123 * Stores the vkGetInstanceProcAddr passed to xrCreateVulkanInstanceKHR to be
1124 * used when looking up Vulkan functions used by xrGetVulkanGraphicsDevice2KHR.
1125 */
1126 PFN_vkGetInstanceProcAddr vk_get_instance_proc_addr;
1127
1128 struct
1129 {
1130 // No better place to keep this state.
1131 bool external_fence_fd_enabled;
1132 bool external_semaphore_fd_enabled;
1133 bool timeline_semaphore_enabled;
1134 bool debug_utils_enabled;
1135 bool image_format_list_enabled;
1136 } vk;
1137
1138#endif
1139
1140#if defined(XR_USE_GRAPHICS_API_D3D11) || defined(XR_USE_GRAPHICS_API_D3D12)
1141 LUID suggested_d3d_luid;
1142 bool suggested_d3d_luid_valid;
1143#endif
1144};
1145
1146/*
1147 * Extensions helpers.
1148 */
1149
1150#define MAKE_EXT_STATUS(mixed_case, all_caps) bool mixed_case;
1151/*!
1152 * Structure tracking which extensions are enabled for a given instance.
1153 *
1154 * Names are systematic: the extension name with the XR_ prefix removed.
1155 */
1157{
1158 OXR_EXTENSION_SUPPORT_GENERATE(MAKE_EXT_STATUS)
1159};
1160#undef MAKE_EXT_STATUS
1161
1162#define XRT_MAX_DEBUG_MESSENGERS 256
1163
1164/*!
1165 * Main object that ties everything together.
1166 *
1167 * No parent type/handle: this is the root handle.
1168 *
1169 * @obj{XrInstance}
1170 * @extends oxr_handle_base
1171 */
1173{
1174 //! Common structure for things referred to by OpenXR handles.
1176
1177 struct u_debug_gui *debug_ui;
1178
1179 struct xrt_instance *xinst;
1180
1181 //! Enabled extensions
1183
1184 //! The OpenXR version requested in the app info. It determines the instance's OpenXR version.
1185 struct
1186 {
1187 //! Stores only major.minor version. Simplifies comparisons for e.g. "at least OpenXR 1.1".
1188 XrVersion major_minor;
1190
1191 // Protects the function oxr_instance_init_system_locked.
1192 struct os_mutex system_init_lock;
1193
1194 // Hardcoded single system.
1195 struct oxr_system system;
1196
1197 struct time_state *timekeeping;
1198
1199 //! Path store for managing paths.
1201
1202 // Event queue.
1203 struct
1204 {
1205 struct os_mutex mutex;
1206 struct oxr_event *last;
1207 struct oxr_event *next;
1208 } event;
1209
1210 struct oxr_session *sessions;
1211
1212 //! Path cache for actions, needs path_store to work.
1214
1215 //! The default action context (reference-counted). Owned by instance; action sets also hold references.
1217
1218 struct
1219 {
1220 struct
1221 {
1222 struct
1223 {
1224 uint32_t major;
1225 uint32_t minor;
1226 uint32_t patch;
1227 const char *name; //< Engine name, not freed.
1228 } engine;
1229 } detected;
1230 } appinfo;
1231
1232 struct
1233 {
1234 /*!
1235 * Some applications can't handle depth formats, or they trigger
1236 * a bug in a specific version of the application or engine.
1237 * This flag only disables depth formats
1238 * @see disable_vulkan_format_depth_stencil for depth-stencil formats.
1239 */
1241
1242 /*!
1243 * Some applications can't handle depth stencil formats, or they
1244 * trigger a bug in a specific version of the application or
1245 * engine.
1246 *
1247 * This flag only disables depth-stencil formats,
1248 * @see disable_vulkan_format_depth flag for depth only formats.
1249 *
1250 * In the past it was used to work around a bug in Unreal's
1251 * VulkanRHI backend.
1252 */
1254
1255 /*!
1256 * Disable the listing of quad views as a supported view config,
1257 * the extensions are still exposed.
1258 */
1260
1261 //! Unreal 4 has a bug calling xrEndSession; the function should just exit
1263
1264 /*!
1265 * Return XR_ERROR_REFERENCE_SPACE_UNSUPPORTED instead of
1266 * XR_ERROR_VALIDATION_FAILURE in xrCreateReferenceSpace.
1267 */
1269
1270 //! For applications that rely on views being parallel, notably some OpenVR games with OpenComposite.
1272
1273 //! For applications that use stage and don't offer recentering.
1275
1276 /*!
1277 * Beat Saber submits its projection layer with XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT set.
1278 * This breaks rendering because the game uses the alpha texture to store data for the bloom shader,
1279 * causing most of the game to render as black, only showing glowing parts of the image.
1280 */
1282
1283 /*!
1284 * Don't return XR_ERROR_VALIDATION_FAILURE if an
1285 * application sets unsupported usage flags when
1286 * calling xrCreateSwapchain.
1287 */
1289 } quirks;
1290
1291 //! Debug messengers
1292 struct oxr_debug_messenger *messengers[XRT_MAX_DEBUG_MESSENGERS];
1293
1294 bool lifecycle_verbose;
1295 bool debug_views;
1296 bool debug_spaces;
1297 bool debug_bindings;
1298
1299#ifdef XRT_FEATURE_RENDERDOC
1300 RENDERDOC_API_1_4_1 *rdoc_api;
1301#endif
1302
1303#ifdef XRT_OS_ANDROID
1304 enum xrt_android_lifecycle_event activity_state;
1305#endif // XRT_OS_ANDROID
1306};
1307
1308/*
1309 * This includes needs to be here because it has static inline functions that
1310 * de-references the oxr_instance object. This refactor was made mid-patchset
1311 * so doing too many changes to other files would have been really disruptive
1312 * but this include will be removed soon.
1313 */
1314#include "path/oxr_path_wrappers.h"
1315
1316
1317/*!
1318 * Object that client program interact with.
1319 *
1320 * Parent type/handle is @ref oxr_instance
1321 *
1322 * @obj{XrSession}
1323 * @extends oxr_handle_base
1324 */
1326{
1327 //! Common structure for things referred to by OpenXR handles.
1329 struct oxr_system *sys;
1330
1331 //! What graphics type was this session created with.
1333
1334 //! The @ref xrt_session backing this session.
1336
1337 //! Native compositor that is wrapped by client compositors.
1339
1340 struct xrt_compositor *compositor;
1341
1342 struct oxr_session *next;
1343
1344 XrSessionState state;
1345
1346 /*!
1347 * This is set in xrBeginSession and is the primaryViewConfiguration
1348 * argument, this is then used in xrEndFrame to know which view
1349 * configuration the application is submitting it's frame in.
1350 */
1351 XrViewConfigurationType current_view_config_type;
1352
1353 //! State of the head's XRT_INPUT_GENERIC_HEAD_DETECT input, for oxr_poll_event.
1355
1356 /*!
1357 * There is a extra state between xrBeginSession has been called and
1358 * the first xrEndFrame has been called. These are to track this.
1359 */
1361
1362 bool compositor_visible;
1363 bool compositor_focused;
1364
1365 // the number of xrWaitFrame calls that did not yet have a corresponding
1366 // xrEndFrame or xrBeginFrame (discarded frame) call
1367 int active_wait_frames;
1368 struct os_mutex active_wait_frames_lock;
1369
1370 bool frame_started;
1371 bool exiting;
1372
1373 struct
1374 {
1375 int64_t waited;
1376 int64_t begun;
1377 } frame_id;
1378
1379 struct oxr_frame_sync frame_sync;
1380
1381 /*!
1382 * Used to implement precise extra sleeping in wait frame.
1383 */
1385
1386 /*!
1387 * Holds all the action state that belongs on the session level.
1388 */
1390
1391 /*!
1392 * Per-session map of action key to action attachment (thread-safe).
1393 */
1395
1396 /*!
1397 * IPD, to be expanded to a proper 3D relation.
1398 */
1400
1401 /*!
1402 * Frame timing debug output.
1403 */
1405
1406 //! Extra sleep in wait frame.
1408
1409 /*!
1410 * To pipe swapchain creation to right code.
1411 */
1412 XrResult (*create_swapchain)(struct oxr_logger *,
1413 struct oxr_session *sess,
1414 const XrSwapchainCreateInfo *,
1415 struct oxr_swapchain **);
1416
1417 /*! initial relation of head in "global" space.
1418 * Used as reference for local space. */
1419 // struct xrt_space_relation local_space_pure_relation;
1420
1422};
1423
1424/*!
1425 * Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate.
1426 *
1427 * @public @memberof oxr_session
1428 */
1429static inline XrResult
1431{
1432 switch (session->state) {
1433 case XR_SESSION_STATE_LOSS_PENDING: return XR_SESSION_LOSS_PENDING;
1434 default: return XR_SUCCESS;
1435 }
1436}
1437
1438/*!
1439 * Returns XR_SUCCESS, XR_SESSION_LOSS_PENDING, or XR_SESSION_NOT_FOCUSED, as
1440 * appropriate.
1441 *
1442 * @public @memberof oxr_session
1443 */
1444static inline XrResult
1446{
1447 switch (session->state) {
1448 case XR_SESSION_STATE_LOSS_PENDING: return XR_SESSION_LOSS_PENDING;
1449 case XR_SESSION_STATE_FOCUSED: return XR_SUCCESS;
1450 default: return XR_SESSION_NOT_FOCUSED;
1451 }
1452}
1453
1454#ifdef OXR_HAVE_FB_display_refresh_rate
1455XrResult
1456oxr_session_get_display_refresh_rate(struct oxr_logger *log, struct oxr_session *sess, float *displayRefreshRate);
1457
1458XrResult
1459oxr_session_request_display_refresh_rate(struct oxr_logger *log, struct oxr_session *sess, float displayRefreshRate);
1460#endif // OXR_HAVE_FB_display_refresh_rate
1461
1462
1463/*!
1464 * dpad emulation settings from oxr_interaction_profile
1465 */
1467{
1468 enum oxr_subaction_path subaction_path;
1469 XrPath *paths;
1470 uint32_t path_count;
1471 enum xrt_input_name position;
1472 enum xrt_input_name activate; // Can be zero
1473};
1474
1475/*!
1476 * A single interaction profile.
1477 */
1479{
1480 XrPath path;
1481
1482 //! Used to lookup @ref xrt_binding_profile for fallback.
1484
1485 //! Name presented to the user.
1486 const char *localized_name;
1487
1488 struct oxr_binding *bindings;
1489 size_t binding_count;
1490
1491 struct oxr_dpad_emulation *dpads;
1492 size_t dpad_count;
1493
1494 struct oxr_dpad_state dpad_state;
1495};
1496
1497/*!
1498 * Interaction profile binding state.
1499 */
1501{
1502 XrPath *paths;
1503 uint32_t path_count;
1504
1505 //! Name presented to the user.
1506 const char *localized_name;
1507
1508 enum oxr_subaction_path subaction_path;
1509
1510 uint32_t act_key_count;
1511 uint32_t *act_keys;
1512 //! store which entry in paths was suggested, for each action key
1514
1515 enum xrt_input_name input;
1516 enum xrt_input_name dpad_activate;
1517
1518 enum xrt_output_name output;
1519};
1520
1521/*!
1522 * @defgroup oxr_input OpenXR input
1523 * @ingroup oxr_main
1524 *
1525 * @brief The action-set/action-based input subsystem of OpenXR.
1526 *
1527 *
1528 * Action sets are created as children of the Instance, but are primarily used
1529 * with one or more Sessions. They may be used with multiple sessions at a time,
1530 * so we can't just put the per-session information directly in the action set
1531 * or action. Instead, we have the `_attachment `structures, which mirror the
1532 * action sets and actions but are rooted under the Session:
1533 *
1534 * - For every action set attached to a session, that session owns a @ref
1535 * oxr_action_set_attachment.
1536 * - For each action in those attached action sets, the action set attachment
1537 * owns an @ref oxr_action_attachment.
1538 *
1539 * We go from the public handle to the `_attachment` structure by using a `key`
1540 * value and a hash map: specifically, we look up the
1541 * oxr_action_set::act_set_key and oxr_action::act_key in the session.
1542 *
1543 * ![](monado-input-class-relationships.drawio.svg)
1544 */
1545
1546/*!
1547 * The data associated with the attachment of an Action Set (@ref
1548 * oxr_action_set) to as Session (@ref oxr_session).
1549 *
1550 * This structure has no pointer to the @ref oxr_action_set that created it
1551 * because the application is allowed to destroy an action before the session,
1552 * which should change nothing except not allow the application to use the
1553 * corresponding data anymore.
1554 *
1555 * @ingroup oxr_input
1556 *
1557 * @see oxr_action_set
1558 */
1560{
1561 //! Owning session action context.
1563
1564 //! Action set refcounted data
1566
1567 //! Unique key for the session hashmap.
1568 uint32_t act_set_key;
1569
1570 //! Which sub-action paths are requested on the latest sync.
1572
1573 //! An array of action attachments we own.
1575
1576 /*!
1577 * Length of @ref oxr_action_set_attachment::act_attachments.
1578 */
1580};
1581
1582
1583
1584/*!
1585 * The state of a action input.
1586 *
1587 * @ingroup oxr_input
1588 *
1589 * @see oxr_action_attachment
1590 */
1592{
1593 /*!
1594 * The actual value - must interpret using action type
1595 */
1596 union xrt_input_value value;
1597
1598 //! Is this active (bound and providing input)?
1600
1601 // Was this changed.
1602 bool changed;
1603
1604 //! When was this last changed.
1606};
1607
1608/*!
1609 * A input action pair of a @ref xrt_input and a @ref xrt_device, along with the
1610 * required transform.
1611 *
1612 * @ingroup oxr_input
1613 *
1614 * @see xrt_device
1615 * @see xrt_input
1616 */
1618{
1619 struct xrt_device *xdev; // Used for poses and transform is null.
1620 struct xrt_input *input; // Ditto
1621 enum xrt_input_name dpad_activate_name; // used to activate dpad emulation if present
1622 struct xrt_input *dpad_activate; // used to activate dpad emulation if present
1623 struct oxr_input_transform *transforms;
1624 size_t transform_count;
1625 XrPath bound_path;
1626};
1627
1628/*!
1629 * A output action pair of a @ref xrt_output_name and a @ref xrt_device.
1630 *
1631 * @ingroup oxr_input
1632 *
1633 * @see xrt_device
1634 * @see xrt_output_name
1635 */
1637{
1638 struct xrt_device *xdev;
1639 enum xrt_output_name name;
1640 XrPath bound_path;
1641};
1642
1643
1644/*!
1645 * The set of inputs/outputs for a single sub-action path for an action.
1646 *
1647 * Each @ref oxr_action_attachment has one of these for every known sub-action
1648 * path in the spec. Many, or even most, will be "empty".
1649 *
1650 * A single action will either be input or output, not both.
1651 *
1652 * @ingroup oxr_input
1653 *
1654 * @see oxr_action_attachment
1655 */
1657{
1658 struct oxr_action_state current;
1659
1660 size_t input_count;
1661 struct oxr_action_input *inputs;
1662
1663 int64_t stop_output_time;
1664 size_t output_count;
1665 struct oxr_action_output *outputs;
1666};
1667
1668/*!
1669 * Data associated with an Action that has been attached to a Session.
1670 *
1671 * More information on the action vs action attachment and action set vs action
1672 * set attachment parallel is in the docs for @ref oxr_input
1673 *
1674 * @ingroup oxr_input
1675 *
1676 * @see oxr_action
1677 */
1679{
1680 //! The owning action set attachment
1682
1683 //! This action's refcounted data
1685
1686 //! The session attached actions this action attachment belongs to.
1688
1689 //! Unique key for the session hashmap.
1690 uint32_t act_key;
1691
1692 /*!
1693 * For pose actions any subaction paths are special treated, at bind
1694 * time we pick one subaction path and stick to it as long as the action
1695 * lives.
1696 */
1698
1699 struct oxr_action_state any_state;
1700
1701#define OXR_CACHE_MEMBER(X) struct oxr_action_cache X;
1702 OXR_FOR_EACH_SUBACTION_PATH(OXR_CACHE_MEMBER)
1703#undef OXR_CACHE_MEMBER
1704};
1705
1706/*!
1707 * @}
1708 */
1709
1710
1711static inline bool
1712oxr_space_type_is_reference(enum oxr_space_type space_type)
1713{
1714 switch (space_type) {
1715 case OXR_SPACE_TYPE_REFERENCE_VIEW:
1716 case OXR_SPACE_TYPE_REFERENCE_LOCAL:
1717 case OXR_SPACE_TYPE_REFERENCE_LOCAL_FLOOR:
1718 case OXR_SPACE_TYPE_REFERENCE_STAGE:
1719 case OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_MSFT:
1720 case OXR_SPACE_TYPE_REFERENCE_COMBINED_EYE_VARJO:
1721 case OXR_SPACE_TYPE_REFERENCE_LOCALIZATION_MAP_ML:
1722 case OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_ANDROID:
1723 // These are reference spaces.
1724 return true;
1725
1726 case OXR_SPACE_TYPE_ACTION:
1727 case OXR_SPACE_TYPE_XDEV_POSE:
1728 // These are not reference spaces.
1729 return false;
1730 }
1731
1732 // Handles invalid value.
1733 return false;
1734}
1735
1736
1737/*!
1738 * Can be one of several reference space types, or a space that is bound to an
1739 * action.
1740 *
1741 * Parent type/handle is @ref oxr_session
1742 *
1743 * @obj{XrSpace}
1744 * @extends oxr_handle_base
1745 */
1747{
1748 //! Common structure for things referred to by OpenXR handles.
1750
1751 //! Owner of this space.
1753
1754 //! Pose that was given during creation.
1756
1757 //! Action key from which action this space was created from.
1758 uint32_t act_key;
1759
1760 //! What kind of space is this?
1762
1763 //! Which sub action path is this?
1765
1766 struct
1767 {
1768 struct xrt_space *xs;
1769 struct xrt_device *xdev;
1770 enum xrt_input_name name;
1771
1772 bool feature_eye_tracking;
1773 } action;
1774
1775 struct
1776 {
1777 struct xrt_space *xs;
1778 } xdev_pose;
1779};
1780
1781/*!
1782 * A set of images used for rendering.
1783 *
1784 * Parent type/handle is @ref oxr_session
1785 *
1786 * @obj{XrSwapchain}
1787 * @extends oxr_handle_base
1788 */
1790{
1791 //! Common structure for things referred to by OpenXR handles.
1793
1794 //! Owner of this swapchain.
1796
1797 //! Compositor swapchain.
1799
1800 //! Swapchain size.
1801 uint32_t width, height;
1802
1803 //! For 1 is 2D texture, greater then 1 2D array texture.
1805
1806 //! The number of cubemap faces. 6 for cubemaps, 1 otherwise.
1807 uint32_t face_count;
1808
1809 struct
1810 {
1811 enum oxr_image_state state;
1812 } images[XRT_MAX_SWAPCHAIN_IMAGES];
1813
1814 struct
1815 {
1816 size_t num;
1817 struct u_index_fifo fifo;
1818 } acquired;
1819
1820 struct
1821 {
1822 bool yes;
1823 int index;
1824 } inflight; // This is the image that the app is working on.
1825
1826 struct
1827 {
1828 bool yes;
1829 int index;
1830 } released;
1831
1832 // Is this a static swapchain, needed for acquire semantics.
1833 bool is_static;
1834
1835
1836 XrResult (*destroy)(struct oxr_logger *, struct oxr_swapchain *);
1837
1838 XrResult (*enumerate_images)(struct oxr_logger *,
1839 struct oxr_swapchain *,
1840 uint32_t,
1841 XrSwapchainImageBaseHeader *);
1842
1843 XrResult (*acquire_image)(struct oxr_logger *,
1844 struct oxr_swapchain *,
1845 const XrSwapchainImageAcquireInfo *,
1846 uint32_t *);
1847
1848 XrResult (*wait_image)(struct oxr_logger *, struct oxr_swapchain *, const XrSwapchainImageWaitInfo *);
1849
1850 XrResult (*release_image)(struct oxr_logger *, struct oxr_swapchain *, const XrSwapchainImageReleaseInfo *);
1851};
1852
1853/*!
1854 * The reference-counted data of an action set.
1855 *
1856 * One or more sessions may still need this data after the application destroys
1857 * its XrActionSet handle, so this data is refcounted.
1858 *
1859 * @ingroup oxr_input
1860 *
1861 * @see oxr_action_set
1862 * @extends oxr_refcounted
1863 */
1865{
1866 struct oxr_refcounted base;
1867
1868 //! Application supplied name of this action.
1869 char name[XR_MAX_ACTION_SET_NAME_SIZE];
1870
1871 /*!
1872 * Has this action set even been attached to any session, marking it as
1873 * immutable.
1874 */
1876
1877 //! Unique key for the session hashmap.
1878 uint32_t act_set_key;
1879
1880 //! Application supplied action set priority.
1881 uint32_t priority;
1882
1883 struct oxr_pair_hashset actions;
1884
1885 struct oxr_subaction_paths permitted_subaction_paths;
1886};
1887
1888/*!
1889 * A group of actions.
1890 *
1891 * Parent type/handle is @ref oxr_instance
1892 *
1893 * Note, however, that an action set must be "attached" to a session
1894 * ( @ref oxr_session ) to be used and not just configured.
1895 * The corresponding data is in @ref oxr_action_set_attachment.
1896 *
1897 * @ingroup oxr_input
1898 *
1899 * @obj{XrActionSet}
1900 * @extends oxr_handle_base
1901 */
1903{
1904 //! Common structure for things referred to by OpenXR handles.
1906
1907 //! Owner of this action set.
1909
1910 //! Reference to the instance action context (reference-counted).
1912
1913 /*!
1914 * The data for this action set that must live as long as any session we
1915 * are attached to.
1916 */
1918
1919
1920 /*!
1921 * Unique key for the session hashmap.
1922 *
1923 * Duplicated from oxr_action_set_ref::act_set_key for efficiency.
1924 */
1925 uint32_t act_set_key;
1926
1927 //! The item in the name hashset.
1929
1930 //! The item in the localized hashset.
1932};
1933
1934/*!
1935 * The reference-counted data of an action.
1936 *
1937 * One or more sessions may still need this data after the application destroys
1938 * its XrAction handle, so this data is refcounted.
1939 *
1940 * @ingroup oxr_input
1941 *
1942 * @see oxr_action
1943 * @extends oxr_refcounted
1944 */
1946{
1947 struct oxr_refcounted base;
1948
1949 //! Application supplied name of this action.
1950 char name[XR_MAX_ACTION_NAME_SIZE];
1951
1952 //! Unique key for the session hashmap.
1953 uint32_t act_key;
1954
1955 //! Type this action was created with.
1956 XrActionType action_type;
1957
1958 //! Which sub action paths that this action was created with.
1960};
1961
1962/*!
1963 * A single action.
1964 *
1965 * Parent type/handle is @ref oxr_action_set
1966 *
1967 * For actual usage, an action is attached to a session: the corresponding data
1968 * is in @ref oxr_action_attachment
1969 *
1970 * @ingroup oxr_input
1971 *
1972 * @obj{XrAction}
1973 * @extends oxr_handle_base
1974 */
1976{
1977 //! Common structure for things referred to by OpenXR handles.
1979
1980 //! Owner of this action.
1982
1983 //! The data for this action that must live as long as any session we
1984 //! are attached to.
1986
1987 /*!
1988 * Unique key for the session hashmap.
1989 *
1990 * Duplicated from oxr_action_ref::act_key for efficiency.
1991 */
1992 uint32_t act_key;
1993
1994 //! The item in the name hashset.
1996
1997 //! The item in the localized hashset.
1999};
2000
2001/*!
2002 * Debug object created by the client program.
2003 *
2004 * Parent type/handle is @ref oxr_instance
2005 *
2006 * @obj{XrDebugUtilsMessengerEXT}
2007 */
2009{
2010 //! Common structure for things referred to by OpenXR handles.
2012
2013 //! Owner of this messenger.
2015
2016 //! Severities to submit to this messenger
2017 XrDebugUtilsMessageSeverityFlagsEXT message_severities;
2018
2019 //! Types to submit to this messenger
2020 XrDebugUtilsMessageTypeFlagsEXT message_types;
2021
2022 //! Callback function
2023 PFN_xrDebugUtilsMessengerCallbackEXT user_callback;
2024
2025 //! Opaque user data
2026 void *XR_MAY_ALIAS user_data;
2027};
2028
2029#ifdef OXR_HAVE_FB_passthrough
2030
2031struct oxr_passthrough
2032{
2033 struct oxr_handle_base handle;
2034
2035 struct oxr_session *sess;
2036
2037 XrPassthroughFlagsFB flags;
2038
2039 bool paused;
2040};
2041
2042struct oxr_passthrough_layer
2043{
2044 struct oxr_handle_base handle;
2045
2046 struct oxr_session *sess;
2047
2048 XrPassthroughFB passthrough;
2049
2050 XrPassthroughFlagsFB flags;
2051
2052 XrPassthroughLayerPurposeFB purpose;
2053
2054 bool paused;
2055
2056 XrPassthroughStyleFB style;
2057 XrPassthroughColorMapMonoToRgbaFB monoToRgba;
2058 XrPassthroughColorMapMonoToMonoFB monoToMono;
2059 XrPassthroughBrightnessContrastSaturationFB brightnessContrastSaturation;
2060};
2061
2062XrResult
2063oxr_passthrough_create(struct oxr_logger *log,
2064 struct oxr_session *sess,
2065 const XrPassthroughCreateInfoFB *createInfo,
2066 struct oxr_passthrough **out_passthrough);
2067
2068XrResult
2069oxr_passthrough_layer_create(struct oxr_logger *log,
2070 struct oxr_session *sess,
2071 const XrPassthroughLayerCreateInfoFB *createInfo,
2072 struct oxr_passthrough_layer **out_layer);
2073
2074static inline XrPassthroughFB
2075oxr_passthrough_to_openxr(struct oxr_passthrough *passthrough)
2076{
2077 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPassthroughFB, passthrough);
2078}
2079
2080static inline XrPassthroughLayerFB
2081oxr_passthrough_layer_to_openxr(struct oxr_passthrough_layer *passthroughLayer)
2082{
2083 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPassthroughLayerFB, passthroughLayer);
2084}
2085
2086XrResult
2087oxr_event_push_XrEventDataPassthroughStateChangedFB(struct oxr_logger *log,
2088 struct oxr_session *sess,
2089 XrPassthroughStateChangedFlagsFB flags);
2090
2091#endif // OXR_HAVE_FB_passthrough
2092
2093#ifdef OXR_HAVE_HTC_facial_tracking
2094/*!
2095 * HTC specific Facial tracker.
2096 *
2097 * Parent type/handle is @ref oxr_instance
2098 *
2099 *
2100 * @obj{XrFacialTrackerHTC}
2101 * @extends oxr_handle_base
2102 */
2103struct oxr_facial_tracker_htc
2104{
2105 //! Common structure for things referred to by OpenXR handles.
2106 struct oxr_handle_base handle;
2107
2108 //! Owner of this face tracker.
2109 struct oxr_session *sess;
2110
2111 //! xrt_device backing this face tracker
2112 struct xrt_device *xdev;
2113
2114 //! Type of facial tracking, eyes or lips
2115 enum xrt_facial_tracking_type_htc facial_tracking_type;
2116
2117 //! To track if the feature set has been incremented since creation.
2118 bool feature_incremented;
2119};
2120
2121XrResult
2122oxr_facial_tracker_htc_create(struct oxr_logger *log,
2123 struct oxr_session *sess,
2124 const XrFacialTrackerCreateInfoHTC *createInfo,
2125 struct oxr_facial_tracker_htc **out_face_tracker_htc);
2126
2127XrResult
2128oxr_get_facial_expressions_htc(struct oxr_logger *log,
2129 struct oxr_facial_tracker_htc *facial_tracker_htc,
2130 XrFacialExpressionsHTC *facialExpressions);
2131#endif
2132
2133#ifdef OXR_HAVE_FB_body_tracking
2134/*!
2135 * FB specific Body tracker.
2136 *
2137 * Parent type/handle is @ref oxr_instance
2138 *
2139 * @obj{XrBodyTrackerFB}
2140 * @extends oxr_handle_base
2141 */
2142struct oxr_body_tracker_fb
2143{
2144 //! Common structure for things referred to by OpenXR handles.
2145 struct oxr_handle_base handle;
2146
2147 //! Owner of this face tracker.
2148 struct oxr_session *sess;
2149
2150 //! xrt_body_tracker backing this body tracker
2151 struct xrt_body_tracker *xbt;
2152
2153 //! Type of the body joint set e.g. XR_FB_body_tracking or XR_META_body_tracking_full_body
2154 enum xrt_body_joint_set_type_fb joint_set_type;
2155};
2156
2157XrResult
2158oxr_create_body_tracker_fb(struct oxr_logger *log,
2159 struct oxr_session *sess,
2160 const XrBodyTrackerCreateInfoFB *createInfo,
2161 struct oxr_body_tracker_fb **out_body_tracker_fb);
2162
2163XrResult
2164oxr_get_body_skeleton_fb(struct oxr_logger *log,
2165 struct oxr_body_tracker_fb *body_tracker_fb,
2166 XrBodySkeletonFB *skeleton);
2167
2168XrResult
2169oxr_locate_body_joints_fb(struct oxr_logger *log,
2170 struct oxr_body_tracker_fb *body_tracker_fb,
2171 struct oxr_space *base_spc,
2172 const XrBodyJointsLocateInfoFB *locateInfo,
2173 XrBodyJointLocationsFB *locations);
2174#endif
2175
2176#ifdef OXR_HAVE_BD_body_tracking
2177/*!
2178 * BD (PICO) specific Body tracker.
2179 *
2180 * Parent type/handle is @ref oxr_session
2181 *
2182 * @obj{XrBodyTrackerBD}
2183 * @extends oxr_handle_base
2184 */
2185struct oxr_body_tracker_bd
2186{
2187 //! Common structure for things referred to by OpenXR handles.
2188 struct oxr_handle_base handle;
2189
2190 //! Owner of this body tracker.
2191 struct oxr_session *sess;
2192
2193 //! xrt_body_tracker backing this body tracker
2194 struct xrt_body_tracker *xbt;
2195
2196 //! Type of the body joint set (with or without arms)
2197 enum xrt_body_joint_set_type_bd joint_set_type;
2198};
2199
2200XrResult
2201oxr_create_body_tracker_bd(struct oxr_logger *log,
2202 struct oxr_session *sess,
2203 const XrBodyTrackerCreateInfoBD *createInfo,
2204 struct oxr_body_tracker_bd **out_body_tracker_bd);
2205
2206XrResult
2207oxr_locate_body_joints_bd(struct oxr_logger *log,
2208 struct oxr_body_tracker_bd *body_tracker_bd,
2209 struct oxr_space *base_spc,
2210 const XrBodyJointsLocateInfoBD *locateInfo,
2211 XrBodyJointLocationsBD *locations);
2212
2213bool
2214oxr_system_get_body_tracking_bd_support(struct oxr_logger *log, struct oxr_instance *inst);
2215#endif
2216
2217#ifdef OXR_HAVE_FB_face_tracking2
2218/*!
2219 * FB specific Face tracker2.
2220 *
2221 * Parent type/handle is @ref oxr_instance
2222 *
2223 * @obj{XrFaceTracker2FB}
2224 * @extends oxr_handle_base
2225 */
2226struct oxr_face_tracker2_fb
2227{
2228 //! Common structure for things referred to by OpenXR handles.
2229 struct oxr_handle_base handle;
2230
2231 //! Owner of this face tracker.
2232 struct oxr_session *sess;
2233
2234 //! xrt_device backing this face tracker
2235 struct xrt_device *xdev;
2236
2237 bool audio_enabled;
2238 bool visual_enabled;
2239
2240 //! To track if the feature set has been incremented since creation.
2241 bool feature_incremented;
2242};
2243
2244XrResult
2245oxr_face_tracker2_fb_create(struct oxr_logger *log,
2246 struct oxr_session *sess,
2247 const XrFaceTrackerCreateInfo2FB *createInfo,
2248 struct oxr_face_tracker2_fb **out_face_tracker2_fb);
2249
2250XrResult
2251oxr_get_face_expression_weights2_fb(struct oxr_logger *log,
2252 struct oxr_face_tracker2_fb *face_tracker2_fb,
2253 const XrFaceExpressionInfo2FB *expression_info,
2254 XrFaceExpressionWeights2FB *expression_weights);
2255#endif
2256
2257#ifdef OXR_HAVE_MNDX_xdev_space
2258/*!
2259 * Object that holds a list of the current @ref xrt_devices.
2260 *
2261 * Parent type/handle is @ref oxr_session
2262 *
2263 * @obj{XrXDevList}
2264 * @extends oxr_handle_base
2265 */
2266struct oxr_xdev_list
2267{
2268 //! Common structure for things referred to by OpenXR handles.
2269 struct oxr_handle_base handle;
2270
2271 //! Owner of this @ref xrt_device list.
2272 struct oxr_session *sess;
2273
2274 //! Monotonically increasing number.
2275 uint64_t generation_number;
2276
2277 uint64_t ids[XRT_SYSTEM_MAX_DEVICES];
2278 struct xrt_device *xdevs[XRT_SYSTEM_MAX_DEVICES];
2280
2281 //! Counts ids, names and xdevs.
2282 uint32_t device_count;
2283};
2284#endif // OXR_HAVE_MNDX_xdev_space
2285
2286#ifdef OXR_HAVE_EXT_plane_detection
2287/*!
2288 * A Plane Detector.
2289 *
2290 * Parent type/handle is @ref oxr_session
2291 *
2292 *
2293 * @obj{XrPlaneDetectorEXT}
2294 * @extends oxr_handle_base
2295 */
2296struct oxr_plane_detector_ext
2297{
2298 //! Common structure for things referred to by OpenXR handles.
2299 struct oxr_handle_base handle;
2300
2301 //! Owner of this anchor.
2302 struct oxr_session *sess;
2303
2304 //! Plane detector flags.
2306
2307 //! The last known state of this plane detector.
2308 XrPlaneDetectionStateEXT state;
2309
2310 //! Whether the last DONE plane detection has been retrieved from the xdev.
2311 bool retrieved;
2312
2313 //! The device that this plane detector belongs to.
2314 struct xrt_device *xdev;
2315
2316 //! Detected planes. xrt_plane_detector_locations_ext::relation is kept in xdev space and not updated.
2317 struct xrt_plane_detections_ext detections;
2318
2319 //! Corresponds to xrt_plane_detections_ext::locations, but with OpenXR types and transformed into target space.
2320 //! Enables two call idiom.
2321 XrPlaneDetectorLocationEXT *xr_locations;
2322
2323 //! A globally unique id for the current plane detection or 0, generated by the xrt_device.
2324 uint64_t detection_id;
2325};
2326#endif // OXR_HAVE_EXT_plane_detection
2327
2328#ifdef OXR_HAVE_EXT_future
2329/*!
2330 * EXT futures.
2331 *
2332 * Parent type/handle is @ref oxr_instance
2333 *
2334 * @obj{XrFutureEXT}
2335 * @extends oxr_handle_base
2336 */
2337struct oxr_future_ext
2338{
2339 //! Common structure for things referred to by OpenXR handles.
2340 struct oxr_handle_base handle;
2341
2342 //! (weak) reference to instance (may or not be a direct parent handle")
2343 struct oxr_instance *inst;
2344
2345 //! Owning session.
2346 struct oxr_session *sess;
2347
2348 //! xrt_future backing this future
2349 struct xrt_future *xft;
2350};
2351
2352/*!
2353 * To go back to a OpenXR object.
2354 *
2355 * @relates oxr_future_ext
2356 */
2357static inline XrFutureEXT
2358oxr_future_ext_to_openxr(struct oxr_future_ext *future_ext)
2359{
2360 return XRT_CAST_PTR_TO_OXR_HANDLE(XrFutureEXT, future_ext);
2361}
2362
2363XrResult
2364oxr_future_create(struct oxr_logger *log,
2365 struct oxr_session *sess,
2366 struct xrt_future *xft,
2367 struct oxr_handle_parent_base *parent_handle,
2368 struct oxr_future_ext **out_oxr_future_ext);
2369
2370XrResult
2371oxr_future_invalidate(struct oxr_logger *log, struct oxr_future_ext *oxr_future);
2372
2373XrResult
2374oxr_future_ext_poll(struct oxr_logger *log, const struct oxr_future_ext *oxr_future, XrFuturePollResultEXT *pollResult);
2375
2376XrResult
2377oxr_future_ext_cancel(struct oxr_logger *log, struct oxr_future_ext *oxr_future);
2378
2379XrResult
2380oxr_future_ext_complete(struct oxr_logger *log,
2381 struct oxr_future_ext *oxr_future,
2382 struct xrt_future_result *out_ft_result);
2383
2384#endif
2385
2386#ifdef OXR_HAVE_EXT_user_presence
2387XrResult
2388oxr_event_push_XrEventDataUserPresenceChangedEXT(struct oxr_logger *log, struct oxr_session *sess, bool isUserPresent);
2389#endif // OXR_HAVE_EXT_user_presence
2390
2391#ifdef OXR_HAVE_ANDROID_face_tracking
2392/*!
2393 * Android specific Facial tracker.
2394 *
2395 * Parent type/handle is @ref oxr_instance
2396 *
2397 *
2398 * @obj{XrFaceTrackerANDROID}
2399 * @extends oxr_handle_base
2400 */
2401struct oxr_face_tracker_android
2402{
2403 //! Common structure for things referred to by OpenXR handles.
2404 struct oxr_handle_base handle;
2405
2406 //! Owner of this face tracker.
2407 struct oxr_session *sess;
2408
2409 //! xrt_device backing this face tracker
2410 struct xrt_device *xdev;
2411
2412 //! To track if the feature set has been incremented since creation.
2413 bool feature_incremented;
2414};
2415
2416XrResult
2417oxr_face_tracker_android_create(struct oxr_logger *log,
2418 struct oxr_session *sess,
2419 const XrFaceTrackerCreateInfoANDROID *createInfo,
2420 XrFaceTrackerANDROID *faceTracker);
2421
2422XrResult
2424 struct oxr_face_tracker_android *facial_tracker_android,
2425 const XrFaceStateGetInfoANDROID *getInfo,
2426 XrFaceStateANDROID *faceStateOutput);
2427
2428XrResult
2429oxr_get_face_calibration_state_android(struct oxr_logger *log,
2430 struct oxr_face_tracker_android *facial_tracker_android,
2431 XrBool32 *faceIsCalibratedOutput);
2432#endif // OXR_HAVE_ANDROID_face_tracking
2433
2434/*!
2435 * @}
2436 */
2437
2438
2439#ifdef __cplusplus
2440}
2441#endif
XrResult oxr_poll_event(struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuffer *eventData)
Will return one event if available, also drain the sessions event queues.
Definition oxr_event.c:428
XrResult oxr_spaces_locate(struct oxr_logger *log, struct oxr_space **spcs, uint32_t spc_count, struct oxr_space *baseSpc, XrTime time, XrSpaceLocations *locations)
Definition oxr_space.c:307
static XrSwapchain oxr_swapchain_to_openxr(struct oxr_swapchain *sc)
To go back to a OpenXR object.
Definition oxr_objects.h:583
oxr_image_state
Tracks the state of a image that belongs to a oxr_swapchain.
Definition oxr_defines.h:83
XrResult oxr_d3d_check_luid(struct oxr_logger *log, struct oxr_system *sys, LUID *adapter_luid)
Verify the provided LUID matches the expected one in sys.
Definition oxr_d3d.cpp:80
XrResult oxr_event_remove_session_events(struct oxr_logger *log, struct oxr_session *sess)
This clears all pending events refers to the given session.
Definition oxr_event.c:386
static XrResult oxr_session_success_result(struct oxr_session *session)
Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate.
Definition oxr_objects.h:1430
static XrResult oxr_session_success_focused_result(struct oxr_session *session)
Returns XR_SUCCESS, XR_SESSION_LOSS_PENDING, or XR_SESSION_NOT_FOCUSED, as appropriate.
Definition oxr_objects.h:1445
XrResult oxr_space_xdev_pose_create(struct oxr_logger *log, struct oxr_session *sess, struct xrt_device *xdev, enum xrt_input_name name, const struct xrt_pose *pose, struct oxr_space **out_space)
Monado special space that always points to a specific xrt_device and pose, useful when you want to by...
Definition oxr_space.c:254
XRT_CHECK_RESULT XrResult oxr_space_locate_device(struct oxr_logger *log, struct xrt_device *xdev, struct oxr_space *baseSpc, XrTime time, struct xrt_space_relation *out_relation)
Locate the xrt_device in the given base space, useful for implementing hand tracking location look up...
Definition oxr_space.c:597
static XrDebugUtilsMessengerEXT oxr_messenger_to_openxr(struct oxr_debug_messenger *mssngr)
To go back to a OpenXR object.
Definition oxr_objects.h:599
XrResult oxr_space_locate(struct oxr_logger *log, struct oxr_space *spc, struct oxr_space *baseSpc, XrTime time, XrSpaceLocation *location)
Definition oxr_space.c:464
XrResult oxr_session_frame_end(struct oxr_logger *log, struct oxr_session *sess, const XrFrameEndInfo *frameEndInfo)
Definition oxr_session_frame_end.c:1764
static XrInstance oxr_instance_to_openxr(struct oxr_instance *inst)
To go back to a OpenXR object.
Definition oxr_objects.h:177
static XrHandTrackerEXT oxr_hand_tracker_to_openxr(struct oxr_hand_tracker *hand_tracker)
To go back to a OpenXR object.
Definition oxr_objects.h:279
static XrActionSet oxr_action_set_to_openxr(struct oxr_action_set *act_set)
To go back to a OpenXR object.
Definition oxr_objects.h:268
static XrSession oxr_session_to_openxr(struct oxr_session *sess)
To go back to a OpenXR object.
Definition oxr_objects.h:386
oxr_session_graphics_ext
What graphics API was this session created with.
Definition oxr_defines.h:115
static XrAction oxr_action_to_openxr(struct oxr_action *act)
To go back to a OpenXR object.
Definition oxr_objects.h:303
XrResult oxr_d3d_get_requirements(struct oxr_logger *log, struct oxr_system *sys, LUID *adapter_luid, D3D_FEATURE_LEVEL *min_feature_level)
Common GetRequirements call for D3D11 and D3D12.
Definition oxr_d3d.cpp:42
bool oxr_xdev_find_input(struct xrt_device *xdev, enum xrt_input_name name, struct xrt_input **out_input)
Return true if it finds an input of that name on this device.
Definition oxr_xdev.c:110
oxr_space_type
Internal enum for the type of space, lets us reason about action spaces.
Definition oxr_defines.h:95
XrResult oxr_vk_create_vulkan_instance(struct oxr_logger *log, struct oxr_system *sys, const XrVulkanInstanceCreateInfoKHR *createInfo, VkInstance *vulkanInstance, VkResult *vulkanResult)
Definition oxr_vulkan.c:229
XrResult oxr_session_request_exit(struct oxr_logger *log, struct oxr_session *sess)
Definition oxr_session.c:583
void oxr_session_change_state(struct oxr_logger *log, struct oxr_session *sess, XrSessionState state, XrTime time)
Change the state of the session, queues a event.
Definition oxr_session.c:353
XrResult oxr_system_fill_in(struct oxr_logger *log, struct oxr_instance *inst, XrSystemId systemId, uint32_t view_count, struct oxr_system *sys)
Definition oxr_system.c:304
XrResult oxr_create_messenger(struct oxr_logger *, struct oxr_instance *inst, const XrDebugUtilsMessengerCreateInfoEXT *, struct oxr_debug_messenger **out_mssngr)
Definition oxr_messenger.c:44
XrResult oxr_space_action_create(struct oxr_logger *log, struct oxr_session *sess, uint32_t key, const XrActionSpaceCreateInfo *createInfo, struct oxr_space **out_space)
Definition oxr_space.c:167
XRT_CHECK_RESULT XrResult oxr_space_get_xrt_space(struct oxr_logger *log, struct oxr_space *spc, struct xrt_space **out_xspace)
Get the xrt_space associated with this oxr_space, the xrt_space will be reference counted by this fun...
Definition oxr_space.c:629
XrResult oxr_session_frame_wait(struct oxr_logger *log, struct oxr_session *sess, XrFrameState *frameState)
Definition oxr_session.c:1065
static XrSpace oxr_space_to_openxr(struct oxr_space *spc)
To go back to a OpenXR object.
Definition oxr_objects.h:492
oxr_subaction_path
Sub action paths.
Definition oxr_defines.h:54
XrResult oxr_vk_create_vulkan_device(struct oxr_logger *log, struct oxr_system *sys, const XrVulkanDeviceCreateInfoKHR *createInfo, VkDevice *vulkanDevice, VkResult *vulkanResult)
Definition oxr_vulkan.c:386
bool oxr_xdev_find_output(struct xrt_device *xdev, enum xrt_output_name name, struct xrt_output **out_output)
Return true if it finds an output of that name on this device.
Definition oxr_xdev.c:129
#define XRT_CAST_PTR_TO_OXR_HANDLE(HANDLE_TYPE, PTR)
Cast a pointer to an OpenXR handle in such a way as to avoid warnings.
Definition oxr_objects.h:91
#define XRT_SYSTEM_MAX_DEVICES
Maximum number of devices simultaneously usable by an implementation of xrt_system_devices.
Definition xrt_limits.h:26
#define XRT_MAX_SWAPCHAIN_IMAGES
Max swapchain images, artificial limit.
Definition xrt_limits.h:53
xrt_input_name
Every internal input source known to monado with a baked in type.
Definition xrt_defines.h:930
xrt_output_name
Name of a output with a baked in type.
Definition xrt_defines.h:1612
xrt_plane_detector_flags_ext
Flags used when running plane detection.
Definition xrt_plane_detector.h:46
Definition bindings.py:1
Wrapper around OS threading native functions.
Shared internal defines and enums in the state tracker.
Holds dpad state related functions.
XrResult oxr_get_face_state_android(struct oxr_logger *log, struct oxr_face_tracker_android *facial_tracker_android, const XrFaceStateGetInfoANDROID *getInfo, XrFaceStateANDROID *faceStateOutput)
Definition oxr_face_tracking_android.c:77
Forward declarations for OpenXR state tracker structs.
The objects that handle session running status and blocking of xrWaitFrame.
Contains handle-related functions and defines only required in a few locations.
XrResult oxr_instance_create(struct oxr_logger *log, const XrInstanceCreateInfo *createInfo, XrVersion major_minor, const struct oxr_extension_status *extensions, struct oxr_instance **out_instance)
Definition oxr_instance.c:261
Holds per instance action context.
Holds per instance action cache.
Holds interaction profile array related functions.
Path store structure and functions.
Wrapper functions that take oxr_instance and call into path/cache functions.
Reference-counted base for OpenXR state tracker objects.
Holds per session action context.
Holds per session attached actions.
Provides a utility macro for dealing with subaction paths.
#define OXR_FOR_EACH_SUBACTION_PATH(_)
Expansion macro (x-macro) that calls the macro you pass with the shorthand name of each subaction pat...
Definition oxr_subaction.h:44
Definition m_space.cpp:87
A wrapper around a native mutex.
Definition os_threading.h:69
Definition os_time.h:219
Data associated with an Action that has been attached to a Session.
Definition oxr_objects.h:1679
struct oxr_session_attached_actions * attached_actions
The session attached actions this action attachment belongs to.
Definition oxr_objects.h:1687
struct oxr_subaction_paths any_pose_subaction_path
For pose actions any subaction paths are special treated, at bind time we pick one subaction path and...
Definition oxr_objects.h:1697
struct oxr_action_ref * act_ref
This action's refcounted data.
Definition oxr_objects.h:1684
struct oxr_action_set_attachment * act_set_attached
The owning action set attachment.
Definition oxr_objects.h:1681
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:1690
The set of inputs/outputs for a single sub-action path for an action.
Definition oxr_objects.h:1657
A input action pair of a xrt_input and a xrt_device, along with the required transform.
Definition oxr_objects.h:1618
A output action pair of a xrt_output_name and a xrt_device.
Definition oxr_objects.h:1637
The reference-counted data of an action.
Definition oxr_objects.h:1946
struct oxr_subaction_paths subaction_paths
Which sub action paths that this action was created with.
Definition oxr_objects.h:1959
XrActionType action_type
Type this action was created with.
Definition oxr_objects.h:1956
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:1953
The data associated with the attachment of an Action Set (oxr_action_set) to as Session (oxr_session)...
Definition oxr_objects.h:1560
struct oxr_session_action_context * sess_context
Owning session action context.
Definition oxr_objects.h:1562
struct oxr_action_attachment * act_attachments
An array of action attachments we own.
Definition oxr_objects.h:1574
struct oxr_action_set_ref * act_set_ref
Action set refcounted data.
Definition oxr_objects.h:1565
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1568
size_t action_attachment_count
Length of oxr_action_set_attachment::act_attachments.
Definition oxr_objects.h:1579
struct oxr_subaction_paths requested_subaction_paths
Which sub-action paths are requested on the latest sync.
Definition oxr_objects.h:1571
The reference-counted data of an action set.
Definition oxr_objects.h:1865
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1878
bool ever_attached
Has this action set even been attached to any session, marking it as immutable.
Definition oxr_objects.h:1875
uint32_t priority
Application supplied action set priority.
Definition oxr_objects.h:1881
A group of actions.
Definition oxr_objects.h:1903
struct oxr_instance_action_context * inst_context
Reference to the instance action context (reference-counted).
Definition oxr_objects.h:1911
struct u_hashset_item * name_item
The item in the name hashset.
Definition oxr_objects.h:1928
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition oxr_objects.h:1931
struct oxr_action_set_ref * data
The data for this action set that must live as long as any session we are attached to.
Definition oxr_objects.h:1917
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1925
struct oxr_instance * inst
Owner of this action set.
Definition oxr_objects.h:1908
struct oxr_handle_parent_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1905
The state of a action input.
Definition oxr_objects.h:1592
bool active
Is this active (bound and providing input)?
Definition oxr_objects.h:1599
XrTime timestamp
When was this last changed.
Definition oxr_objects.h:1605
A single action.
Definition oxr_objects.h:1976
struct oxr_action_set * act_set
Owner of this action.
Definition oxr_objects.h:1981
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1978
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition oxr_objects.h:1998
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:1992
struct u_hashset_item * name_item
The item in the name hashset.
Definition oxr_objects.h:1995
struct oxr_action_ref * data
The data for this action that must live as long as any session we are attached to.
Definition oxr_objects.h:1985
Interaction profile binding state.
Definition oxr_objects.h:1501
uint32_t * preferred_binding_path_index
store which entry in paths was suggested, for each action key
Definition oxr_objects.h:1513
const char * localized_name
Name presented to the user.
Definition oxr_objects.h:1506
Debug object created by the client program.
Definition oxr_objects.h:2009
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:2011
XrDebugUtilsMessageTypeFlagsEXT message_types
Types to submit to this messenger.
Definition oxr_objects.h:2020
PFN_xrDebugUtilsMessengerCallbackEXT user_callback
Callback function.
Definition oxr_objects.h:2023
struct oxr_instance * inst
Owner of this messenger.
Definition oxr_objects.h:2014
void *XR_MAY_ALIAS user_data
Opaque user data.
Definition oxr_objects.h:2026
XrDebugUtilsMessageSeverityFlagsEXT message_severities
Severities to submit to this messenger.
Definition oxr_objects.h:2017
dpad emulation settings from oxr_interaction_profile
Definition oxr_objects.h:1467
Holds dpad binding state for a single interaction profile.
Definition oxr_dpad_state.h:83
Definition oxr_event.c:30
Structure tracking which extensions are enabled for a given instance.
Definition oxr_objects.h:1157
Helper that handles synchronizing the xr{Wait,Begin,End}Frame calls.
Definition oxr_frame_sync.h:37
A hand tracker.
Definition oxr_hand_tracking.h:38
A single OpenXR handle, which is a child of a parent handle holder, if any.
Definition oxr_handle_base.h:62
Used to hold diverse child handles and ensure orderly destruction.
Definition oxr_handle_base.h:88
Variant type for input transforms.
Definition oxr_input_transform.h:144
Holds all action-related state that lives at the instance level (shared across sessions).
Definition oxr_instance_action_context.h:47
This holds cached paths for subaction paths.
Definition oxr_instance_path_cache.h:27
Main object that ties everything together.
Definition oxr_objects.h:1173
bool disable_vulkan_format_depth
Some applications can't handle depth formats, or they trigger a bug in a specific version of the appl...
Definition oxr_objects.h:1240
bool parallel_views
For applications that rely on views being parallel, notably some OpenVR games with OpenComposite.
Definition oxr_objects.h:1271
struct oxr_instance::@285 openxr_version
The OpenXR version requested in the app info. It determines the instance's OpenXR version.
struct oxr_path_store path_store
Path store for managing paths.
Definition oxr_objects.h:1200
bool disable_vulkan_format_depth_stencil
Some applications can't handle depth stencil formats, or they trigger a bug in a specific version of ...
Definition oxr_objects.h:1253
XrVersion major_minor
Stores only major.minor version. Simplifies comparisons for e.g. "at least OpenXR 1....
Definition oxr_objects.h:1188
bool skip_end_session
Unreal 4 has a bug calling xrEndSession; the function should just exit.
Definition oxr_objects.h:1262
struct oxr_instance_action_context * action_context
The default action context (reference-counted). Owned by instance; action sets also hold references.
Definition oxr_objects.h:1216
bool no_validation_error_in_create_ref_space
Return XR_ERROR_REFERENCE_SPACE_UNSUPPORTED instead of XR_ERROR_VALIDATION_FAILURE in xrCreateReferen...
Definition oxr_objects.h:1268
struct oxr_extension_status extensions
Enabled extensions.
Definition oxr_objects.h:1182
struct oxr_instance_path_cache path_cache
Path cache for actions, needs path_store to work.
Definition oxr_objects.h:1213
bool disable_quad_views
Disable the listing of quad views as a supported view config, the extensions are still exposed.
Definition oxr_objects.h:1259
struct oxr_debug_messenger * messengers[256]
Debug messengers.
Definition oxr_objects.h:1292
struct oxr_handle_parent_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1175
bool no_usage_bit_validation_in_create_swapchain
Don't return XR_ERROR_VALIDATION_FAILURE if an application sets unsupported usage flags when calling ...
Definition oxr_objects.h:1288
bool map_stage_to_local_floor
For applications that use stage and don't offer recentering.
Definition oxr_objects.h:1274
bool no_texture_source_alpha
Beat Saber submits its projection layer with XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT set.
Definition oxr_objects.h:1281
A single interaction profile.
Definition oxr_objects.h:1479
enum xrt_device_name xname
Used to lookup xrt_binding_profile for fallback.
Definition oxr_objects.h:1483
const char * localized_name
Name presented to the user.
Definition oxr_objects.h:1486
Logger struct that lives on the stack, one for each call client call.
Definition oxr_logger.h:44
A pair of hashets (name_store and loc_store) with an optional mutex so that both members can be remov...
Definition oxr_pair_hashset.h:36
Path store structure for managing path storage and lookup.
Definition oxr_path_store.h:31
Definition oxr_refcounted.h:21
This holds all of the action state that belongs on the session level.
Definition oxr_session_action_context.h:62
Per-session map of action key to action attachment.
Definition oxr_session_attached_actions.h:37
Object that client program interact with.
Definition oxr_objects.h:1326
XrResult(* create_swapchain)(struct oxr_logger *, struct oxr_session *sess, const XrSwapchainCreateInfo *, struct oxr_swapchain **)
To pipe swapchain creation to right code.
Definition oxr_objects.h:1412
struct xrt_compositor_native * xcn
Native compositor that is wrapped by client compositors.
Definition oxr_objects.h:1338
struct oxr_session_action_context action_context
Holds all the action state that belongs on the session level.
Definition oxr_objects.h:1389
struct xrt_session * xs
The xrt_session backing this session.
Definition oxr_objects.h:1335
XrViewConfigurationType current_view_config_type
This is set in xrBeginSession and is the primaryViewConfiguration argument, this is then used in xrEn...
Definition oxr_objects.h:1351
uint32_t frame_timing_wait_sleep_ms
Extra sleep in wait frame.
Definition oxr_objects.h:1407
struct os_precise_sleeper sleeper
Used to implement precise extra sleeping in wait frame.
Definition oxr_objects.h:1384
bool presence
State of the head's XRT_INPUT_GENERIC_HEAD_DETECT input, for oxr_poll_event.
Definition oxr_objects.h:1354
struct oxr_session_attached_actions attached_actions
Per-session map of action key to action attachment (thread-safe).
Definition oxr_objects.h:1394
enum oxr_session_graphics_ext gfx_ext
What graphics type was this session created with.
Definition oxr_objects.h:1332
bool has_ended_once
There is a extra state between xrBeginSession has been called and the first xrEndFrame has been calle...
Definition oxr_objects.h:1360
bool has_lost
initial relation of head in "global" space.
Definition oxr_objects.h:1421
float ipd_meters
IPD, to be expanded to a proper 3D relation.
Definition oxr_objects.h:1399
struct oxr_handle_parent_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1328
bool frame_timing_spew
Frame timing debug output.
Definition oxr_objects.h:1404
Can be one of several reference space types, or a space that is bound to an action.
Definition oxr_objects.h:1747
struct oxr_subaction_paths subaction_paths
Which sub action path is this?
Definition oxr_objects.h:1764
enum oxr_space_type space_type
What kind of space is this?
Definition oxr_objects.h:1761
uint32_t act_key
Action key from which action this space was created from.
Definition oxr_objects.h:1758
struct xrt_pose pose
Pose that was given during creation.
Definition oxr_objects.h:1755
struct oxr_session * sess
Owner of this space.
Definition oxr_objects.h:1752
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1749
A parsed equivalent of a list of sub-action paths.
Definition oxr_subaction.h:99
A set of images used for rendering.
Definition oxr_objects.h:1790
struct oxr_session * sess
Owner of this swapchain.
Definition oxr_objects.h:1795
uint32_t face_count
The number of cubemap faces. 6 for cubemaps, 1 otherwise.
Definition oxr_objects.h:1807
struct xrt_swapchain * swapchain
Compositor swapchain.
Definition oxr_objects.h:1798
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1792
uint32_t width
Swapchain size.
Definition oxr_objects.h:1801
uint32_t array_layer_count
For 1 is 2D texture, greater then 1 2D array texture.
Definition oxr_objects.h:1804
Single or multiple devices grouped together to form a system that sessions can be created from.
Definition oxr_objects.h:1083
struct xrt_system * xsys
The XRT interfaces level system.
Definition oxr_objects.h:1087
VkPhysicalDevice suggested_vulkan_physical_device
The device returned with the last xrGetVulkanGraphicsDeviceKHR or xrGetVulkanGraphicsDevice2KHR call.
Definition oxr_objects.h:1120
PFN_vkGetInstanceProcAddr vk_get_instance_proc_addr
Stores the vkGetInstanceProcAddr passed to xrCreateVulkanInstanceKHR to be used when looking up Vulka...
Definition oxr_objects.h:1126
struct xrt_system_devices * xsysd
System devices used in all session types.
Definition oxr_objects.h:1090
struct xrt_space_overseer * xso
Space overseer used in all session types.
Definition oxr_objects.h:1093
VkInstance vulkan_enable2_instance
The instance/device we create when vulkan_enable2 is used.
Definition oxr_objects.h:1117
bool gotten_requirements
Have the client application called the gfx api requirements func?
Definition oxr_objects.h:1101
struct xrt_system_compositor * xsysc
System compositor, used to create session compositors.
Definition oxr_objects.h:1096
Holds the properties that a system supports for a view configuration type.
Definition oxr_objects.h:1061
Time-keeping state structure.
Definition u_time.cpp:30
A embeddable hashset item, note that the string directly follows the u_hashset_item.
Definition u_hashset.h:37
Definition u_index_fifo.h:21
Definition xrt_defines.h:2301
A body tracker, owns the policy for selecting which device and body-tracking source back a single Ope...
Definition xrt_body_tracker.h:102
Main compositor server interface.
Definition xrt_compositor.h:2290
Common compositor client interface/base.
Definition xrt_compositor.h:1046
A single HMD or input device.
Definition xrt_device.h:340
The (future) result of an asynchronous operation.
Definition xrt_future.h:39
A future is a concurrency primitive that provides a mechanism to access results of asynchronous opera...
Definition xrt_future.h:75
A single named input, that sits on a xrt_device.
Definition xrt_device.h:210
This interface acts as a root object for Monado.
Definition xrt_instance.h:121
A single named output, that sits on a xrt_device.
Definition xrt_device.h:228
Each plane has n polygons; ultimately plane metadata from xrt_plane_detections_ext::locations and xrt...
Definition xrt_plane_detector.h:172
A pose composed of a position and orientation.
Definition xrt_defines.h:492
The XRT representation of XrSession, this object does not have all of the functionality of a session,...
Definition xrt_session.h:264
Object that oversees and manages spaces, one created for each XR system.
Definition xrt_space.h:97
A relation with two spaces, includes velocity and acceleration.
Definition xrt_defines.h:683
A space very similar to a OpenXR XrSpace but not a full one-to-one mapping, but used to power XrSpace...
Definition xrt_space.h:32
Common swapchain interface/base.
Definition xrt_compositor.h:593
The system compositor handles composition for a system.
Definition xrt_compositor.h:2531
A collection of xrt_device, and an interface for identifying the roles they have been assigned.
Definition xrt_system.h:216
A system is a collection of devices, policies and optionally a compositor that is organised into a ch...
Definition xrt_system.h:65
Visibility mask helper, the indices and vertices are tightly packed after this struct.
Definition xrt_visibility_mask.h:26
Misc helpers for device drivers.
Hashmap for integer values header.
Hashset struct header.
A FIFO for indices.
A union of all input types.
Definition xrt_defines.h:1537
Header holding Android-specific details.
xrt_android_lifecycle_event
Distinguishes the possible Android lifecycle events from each other.
Definition xrt_android.h:43
Header declaring XRT graphics interfaces.
Auto detect OS and certain features.
xrt_perf_notify_level
Performance level.
Definition xrt_defines.h:2456
xrt_device_name
A enum that is used to name devices so that the state trackers can reason about the devices easier.
Definition xrt_defines.h:737
xrt_perf_domain
Domain type.
Definition xrt_defines.h:2429
Header defining an xrt display or controller device.
Interface for creating futures.
Header for limits of the XRT interfaces.
Include all of the openxr headers in one place.
Header defining xrt space and space overseer.
Header for system objects.
Header defining the tracking system integration in Monado.
Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.