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