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