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 /*!
1354 * There is a extra state between xrBeginSession has been called and
1355 * the first xrEndFrame has been called. These are to track this.
1356 */
1358
1359 bool compositor_visible;
1360 bool compositor_focused;
1361
1362 // the number of xrWaitFrame calls that did not yet have a corresponding
1363 // xrEndFrame or xrBeginFrame (discarded frame) call
1364 int active_wait_frames;
1365 struct os_mutex active_wait_frames_lock;
1366
1367 bool frame_started;
1368 bool exiting;
1369
1370 struct
1371 {
1372 int64_t waited;
1373 int64_t begun;
1374 } frame_id;
1375
1376 struct oxr_frame_sync frame_sync;
1377
1378 /*!
1379 * Used to implement precise extra sleeping in wait frame.
1380 */
1382
1383 /*!
1384 * Holds all the action state that belongs on the session level.
1385 */
1387
1388 /*!
1389 * Per-session map of action key to action attachment (thread-safe).
1390 */
1392
1393 /*!
1394 * IPD, to be expanded to a proper 3D relation.
1395 */
1397
1398 /*!
1399 * Frame timing debug output.
1400 */
1402
1403 //! Extra sleep in wait frame.
1405
1406 /*!
1407 * To pipe swapchain creation to right code.
1408 */
1409 XrResult (*create_swapchain)(struct oxr_logger *,
1410 struct oxr_session *sess,
1411 const XrSwapchainCreateInfo *,
1412 struct oxr_swapchain **);
1413
1414 /*! initial relation of head in "global" space.
1415 * Used as reference for local space. */
1416 // struct xrt_space_relation local_space_pure_relation;
1417
1419};
1420
1421/*!
1422 * Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate.
1423 *
1424 * @public @memberof oxr_session
1425 */
1426static inline XrResult
1428{
1429 switch (session->state) {
1430 case XR_SESSION_STATE_LOSS_PENDING: return XR_SESSION_LOSS_PENDING;
1431 default: return XR_SUCCESS;
1432 }
1433}
1434
1435/*!
1436 * Returns XR_SUCCESS, XR_SESSION_LOSS_PENDING, or XR_SESSION_NOT_FOCUSED, as
1437 * appropriate.
1438 *
1439 * @public @memberof oxr_session
1440 */
1441static inline XrResult
1443{
1444 switch (session->state) {
1445 case XR_SESSION_STATE_LOSS_PENDING: return XR_SESSION_LOSS_PENDING;
1446 case XR_SESSION_STATE_FOCUSED: return XR_SUCCESS;
1447 default: return XR_SESSION_NOT_FOCUSED;
1448 }
1449}
1450
1451#ifdef OXR_HAVE_FB_display_refresh_rate
1452XrResult
1453oxr_session_get_display_refresh_rate(struct oxr_logger *log, struct oxr_session *sess, float *displayRefreshRate);
1454
1455XrResult
1456oxr_session_request_display_refresh_rate(struct oxr_logger *log, struct oxr_session *sess, float displayRefreshRate);
1457#endif // OXR_HAVE_FB_display_refresh_rate
1458
1459
1460/*!
1461 * dpad emulation settings from oxr_interaction_profile
1462 */
1464{
1465 enum oxr_subaction_path subaction_path;
1466 XrPath *paths;
1467 uint32_t path_count;
1468 enum xrt_input_name position;
1469 enum xrt_input_name activate; // Can be zero
1470};
1471
1472/*!
1473 * A single interaction profile.
1474 */
1476{
1477 XrPath path;
1478
1479 //! Used to lookup @ref xrt_binding_profile for fallback.
1481
1482 //! Name presented to the user.
1483 const char *localized_name;
1484
1485 struct oxr_binding *bindings;
1486 size_t binding_count;
1487
1488 struct oxr_dpad_emulation *dpads;
1489 size_t dpad_count;
1490
1491 struct oxr_dpad_state dpad_state;
1492};
1493
1494/*!
1495 * Interaction profile binding state.
1496 */
1498{
1499 XrPath *paths;
1500 uint32_t path_count;
1501
1502 //! Name presented to the user.
1503 const char *localized_name;
1504
1505 enum oxr_subaction_path subaction_path;
1506
1507 uint32_t act_key_count;
1508 uint32_t *act_keys;
1509 //! store which entry in paths was suggested, for each action key
1511
1512 enum xrt_input_name input;
1513 enum xrt_input_name dpad_activate;
1514
1515 enum xrt_output_name output;
1516};
1517
1518/*!
1519 * @defgroup oxr_input OpenXR input
1520 * @ingroup oxr_main
1521 *
1522 * @brief The action-set/action-based input subsystem of OpenXR.
1523 *
1524 *
1525 * Action sets are created as children of the Instance, but are primarily used
1526 * with one or more Sessions. They may be used with multiple sessions at a time,
1527 * so we can't just put the per-session information directly in the action set
1528 * or action. Instead, we have the `_attachment `structures, which mirror the
1529 * action sets and actions but are rooted under the Session:
1530 *
1531 * - For every action set attached to a session, that session owns a @ref
1532 * oxr_action_set_attachment.
1533 * - For each action in those attached action sets, the action set attachment
1534 * owns an @ref oxr_action_attachment.
1535 *
1536 * We go from the public handle to the `_attachment` structure by using a `key`
1537 * value and a hash map: specifically, we look up the
1538 * oxr_action_set::act_set_key and oxr_action::act_key in the session.
1539 *
1540 * ![](monado-input-class-relationships.drawio.svg)
1541 */
1542
1543/*!
1544 * The data associated with the attachment of an Action Set (@ref
1545 * oxr_action_set) to as Session (@ref oxr_session).
1546 *
1547 * This structure has no pointer to the @ref oxr_action_set that created it
1548 * because the application is allowed to destroy an action before the session,
1549 * which should change nothing except not allow the application to use the
1550 * corresponding data anymore.
1551 *
1552 * @ingroup oxr_input
1553 *
1554 * @see oxr_action_set
1555 */
1557{
1558 //! Owning session action context.
1560
1561 //! Action set refcounted data
1563
1564 //! Unique key for the session hashmap.
1565 uint32_t act_set_key;
1566
1567 //! Which sub-action paths are requested on the latest sync.
1569
1570 //! An array of action attachments we own.
1572
1573 /*!
1574 * Length of @ref oxr_action_set_attachment::act_attachments.
1575 */
1577};
1578
1579
1580
1581/*!
1582 * The state of a action input.
1583 *
1584 * @ingroup oxr_input
1585 *
1586 * @see oxr_action_attachment
1587 */
1589{
1590 /*!
1591 * The actual value - must interpret using action type
1592 */
1593 union xrt_input_value value;
1594
1595 //! Is this active (bound and providing input)?
1597
1598 // Was this changed.
1599 bool changed;
1600
1601 //! When was this last changed.
1603};
1604
1605/*!
1606 * A input action pair of a @ref xrt_input and a @ref xrt_device, along with the
1607 * required transform.
1608 *
1609 * @ingroup oxr_input
1610 *
1611 * @see xrt_device
1612 * @see xrt_input
1613 */
1615{
1616 struct xrt_device *xdev; // Used for poses and transform is null.
1617 struct xrt_input *input; // Ditto
1618 enum xrt_input_name dpad_activate_name; // used to activate dpad emulation if present
1619 struct xrt_input *dpad_activate; // used to activate dpad emulation if present
1620 struct oxr_input_transform *transforms;
1621 size_t transform_count;
1622 XrPath bound_path;
1623};
1624
1625/*!
1626 * A output action pair of a @ref xrt_output_name and a @ref xrt_device.
1627 *
1628 * @ingroup oxr_input
1629 *
1630 * @see xrt_device
1631 * @see xrt_output_name
1632 */
1634{
1635 struct xrt_device *xdev;
1636 enum xrt_output_name name;
1637 XrPath bound_path;
1638};
1639
1640
1641/*!
1642 * The set of inputs/outputs for a single sub-action path for an action.
1643 *
1644 * Each @ref oxr_action_attachment has one of these for every known sub-action
1645 * path in the spec. Many, or even most, will be "empty".
1646 *
1647 * A single action will either be input or output, not both.
1648 *
1649 * @ingroup oxr_input
1650 *
1651 * @see oxr_action_attachment
1652 */
1654{
1655 struct oxr_action_state current;
1656
1657 size_t input_count;
1658 struct oxr_action_input *inputs;
1659
1660 int64_t stop_output_time;
1661 size_t output_count;
1662 struct oxr_action_output *outputs;
1663};
1664
1665/*!
1666 * Data associated with an Action that has been attached to a Session.
1667 *
1668 * More information on the action vs action attachment and action set vs action
1669 * set attachment parallel is in the docs for @ref oxr_input
1670 *
1671 * @ingroup oxr_input
1672 *
1673 * @see oxr_action
1674 */
1676{
1677 //! The owning action set attachment
1679
1680 //! This action's refcounted data
1682
1683 //! The session attached actions this action attachment belongs to.
1685
1686 //! Unique key for the session hashmap.
1687 uint32_t act_key;
1688
1689 /*!
1690 * For pose actions any subaction paths are special treated, at bind
1691 * time we pick one subaction path and stick to it as long as the action
1692 * lives.
1693 */
1695
1696 struct oxr_action_state any_state;
1697
1698#define OXR_CACHE_MEMBER(X) struct oxr_action_cache X;
1699 OXR_FOR_EACH_SUBACTION_PATH(OXR_CACHE_MEMBER)
1700#undef OXR_CACHE_MEMBER
1701};
1702
1703/*!
1704 * @}
1705 */
1706
1707
1708static inline bool
1709oxr_space_type_is_reference(enum oxr_space_type space_type)
1710{
1711 switch (space_type) {
1712 case OXR_SPACE_TYPE_REFERENCE_VIEW:
1713 case OXR_SPACE_TYPE_REFERENCE_LOCAL:
1714 case OXR_SPACE_TYPE_REFERENCE_LOCAL_FLOOR:
1715 case OXR_SPACE_TYPE_REFERENCE_STAGE:
1716 case OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_MSFT:
1717 case OXR_SPACE_TYPE_REFERENCE_COMBINED_EYE_VARJO:
1718 case OXR_SPACE_TYPE_REFERENCE_LOCALIZATION_MAP_ML:
1719 case OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_ANDROID:
1720 // These are reference spaces.
1721 return true;
1722
1723 case OXR_SPACE_TYPE_ACTION:
1724 case OXR_SPACE_TYPE_XDEV_POSE:
1725 // These are not reference spaces.
1726 return false;
1727 }
1728
1729 // Handles invalid value.
1730 return false;
1731}
1732
1733
1734/*!
1735 * Can be one of several reference space types, or a space that is bound to an
1736 * action.
1737 *
1738 * Parent type/handle is @ref oxr_session
1739 *
1740 * @obj{XrSpace}
1741 * @extends oxr_handle_base
1742 */
1744{
1745 //! Common structure for things referred to by OpenXR handles.
1747
1748 //! Owner of this space.
1750
1751 //! Pose that was given during creation.
1753
1754 //! Action key from which action this space was created from.
1755 uint32_t act_key;
1756
1757 //! What kind of space is this?
1759
1760 //! Which sub action path is this?
1762
1763 struct
1764 {
1765 struct xrt_space *xs;
1766 struct xrt_device *xdev;
1767 enum xrt_input_name name;
1768
1769 bool feature_eye_tracking;
1770 } action;
1771
1772 struct
1773 {
1774 struct xrt_space *xs;
1775 } xdev_pose;
1776};
1777
1778/*!
1779 * A set of images used for rendering.
1780 *
1781 * Parent type/handle is @ref oxr_session
1782 *
1783 * @obj{XrSwapchain}
1784 * @extends oxr_handle_base
1785 */
1787{
1788 //! Common structure for things referred to by OpenXR handles.
1790
1791 //! Owner of this swapchain.
1793
1794 //! Compositor swapchain.
1796
1797 //! Swapchain size.
1798 uint32_t width, height;
1799
1800 //! For 1 is 2D texture, greater then 1 2D array texture.
1802
1803 //! The number of cubemap faces. 6 for cubemaps, 1 otherwise.
1804 uint32_t face_count;
1805
1806 struct
1807 {
1808 enum oxr_image_state state;
1809 } images[XRT_MAX_SWAPCHAIN_IMAGES];
1810
1811 struct
1812 {
1813 size_t num;
1814 struct u_index_fifo fifo;
1815 } acquired;
1816
1817 struct
1818 {
1819 bool yes;
1820 int index;
1821 } inflight; // This is the image that the app is working on.
1822
1823 struct
1824 {
1825 bool yes;
1826 int index;
1827 } released;
1828
1829 // Is this a static swapchain, needed for acquire semantics.
1830 bool is_static;
1831
1832
1833 XrResult (*destroy)(struct oxr_logger *, struct oxr_swapchain *);
1834
1835 XrResult (*enumerate_images)(struct oxr_logger *,
1836 struct oxr_swapchain *,
1837 uint32_t,
1838 XrSwapchainImageBaseHeader *);
1839
1840 XrResult (*acquire_image)(struct oxr_logger *,
1841 struct oxr_swapchain *,
1842 const XrSwapchainImageAcquireInfo *,
1843 uint32_t *);
1844
1845 XrResult (*wait_image)(struct oxr_logger *, struct oxr_swapchain *, const XrSwapchainImageWaitInfo *);
1846
1847 XrResult (*release_image)(struct oxr_logger *, struct oxr_swapchain *, const XrSwapchainImageReleaseInfo *);
1848};
1849
1850/*!
1851 * The reference-counted data of an action set.
1852 *
1853 * One or more sessions may still need this data after the application destroys
1854 * its XrActionSet handle, so this data is refcounted.
1855 *
1856 * @ingroup oxr_input
1857 *
1858 * @see oxr_action_set
1859 * @extends oxr_refcounted
1860 */
1862{
1863 struct oxr_refcounted base;
1864
1865 //! Application supplied name of this action.
1866 char name[XR_MAX_ACTION_SET_NAME_SIZE];
1867
1868 /*!
1869 * Has this action set even been attached to any session, marking it as
1870 * immutable.
1871 */
1873
1874 //! Unique key for the session hashmap.
1875 uint32_t act_set_key;
1876
1877 //! Application supplied action set priority.
1878 uint32_t priority;
1879
1880 struct oxr_pair_hashset actions;
1881
1882 struct oxr_subaction_paths permitted_subaction_paths;
1883};
1884
1885/*!
1886 * A group of actions.
1887 *
1888 * Parent type/handle is @ref oxr_instance
1889 *
1890 * Note, however, that an action set must be "attached" to a session
1891 * ( @ref oxr_session ) to be used and not just configured.
1892 * The corresponding data is in @ref oxr_action_set_attachment.
1893 *
1894 * @ingroup oxr_input
1895 *
1896 * @obj{XrActionSet}
1897 * @extends oxr_handle_base
1898 */
1900{
1901 //! Common structure for things referred to by OpenXR handles.
1903
1904 //! Owner of this action set.
1906
1907 //! Reference to the instance action context (reference-counted).
1909
1910 /*!
1911 * The data for this action set that must live as long as any session we
1912 * are attached to.
1913 */
1915
1916
1917 /*!
1918 * Unique key for the session hashmap.
1919 *
1920 * Duplicated from oxr_action_set_ref::act_set_key for efficiency.
1921 */
1922 uint32_t act_set_key;
1923
1924 //! The item in the name hashset.
1926
1927 //! The item in the localized hashset.
1929};
1930
1931/*!
1932 * The reference-counted data of an action.
1933 *
1934 * One or more sessions may still need this data after the application destroys
1935 * its XrAction handle, so this data is refcounted.
1936 *
1937 * @ingroup oxr_input
1938 *
1939 * @see oxr_action
1940 * @extends oxr_refcounted
1941 */
1943{
1944 struct oxr_refcounted base;
1945
1946 //! Application supplied name of this action.
1947 char name[XR_MAX_ACTION_NAME_SIZE];
1948
1949 //! Unique key for the session hashmap.
1950 uint32_t act_key;
1951
1952 //! Type this action was created with.
1953 XrActionType action_type;
1954
1955 //! Which sub action paths that this action was created with.
1957};
1958
1959/*!
1960 * A single action.
1961 *
1962 * Parent type/handle is @ref oxr_action_set
1963 *
1964 * For actual usage, an action is attached to a session: the corresponding data
1965 * is in @ref oxr_action_attachment
1966 *
1967 * @ingroup oxr_input
1968 *
1969 * @obj{XrAction}
1970 * @extends oxr_handle_base
1971 */
1973{
1974 //! Common structure for things referred to by OpenXR handles.
1976
1977 //! Owner of this action.
1979
1980 //! The data for this action that must live as long as any session we
1981 //! are attached to.
1983
1984 /*!
1985 * Unique key for the session hashmap.
1986 *
1987 * Duplicated from oxr_action_ref::act_key for efficiency.
1988 */
1989 uint32_t act_key;
1990
1991 //! The item in the name hashset.
1993
1994 //! The item in the localized hashset.
1996};
1997
1998/*!
1999 * Debug object created by the client program.
2000 *
2001 * Parent type/handle is @ref oxr_instance
2002 *
2003 * @obj{XrDebugUtilsMessengerEXT}
2004 */
2006{
2007 //! Common structure for things referred to by OpenXR handles.
2009
2010 //! Owner of this messenger.
2012
2013 //! Severities to submit to this messenger
2014 XrDebugUtilsMessageSeverityFlagsEXT message_severities;
2015
2016 //! Types to submit to this messenger
2017 XrDebugUtilsMessageTypeFlagsEXT message_types;
2018
2019 //! Callback function
2020 PFN_xrDebugUtilsMessengerCallbackEXT user_callback;
2021
2022 //! Opaque user data
2023 void *XR_MAY_ALIAS user_data;
2024};
2025
2026#ifdef OXR_HAVE_FB_passthrough
2027
2028struct oxr_passthrough
2029{
2030 struct oxr_handle_base handle;
2031
2032 struct oxr_session *sess;
2033
2034 XrPassthroughFlagsFB flags;
2035
2036 bool paused;
2037};
2038
2039struct oxr_passthrough_layer
2040{
2041 struct oxr_handle_base handle;
2042
2043 struct oxr_session *sess;
2044
2045 XrPassthroughFB passthrough;
2046
2047 XrPassthroughFlagsFB flags;
2048
2049 XrPassthroughLayerPurposeFB purpose;
2050
2051 bool paused;
2052
2053 XrPassthroughStyleFB style;
2054 XrPassthroughColorMapMonoToRgbaFB monoToRgba;
2055 XrPassthroughColorMapMonoToMonoFB monoToMono;
2056 XrPassthroughBrightnessContrastSaturationFB brightnessContrastSaturation;
2057};
2058
2059XrResult
2060oxr_passthrough_create(struct oxr_logger *log,
2061 struct oxr_session *sess,
2062 const XrPassthroughCreateInfoFB *createInfo,
2063 struct oxr_passthrough **out_passthrough);
2064
2065XrResult
2066oxr_passthrough_layer_create(struct oxr_logger *log,
2067 struct oxr_session *sess,
2068 const XrPassthroughLayerCreateInfoFB *createInfo,
2069 struct oxr_passthrough_layer **out_layer);
2070
2071static inline XrPassthroughFB
2072oxr_passthrough_to_openxr(struct oxr_passthrough *passthrough)
2073{
2074 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPassthroughFB, passthrough);
2075}
2076
2077static inline XrPassthroughLayerFB
2078oxr_passthrough_layer_to_openxr(struct oxr_passthrough_layer *passthroughLayer)
2079{
2080 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPassthroughLayerFB, passthroughLayer);
2081}
2082
2083XrResult
2084oxr_event_push_XrEventDataPassthroughStateChangedFB(struct oxr_logger *log,
2085 struct oxr_session *sess,
2086 XrPassthroughStateChangedFlagsFB flags);
2087
2088#endif // OXR_HAVE_FB_passthrough
2089
2090#ifdef OXR_HAVE_HTC_facial_tracking
2091/*!
2092 * HTC specific Facial tracker.
2093 *
2094 * Parent type/handle is @ref oxr_instance
2095 *
2096 *
2097 * @obj{XrFacialTrackerHTC}
2098 * @extends oxr_handle_base
2099 */
2100struct oxr_facial_tracker_htc
2101{
2102 //! Common structure for things referred to by OpenXR handles.
2103 struct oxr_handle_base handle;
2104
2105 //! Owner of this face tracker.
2106 struct oxr_session *sess;
2107
2108 //! xrt_device backing this face tracker
2109 struct xrt_device *xdev;
2110
2111 //! Type of facial tracking, eyes or lips
2112 enum xrt_facial_tracking_type_htc facial_tracking_type;
2113
2114 //! To track if the feature set has been incremented since creation.
2115 bool feature_incremented;
2116};
2117
2118XrResult
2119oxr_facial_tracker_htc_create(struct oxr_logger *log,
2120 struct oxr_session *sess,
2121 const XrFacialTrackerCreateInfoHTC *createInfo,
2122 struct oxr_facial_tracker_htc **out_face_tracker_htc);
2123
2124XrResult
2125oxr_get_facial_expressions_htc(struct oxr_logger *log,
2126 struct oxr_facial_tracker_htc *facial_tracker_htc,
2127 XrFacialExpressionsHTC *facialExpressions);
2128#endif
2129
2130#ifdef OXR_HAVE_FB_body_tracking
2131/*!
2132 * FB specific Body tracker.
2133 *
2134 * Parent type/handle is @ref oxr_instance
2135 *
2136 * @obj{XrBodyTrackerFB}
2137 * @extends oxr_handle_base
2138 */
2139struct oxr_body_tracker_fb
2140{
2141 //! Common structure for things referred to by OpenXR handles.
2142 struct oxr_handle_base handle;
2143
2144 //! Owner of this face tracker.
2145 struct oxr_session *sess;
2146
2147 //! xrt_device backing this face tracker
2148 struct xrt_device *xdev;
2149
2150 //! Type of the body joint set e.g. XR_FB_body_tracking or XR_META_body_tracking_full_body
2151 enum xrt_body_joint_set_type_fb joint_set_type;
2152};
2153
2154XrResult
2155oxr_create_body_tracker_fb(struct oxr_logger *log,
2156 struct oxr_session *sess,
2157 const XrBodyTrackerCreateInfoFB *createInfo,
2158 struct oxr_body_tracker_fb **out_body_tracker_fb);
2159
2160XrResult
2161oxr_get_body_skeleton_fb(struct oxr_logger *log,
2162 struct oxr_body_tracker_fb *body_tracker_fb,
2163 XrBodySkeletonFB *skeleton);
2164
2165XrResult
2166oxr_locate_body_joints_fb(struct oxr_logger *log,
2167 struct oxr_body_tracker_fb *body_tracker_fb,
2168 struct oxr_space *base_spc,
2169 const XrBodyJointsLocateInfoFB *locateInfo,
2170 XrBodyJointLocationsFB *locations);
2171#endif
2172
2173#ifdef OXR_HAVE_BD_body_tracking
2174/*!
2175 * BD (PICO) specific Body tracker.
2176 *
2177 * Parent type/handle is @ref oxr_session
2178 *
2179 * @obj{XrBodyTrackerBD}
2180 * @extends oxr_handle_base
2181 */
2182struct oxr_body_tracker_bd
2183{
2184 //! Common structure for things referred to by OpenXR handles.
2185 struct oxr_handle_base handle;
2186
2187 //! Owner of this body tracker.
2188 struct oxr_session *sess;
2189
2190 //! xrt_device backing this body tracker
2191 struct xrt_device *xdev;
2192
2193 //! Type of the body joint set (with or without arms)
2194 enum xrt_body_joint_set_type_bd joint_set_type;
2195};
2196
2197XrResult
2198oxr_create_body_tracker_bd(struct oxr_logger *log,
2199 struct oxr_session *sess,
2200 const XrBodyTrackerCreateInfoBD *createInfo,
2201 struct oxr_body_tracker_bd **out_body_tracker_bd);
2202
2203XrResult
2204oxr_locate_body_joints_bd(struct oxr_logger *log,
2205 struct oxr_body_tracker_bd *body_tracker_bd,
2206 struct oxr_space *base_spc,
2207 const XrBodyJointsLocateInfoBD *locateInfo,
2208 XrBodyJointLocationsBD *locations);
2209
2210bool
2211oxr_system_get_body_tracking_bd_support(struct oxr_logger *log, struct oxr_instance *inst);
2212#endif
2213
2214#ifdef OXR_HAVE_FB_face_tracking2
2215/*!
2216 * FB specific Face tracker2.
2217 *
2218 * Parent type/handle is @ref oxr_instance
2219 *
2220 * @obj{XrFaceTracker2FB}
2221 * @extends oxr_handle_base
2222 */
2223struct oxr_face_tracker2_fb
2224{
2225 //! Common structure for things referred to by OpenXR handles.
2226 struct oxr_handle_base handle;
2227
2228 //! Owner of this face tracker.
2229 struct oxr_session *sess;
2230
2231 //! xrt_device backing this face tracker
2232 struct xrt_device *xdev;
2233
2234 bool audio_enabled;
2235 bool visual_enabled;
2236
2237 //! To track if the feature set has been incremented since creation.
2238 bool feature_incremented;
2239};
2240
2241XrResult
2242oxr_face_tracker2_fb_create(struct oxr_logger *log,
2243 struct oxr_session *sess,
2244 const XrFaceTrackerCreateInfo2FB *createInfo,
2245 struct oxr_face_tracker2_fb **out_face_tracker2_fb);
2246
2247XrResult
2248oxr_get_face_expression_weights2_fb(struct oxr_logger *log,
2249 struct oxr_face_tracker2_fb *face_tracker2_fb,
2250 const XrFaceExpressionInfo2FB *expression_info,
2251 XrFaceExpressionWeights2FB *expression_weights);
2252#endif
2253
2254#ifdef OXR_HAVE_MNDX_xdev_space
2255/*!
2256 * Object that holds a list of the current @ref xrt_devices.
2257 *
2258 * Parent type/handle is @ref oxr_session
2259 *
2260 * @obj{XrXDevList}
2261 * @extends oxr_handle_base
2262 */
2263struct oxr_xdev_list
2264{
2265 //! Common structure for things referred to by OpenXR handles.
2266 struct oxr_handle_base handle;
2267
2268 //! Owner of this @ref xrt_device list.
2269 struct oxr_session *sess;
2270
2271 //! Monotonically increasing number.
2272 uint64_t generation_number;
2273
2274 uint64_t ids[XRT_SYSTEM_MAX_DEVICES];
2275 struct xrt_device *xdevs[XRT_SYSTEM_MAX_DEVICES];
2277
2278 //! Counts ids, names and xdevs.
2279 uint32_t device_count;
2280};
2281#endif // OXR_HAVE_MNDX_xdev_space
2282
2283#ifdef OXR_HAVE_EXT_plane_detection
2284/*!
2285 * A Plane Detector.
2286 *
2287 * Parent type/handle is @ref oxr_session
2288 *
2289 *
2290 * @obj{XrPlaneDetectorEXT}
2291 * @extends oxr_handle_base
2292 */
2293struct oxr_plane_detector_ext
2294{
2295 //! Common structure for things referred to by OpenXR handles.
2296 struct oxr_handle_base handle;
2297
2298 //! Owner of this anchor.
2299 struct oxr_session *sess;
2300
2301 //! Plane detector flags.
2303
2304 //! The last known state of this plane detector.
2305 XrPlaneDetectionStateEXT state;
2306
2307 //! Whether the last DONE plane detection has been retrieved from the xdev.
2308 bool retrieved;
2309
2310 //! The device that this plane detector belongs to.
2311 struct xrt_device *xdev;
2312
2313 //! Detected planes. xrt_plane_detector_locations_ext::relation is kept in xdev space and not updated.
2314 struct xrt_plane_detections_ext detections;
2315
2316 //! Corresponds to xrt_plane_detections_ext::locations, but with OpenXR types and transformed into target space.
2317 //! Enables two call idiom.
2318 XrPlaneDetectorLocationEXT *xr_locations;
2319
2320 //! A globally unique id for the current plane detection or 0, generated by the xrt_device.
2321 uint64_t detection_id;
2322};
2323#endif // OXR_HAVE_EXT_plane_detection
2324
2325#ifdef OXR_HAVE_EXT_future
2326/*!
2327 * EXT futures.
2328 *
2329 * Parent type/handle is @ref oxr_instance
2330 *
2331 * @obj{XrFutureEXT}
2332 * @extends oxr_handle_base
2333 */
2334struct oxr_future_ext
2335{
2336 //! Common structure for things referred to by OpenXR handles.
2337 struct oxr_handle_base handle;
2338
2339 //! (weak) reference to instance (may or not be a direct parent handle")
2340 struct oxr_instance *inst;
2341
2342 //! Owning session.
2343 struct oxr_session *sess;
2344
2345 //! xrt_future backing this future
2346 struct xrt_future *xft;
2347};
2348
2349/*!
2350 * To go back to a OpenXR object.
2351 *
2352 * @relates oxr_future_ext
2353 */
2354static inline XrFutureEXT
2355oxr_future_ext_to_openxr(struct oxr_future_ext *future_ext)
2356{
2357 return XRT_CAST_PTR_TO_OXR_HANDLE(XrFutureEXT, future_ext);
2358}
2359
2360XrResult
2361oxr_future_create(struct oxr_logger *log,
2362 struct oxr_session *sess,
2363 struct xrt_future *xft,
2364 struct oxr_handle_parent_base *parent_handle,
2365 struct oxr_future_ext **out_oxr_future_ext);
2366
2367XrResult
2368oxr_future_invalidate(struct oxr_logger *log, struct oxr_future_ext *oxr_future);
2369
2370XrResult
2371oxr_future_ext_poll(struct oxr_logger *log, const struct oxr_future_ext *oxr_future, XrFuturePollResultEXT *pollResult);
2372
2373XrResult
2374oxr_future_ext_cancel(struct oxr_logger *log, struct oxr_future_ext *oxr_future);
2375
2376XrResult
2377oxr_future_ext_complete(struct oxr_logger *log,
2378 struct oxr_future_ext *oxr_future,
2379 struct xrt_future_result *out_ft_result);
2380
2381#endif
2382
2383#ifdef OXR_HAVE_EXT_user_presence
2384XrResult
2385oxr_event_push_XrEventDataUserPresenceChangedEXT(struct oxr_logger *log, struct oxr_session *sess, bool isUserPresent);
2386#endif // OXR_HAVE_EXT_user_presence
2387
2388#ifdef OXR_HAVE_ANDROID_face_tracking
2389/*!
2390 * Android specific Facial tracker.
2391 *
2392 * Parent type/handle is @ref oxr_instance
2393 *
2394 *
2395 * @obj{XrFaceTrackerANDROID}
2396 * @extends oxr_handle_base
2397 */
2398struct oxr_face_tracker_android
2399{
2400 //! Common structure for things referred to by OpenXR handles.
2401 struct oxr_handle_base handle;
2402
2403 //! Owner of this face tracker.
2404 struct oxr_session *sess;
2405
2406 //! xrt_device backing this face tracker
2407 struct xrt_device *xdev;
2408
2409 //! To track if the feature set has been incremented since creation.
2410 bool feature_incremented;
2411};
2412
2413XrResult
2414oxr_face_tracker_android_create(struct oxr_logger *log,
2415 struct oxr_session *sess,
2416 const XrFaceTrackerCreateInfoANDROID *createInfo,
2417 XrFaceTrackerANDROID *faceTracker);
2418
2419XrResult
2421 struct oxr_face_tracker_android *facial_tracker_android,
2422 const XrFaceStateGetInfoANDROID *getInfo,
2423 XrFaceStateANDROID *faceStateOutput);
2424
2425XrResult
2426oxr_get_face_calibration_state_android(struct oxr_logger *log,
2427 struct oxr_face_tracker_android *facial_tracker_android,
2428 XrBool32 *faceIsCalibratedOutput);
2429#endif // OXR_HAVE_ANDROID_face_tracking
2430
2431/*!
2432 * @}
2433 */
2434
2435
2436#ifdef __cplusplus
2437}
2438#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:400
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:368
static XrResult oxr_session_success_result(struct oxr_session *session)
Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate.
Definition oxr_objects.h:1427
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:1442
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:1766
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:575
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:1040
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:1676
struct oxr_session_attached_actions * attached_actions
The session attached actions this action attachment belongs to.
Definition oxr_objects.h:1684
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:1694
struct oxr_action_ref * act_ref
This action's refcounted data.
Definition oxr_objects.h:1681
struct oxr_action_set_attachment * act_set_attached
The owning action set attachment.
Definition oxr_objects.h:1678
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:1687
The set of inputs/outputs for a single sub-action path for an action.
Definition oxr_objects.h:1654
A input action pair of a xrt_input and a xrt_device, along with the required transform.
Definition oxr_objects.h:1615
A output action pair of a xrt_output_name and a xrt_device.
Definition oxr_objects.h:1634
The reference-counted data of an action.
Definition oxr_objects.h:1943
struct oxr_subaction_paths subaction_paths
Which sub action paths that this action was created with.
Definition oxr_objects.h:1956
XrActionType action_type
Type this action was created with.
Definition oxr_objects.h:1953
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:1950
The data associated with the attachment of an Action Set (oxr_action_set) to as Session (oxr_session)...
Definition oxr_objects.h:1557
struct oxr_session_action_context * sess_context
Owning session action context.
Definition oxr_objects.h:1559
struct oxr_action_attachment * act_attachments
An array of action attachments we own.
Definition oxr_objects.h:1571
struct oxr_action_set_ref * act_set_ref
Action set refcounted data.
Definition oxr_objects.h:1562
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1565
size_t action_attachment_count
Length of oxr_action_set_attachment::act_attachments.
Definition oxr_objects.h:1576
struct oxr_subaction_paths requested_subaction_paths
Which sub-action paths are requested on the latest sync.
Definition oxr_objects.h:1568
The reference-counted data of an action set.
Definition oxr_objects.h:1862
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1875
bool ever_attached
Has this action set even been attached to any session, marking it as immutable.
Definition oxr_objects.h:1872
uint32_t priority
Application supplied action set priority.
Definition oxr_objects.h:1878
A group of actions.
Definition oxr_objects.h:1900
struct oxr_instance_action_context * inst_context
Reference to the instance action context (reference-counted).
Definition oxr_objects.h:1908
struct u_hashset_item * name_item
The item in the name hashset.
Definition oxr_objects.h:1925
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition oxr_objects.h:1928
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:1914
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1922
struct oxr_instance * inst
Owner of this action set.
Definition oxr_objects.h:1905
struct oxr_handle_parent_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1902
The state of a action input.
Definition oxr_objects.h:1589
bool active
Is this active (bound and providing input)?
Definition oxr_objects.h:1596
XrTime timestamp
When was this last changed.
Definition oxr_objects.h:1602
A single action.
Definition oxr_objects.h:1973
struct oxr_action_set * act_set
Owner of this action.
Definition oxr_objects.h:1978
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1975
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition oxr_objects.h:1995
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:1989
struct u_hashset_item * name_item
The item in the name hashset.
Definition oxr_objects.h:1992
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:1982
Interaction profile binding state.
Definition oxr_objects.h:1498
uint32_t * preferred_binding_path_index
store which entry in paths was suggested, for each action key
Definition oxr_objects.h:1510
const char * localized_name
Name presented to the user.
Definition oxr_objects.h:1503
Debug object created by the client program.
Definition oxr_objects.h:2006
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:2008
XrDebugUtilsMessageTypeFlagsEXT message_types
Types to submit to this messenger.
Definition oxr_objects.h:2017
PFN_xrDebugUtilsMessengerCallbackEXT user_callback
Callback function.
Definition oxr_objects.h:2020
struct oxr_instance * inst
Owner of this messenger.
Definition oxr_objects.h:2011
void *XR_MAY_ALIAS user_data
Opaque user data.
Definition oxr_objects.h:2023
XrDebugUtilsMessageSeverityFlagsEXT message_severities
Severities to submit to this messenger.
Definition oxr_objects.h:2014
dpad emulation settings from oxr_interaction_profile
Definition oxr_objects.h:1464
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_path_store path_store
Path store for managing paths.
Definition oxr_objects.h:1200
struct oxr_instance::@286 openxr_version
The OpenXR version requested in the app info. It determines the instance's OpenXR version.
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:1476
enum xrt_device_name xname
Used to lookup xrt_binding_profile for fallback.
Definition oxr_objects.h:1480
const char * localized_name
Name presented to the user.
Definition oxr_objects.h:1483
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:1409
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:1386
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:1404
struct os_precise_sleeper sleeper
Used to implement precise extra sleeping in wait frame.
Definition oxr_objects.h:1381
struct oxr_session_attached_actions attached_actions
Per-session map of action key to action attachment (thread-safe).
Definition oxr_objects.h:1391
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:1357
bool has_lost
initial relation of head in "global" space.
Definition oxr_objects.h:1418
float ipd_meters
IPD, to be expanded to a proper 3D relation.
Definition oxr_objects.h:1396
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:1401
Can be one of several reference space types, or a space that is bound to an action.
Definition oxr_objects.h:1744
struct oxr_subaction_paths subaction_paths
Which sub action path is this?
Definition oxr_objects.h:1761
enum oxr_space_type space_type
What kind of space is this?
Definition oxr_objects.h:1758
uint32_t act_key
Action key from which action this space was created from.
Definition oxr_objects.h:1755
struct xrt_pose pose
Pose that was given during creation.
Definition oxr_objects.h:1752
struct oxr_session * sess
Owner of this space.
Definition oxr_objects.h:1749
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1746
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:1787
struct oxr_session * sess
Owner of this swapchain.
Definition oxr_objects.h:1792
uint32_t face_count
The number of cubemap faces. 6 for cubemaps, 1 otherwise.
Definition oxr_objects.h:1804
struct xrt_swapchain * swapchain
Compositor swapchain.
Definition oxr_objects.h:1795
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1789
uint32_t width
Swapchain size.
Definition oxr_objects.h:1798
uint32_t array_layer_count
For 1 is 2D texture, greater then 1 2D array texture.
Definition oxr_objects.h:1801
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
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:318
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:188
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:206
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:277
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:215
A system is a collection of devices, policies and optionally a compositor that is organised into a ch...
Definition xrt_system.h:64
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.