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 //! Protects the sessions list @ref sessions_locked, taken before the event mutex.
1208 //! The session list, protected by @ref sessions_mutex
1210
1211 //! Path cache for actions, needs path_store to work.
1213
1214 //! Binding registry (reference-counted), shared by all action contexts of this instance.
1216
1217 //! The default action context (reference-counted). Owned by instance; action sets also hold references.
1219
1220 struct
1221 {
1222 struct
1223 {
1224 struct
1225 {
1226 uint32_t major;
1227 uint32_t minor;
1228 uint32_t patch;
1229 const char *name; //< Engine name, not freed.
1230 } engine;
1231 } detected;
1232 } appinfo;
1233
1234 struct
1235 {
1236 /*!
1237 * Some applications can't handle depth formats, or they trigger
1238 * a bug in a specific version of the application or engine.
1239 * This flag only disables depth formats
1240 * @see disable_vulkan_format_depth_stencil for depth-stencil formats.
1241 */
1243
1244 /*!
1245 * Some applications can't handle depth stencil formats, or they
1246 * trigger a bug in a specific version of the application or
1247 * engine.
1248 *
1249 * This flag only disables depth-stencil formats,
1250 * @see disable_vulkan_format_depth flag for depth only formats.
1251 *
1252 * In the past it was used to work around a bug in Unreal's
1253 * VulkanRHI backend.
1254 */
1256
1257 /*!
1258 * Disable the listing of quad views as a supported view config,
1259 * the extensions are still exposed.
1260 */
1262
1263 //! Unreal 4 has a bug calling xrEndSession; the function should just exit
1265
1266 /*!
1267 * Return XR_ERROR_REFERENCE_SPACE_UNSUPPORTED instead of
1268 * XR_ERROR_VALIDATION_FAILURE in xrCreateReferenceSpace.
1269 */
1271
1272 //! For applications that rely on views being parallel, notably some OpenVR games with OpenComposite.
1274
1275 //! For applications that use stage and don't offer recentering.
1277
1278 /*!
1279 * Beat Saber submits its projection layer with XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT set.
1280 * This breaks rendering because the game uses the alpha texture to store data for the bloom shader,
1281 * causing most of the game to render as black, only showing glowing parts of the image.
1282 */
1284
1285 /*!
1286 * Don't return XR_ERROR_VALIDATION_FAILURE if an
1287 * application sets unsupported usage flags when
1288 * calling xrCreateSwapchain.
1289 */
1291
1292 /*!
1293 * Don't return XR_ERROR_VALIDATION_FAILURE if an
1294 * application sets unsupported flags in XrCompositionLayer
1295 * when calling xrEndFrame.
1296 */
1298 } quirks;
1299
1300 //! Debug messengers
1301 struct oxr_debug_messenger *messengers[XRT_MAX_DEBUG_MESSENGERS];
1302
1303 bool lifecycle_verbose;
1304 bool debug_views;
1305 bool debug_spaces;
1306 bool debug_bindings;
1307
1308#ifdef XRT_FEATURE_RENDERDOC
1309 RENDERDOC_API_1_4_1 *rdoc_api;
1310#endif
1311
1312#ifdef XRT_OS_ANDROID
1313 enum xrt_android_lifecycle_event activity_state;
1314#endif // XRT_OS_ANDROID
1315};
1316
1317/*
1318 * This includes needs to be here because it has static inline functions that
1319 * de-references the oxr_instance object. This refactor was made mid-patchset
1320 * so doing too many changes to other files would have been really disruptive
1321 * but this include will be removed soon.
1322 */
1323#include "path/oxr_path_wrappers.h"
1324
1325
1326/*!
1327 * Object that client program interact with.
1328 *
1329 * Parent type/handle is @ref oxr_instance
1330 *
1331 * @obj{XrSession}
1332 * @extends oxr_handle_base
1333 */
1335{
1336 //! Common structure for things referred to by OpenXR handles.
1338 struct oxr_system *sys;
1339
1340 //! What graphics type was this session created with.
1342
1343 //! The @ref xrt_session backing this session.
1345
1346 //! Native compositor that is wrapped by client compositors.
1348
1349 struct xrt_compositor *compositor;
1350
1351 struct oxr_session *next;
1352
1353 XrSessionState state;
1354
1355 /*!
1356 * This is set in xrBeginSession and is the primaryViewConfiguration
1357 * argument, this is then used in xrEndFrame to know which view
1358 * configuration the application is submitting it's frame in.
1359 */
1360 XrViewConfigurationType current_view_config_type;
1361
1362 //! State of the head's XRT_INPUT_GENERIC_HEAD_DETECT input, for oxr_poll_event.
1364
1365 /*!
1366 * There is a extra state between xrBeginSession has been called and
1367 * the first xrEndFrame has been called. These are to track this.
1368 */
1370
1371 bool compositor_visible;
1372 bool compositor_focused;
1373
1374 // the number of xrWaitFrame calls that did not yet have a corresponding
1375 // xrEndFrame or xrBeginFrame (discarded frame) call
1376 int active_wait_frames;
1377 struct os_mutex active_wait_frames_lock;
1378
1379 bool frame_started;
1380 bool exiting;
1381
1382 struct
1383 {
1384 int64_t waited;
1385 int64_t begun;
1386 } frame_id;
1387
1388 struct oxr_frame_sync frame_sync;
1389
1390 /*!
1391 * Used to implement precise extra sleeping in wait frame.
1392 */
1394
1395 /*!
1396 * Holds all the action state that belongs on the session level.
1397 */
1399
1400 /*!
1401 * Per-session map of action key to action attachment (thread-safe).
1402 */
1404
1405 /*!
1406 * IPD, to be expanded to a proper 3D relation.
1407 */
1409
1410 /*!
1411 * Frame timing debug output.
1412 */
1414
1415 //! Extra sleep in wait frame.
1417
1418 /*!
1419 * To pipe swapchain creation to right code.
1420 */
1421 XrResult (*create_swapchain)(struct oxr_logger *,
1422 struct oxr_session *sess,
1423 const XrSwapchainCreateInfo *,
1424 struct oxr_swapchain **);
1425
1426 /*! initial relation of head in "global" space.
1427 * Used as reference for local space. */
1428 // struct xrt_space_relation local_space_pure_relation;
1429
1431};
1432
1433/*!
1434 * Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate.
1435 *
1436 * @public @memberof oxr_session
1437 */
1438static inline XrResult
1440{
1441 switch (session->state) {
1442 case XR_SESSION_STATE_LOSS_PENDING: return XR_SESSION_LOSS_PENDING;
1443 default: return XR_SUCCESS;
1444 }
1445}
1446
1447/*!
1448 * Returns XR_SUCCESS, XR_SESSION_LOSS_PENDING, or XR_SESSION_NOT_FOCUSED, as
1449 * appropriate.
1450 *
1451 * @public @memberof oxr_session
1452 */
1453static inline XrResult
1455{
1456 switch (session->state) {
1457 case XR_SESSION_STATE_LOSS_PENDING: return XR_SESSION_LOSS_PENDING;
1458 case XR_SESSION_STATE_FOCUSED: return XR_SUCCESS;
1459 default: return XR_SESSION_NOT_FOCUSED;
1460 }
1461}
1462
1463#ifdef OXR_HAVE_FB_display_refresh_rate
1464XrResult
1465oxr_session_get_display_refresh_rate(struct oxr_logger *log, struct oxr_session *sess, float *displayRefreshRate);
1466
1467XrResult
1468oxr_session_request_display_refresh_rate(struct oxr_logger *log, struct oxr_session *sess, float displayRefreshRate);
1469#endif // OXR_HAVE_FB_display_refresh_rate
1470
1471
1472/*!
1473 * @defgroup oxr_input OpenXR input
1474 * @ingroup oxr_main
1475 *
1476 * @brief The action-set/action-based input subsystem of OpenXR.
1477 *
1478 *
1479 * Action sets are created as children of the Instance, but are primarily used
1480 * with one or more Sessions. They may be used with multiple sessions at a time,
1481 * so we can't just put the per-session information directly in the action set
1482 * or action. Instead, we have the `_attachment `structures, which mirror the
1483 * action sets and actions but are rooted under the Session:
1484 *
1485 * - For every action set attached to a session, that session owns a @ref
1486 * oxr_action_set_attachment.
1487 * - For each action in those attached action sets, the action set attachment
1488 * owns an @ref oxr_action_attachment.
1489 *
1490 * We go from the public handle to the `_attachment` structure by using a `key`
1491 * value and a hash map: specifically, we look up the
1492 * oxr_action_set::act_set_key and oxr_action::act_key in the session.
1493 *
1494 * ![](monado-input-class-relationships.drawio.svg)
1495 */
1496
1497/*!
1498 * The data associated with the attachment of an Action Set (@ref
1499 * oxr_action_set) to as Session (@ref oxr_session).
1500 *
1501 * This structure has no pointer to the @ref oxr_action_set that created it
1502 * because the application is allowed to destroy an action before the session,
1503 * which should change nothing except not allow the application to use the
1504 * corresponding data anymore.
1505 *
1506 * @ingroup oxr_input
1507 *
1508 * @see oxr_action_set
1509 */
1511{
1512 //! Owning session action context.
1514
1515 //! Action set refcounted data
1517
1518 //! Unique key for the session hashmap.
1519 uint32_t act_set_key;
1520
1521 //! Which sub-action paths are requested on the latest sync.
1523
1524 /*!
1525 * Effective action-set priority from the latest xrSyncActions.
1526 *
1527 * Reset to @ref oxr_action_set_ref::priority at the start of each
1528 * successful focused sync, then overwritten only for action sets in that
1529 * sync's active list (including XR_EXT_active_action_set_priority
1530 * overrides). Used after sync, for example when enumerating bound
1531 * sources, to apply the same priority suppression as input combining.
1532 */
1534
1535 //! An array of action attachments we own.
1537
1538 /*!
1539 * Length of @ref oxr_action_set_attachment::act_attachments.
1540 */
1542};
1543
1544
1545
1546/*!
1547 * The state of a action input.
1548 *
1549 * @ingroup oxr_input
1550 *
1551 * @see oxr_action_attachment
1552 */
1554{
1555 /*!
1556 * The actual value - must interpret using action type
1557 */
1558 union xrt_input_value value;
1559
1560 //! Is this active (bound and providing input)?
1562
1563 // Was this changed.
1564 bool changed;
1565
1566 //! When was this last changed.
1568};
1569
1570/*!
1571 * A resolved input binding for an action, along with the required transform.
1572 *
1573 * @ingroup oxr_input
1574 *
1575 * @see oxr_io_cache
1576 * @see xrt_input
1577 */
1579{
1580 //! Cache this input is resolved against (owned by the action context).
1581 const struct oxr_io_cache *io_cache;
1582 //! Device this input reads from.
1584 //! The resolved input, pointing into @ref oxr_io_cache::inputs.
1586 const struct oxr_binding_point *binding_point;
1587 struct oxr_priority_group_state *priority_group_state;
1588 struct oxr_input_transform *transforms;
1589 size_t transform_count;
1590};
1591
1592/*!
1593 * A output action pair of a @ref xrt_output_name and a @ref xrt_device.
1594 *
1595 * @ingroup oxr_input
1596 *
1597 * @see xrt_device
1598 * @see xrt_output_name
1599 */
1601{
1602 //! Cache this output is resolved against (owned by the action context).
1603 const struct oxr_io_cache *io_cache;
1604 //! Device this output routes to.
1606 enum xrt_output_name name;
1607 const struct oxr_binding_point *binding_point;
1608};
1609
1610
1611/*!
1612 * The set of inputs/outputs for a single sub-action path for an action.
1613 *
1614 * Each @ref oxr_action_attachment has one of these for every known sub-action
1615 * path in the spec. Many, or even most, will be "empty".
1616 *
1617 * A single action will either be input or output, not both.
1618 *
1619 * @ingroup oxr_input
1620 *
1621 * @see oxr_action_attachment
1622 */
1624{
1625 struct oxr_action_state current;
1626
1627 size_t input_count;
1628 struct oxr_action_input *inputs;
1629
1630 int64_t stop_output_time;
1631 size_t output_count;
1632 struct oxr_action_output *outputs;
1633};
1634
1635/*!
1636 * Data associated with an Action that has been attached to a Session.
1637 *
1638 * More information on the action vs action attachment and action set vs action
1639 * set attachment parallel is in the docs for @ref oxr_input
1640 *
1641 * @ingroup oxr_input
1642 *
1643 * @see oxr_action
1644 */
1646{
1647 //! The owning action set attachment
1649
1650 //! This action's refcounted data
1652
1653 //! The session attached actions this action attachment belongs to.
1655
1656 //! Unique key for the session hashmap.
1657 uint32_t act_key;
1658
1659 /*!
1660 * For pose actions any subaction paths are special treated, at bind
1661 * time we pick one subaction path and stick to it as long as the action
1662 * lives.
1663 */
1665
1666 struct oxr_action_state any_state;
1667
1668#define OXR_CACHE_MEMBER(X) struct oxr_action_cache X;
1669 OXR_FOR_EACH_SUBACTION_PATH(OXR_CACHE_MEMBER)
1670#undef OXR_CACHE_MEMBER
1671};
1672
1673/*!
1674 * @}
1675 */
1676
1677
1678static inline bool
1679oxr_space_type_is_reference(enum oxr_space_type space_type)
1680{
1681 switch (space_type) {
1682 case OXR_SPACE_TYPE_REFERENCE_VIEW:
1683 case OXR_SPACE_TYPE_REFERENCE_LOCAL:
1684 case OXR_SPACE_TYPE_REFERENCE_LOCAL_FLOOR:
1685 case OXR_SPACE_TYPE_REFERENCE_STAGE:
1686 case OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_MSFT:
1687 case OXR_SPACE_TYPE_REFERENCE_COMBINED_EYE_VARJO:
1688 case OXR_SPACE_TYPE_REFERENCE_LOCALIZATION_MAP_ML:
1689 case OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_ANDROID:
1690 case OXR_SPACE_TYPE_REFERENCE_STATIONARY_EXT:
1691 // These are reference spaces.
1692 return true;
1693
1694 case OXR_SPACE_TYPE_ACTION:
1695 case OXR_SPACE_TYPE_XDEV_POSE:
1696 // These are not reference spaces.
1697 return false;
1698 }
1699
1700 // Handles invalid value.
1701 return false;
1702}
1703
1704
1705/*!
1706 * Can be one of several reference space types, or a space that is bound to an
1707 * action.
1708 *
1709 * Parent type/handle is @ref oxr_session
1710 *
1711 * @obj{XrSpace}
1712 * @extends oxr_handle_base
1713 */
1715{
1716 //! Common structure for things referred to by OpenXR handles.
1718
1719 //! Owner of this space.
1721
1722 //! Pose that was given during creation.
1724
1725 //! Action key from which action this space was created from.
1726 uint32_t act_key;
1727
1728 //! What kind of space is this?
1730
1731 //! Which sub action path is this?
1733
1734 struct
1735 {
1736 struct xrt_space *xs;
1737 struct xrt_device_id device_id;
1738 enum xrt_input_name name;
1739
1740 bool feature_eye_tracking;
1741 } action;
1742
1743 struct
1744 {
1745 struct xrt_space *xs;
1746 } xdev_pose;
1747};
1748
1749/*!
1750 * A set of images used for rendering.
1751 *
1752 * Parent type/handle is @ref oxr_session
1753 *
1754 * @obj{XrSwapchain}
1755 * @extends oxr_handle_base
1756 */
1758{
1759 //! Common structure for things referred to by OpenXR handles.
1761
1762 //! Owner of this swapchain.
1764
1765 //! Compositor swapchain.
1767
1768 //! Swapchain size.
1769 uint32_t width, height;
1770
1771 //! For 1 is 2D texture, greater then 1 2D array texture.
1773
1774 //! The number of cubemap faces. 6 for cubemaps, 1 otherwise.
1775 uint32_t face_count;
1776
1777 struct
1778 {
1779 enum oxr_image_state state;
1780 } images[XRT_MAX_SWAPCHAIN_IMAGES];
1781
1782 struct
1783 {
1784 size_t num;
1785 struct u_index_fifo fifo;
1786 } acquired;
1787
1788 struct
1789 {
1790 bool yes;
1791 int index;
1792 } inflight; // This is the image that the app is working on.
1793
1794 struct
1795 {
1796 bool yes;
1797 int index;
1798 } released;
1799
1800 // Is this a static swapchain, needed for acquire semantics.
1801 bool is_static;
1802
1803
1804 XrResult (*destroy)(struct oxr_logger *, struct oxr_swapchain *);
1805
1806 XrResult (*enumerate_images)(struct oxr_logger *,
1807 struct oxr_swapchain *,
1808 uint32_t,
1809 XrSwapchainImageBaseHeader *);
1810
1811 XrResult (*acquire_image)(struct oxr_logger *,
1812 struct oxr_swapchain *,
1813 const XrSwapchainImageAcquireInfo *,
1814 uint32_t *);
1815
1816 XrResult (*wait_image)(struct oxr_logger *, struct oxr_swapchain *, const XrSwapchainImageWaitInfo *);
1817
1818 XrResult (*release_image)(struct oxr_logger *, struct oxr_swapchain *, const XrSwapchainImageReleaseInfo *);
1819};
1820
1821/*!
1822 * The reference-counted data of an action set.
1823 *
1824 * One or more sessions may still need this data after the application destroys
1825 * its XrActionSet handle, so this data is refcounted.
1826 *
1827 * @ingroup oxr_input
1828 *
1829 * @see oxr_action_set
1830 * @extends oxr_refcounted
1831 */
1833{
1834 struct oxr_refcounted base;
1835
1836 //! Application supplied name of this action.
1837 char name[XR_MAX_ACTION_SET_NAME_SIZE];
1838
1839 /*!
1840 * Has this action set even been attached to any session, marking it as
1841 * immutable.
1842 */
1844
1845 //! Unique key for the session hashmap.
1846 uint32_t act_set_key;
1847
1848 //! Application supplied action set priority.
1849 uint32_t priority;
1850
1851 struct oxr_pair_hashset actions;
1852
1853 struct oxr_subaction_paths permitted_subaction_paths;
1854};
1855
1856/*!
1857 * A group of actions.
1858 *
1859 * Parent type/handle is @ref oxr_instance
1860 *
1861 * Note, however, that an action set must be "attached" to a session
1862 * ( @ref oxr_session ) to be used and not just configured.
1863 * The corresponding data is in @ref oxr_action_set_attachment.
1864 *
1865 * @ingroup oxr_input
1866 *
1867 * @obj{XrActionSet}
1868 * @extends oxr_handle_base
1869 */
1871{
1872 //! Common structure for things referred to by OpenXR handles.
1874
1875 //! Owner of this action set.
1877
1878 //! Reference to the instance action context (reference-counted).
1880
1881 /*!
1882 * The data for this action set that must live as long as any session we
1883 * are attached to.
1884 */
1886
1887
1888 /*!
1889 * Unique key for the session hashmap.
1890 *
1891 * Duplicated from oxr_action_set_ref::act_set_key for efficiency.
1892 */
1893 uint32_t act_set_key;
1894
1895 //! The item in the name hashset.
1897
1898 //! The item in the localized hashset.
1900};
1901
1902/*!
1903 * The reference-counted data of an action.
1904 *
1905 * One or more sessions may still need this data after the application destroys
1906 * its XrAction handle, so this data is refcounted.
1907 *
1908 * @ingroup oxr_input
1909 *
1910 * @see oxr_action
1911 * @extends oxr_refcounted
1912 */
1914{
1915 struct oxr_refcounted base;
1916
1917 //! Application supplied name of this action.
1918 char name[XR_MAX_ACTION_NAME_SIZE];
1919
1920 //! Unique key for the session hashmap.
1921 uint32_t act_key;
1922
1923 //! Type this action was created with.
1924 XrActionType action_type;
1925
1926 //! Which sub action paths that this action was created with.
1928};
1929
1930/*!
1931 * A single action.
1932 *
1933 * Parent type/handle is @ref oxr_action_set
1934 *
1935 * For actual usage, an action is attached to a session: the corresponding data
1936 * is in @ref oxr_action_attachment
1937 *
1938 * @ingroup oxr_input
1939 *
1940 * @obj{XrAction}
1941 * @extends oxr_handle_base
1942 */
1944{
1945 //! Common structure for things referred to by OpenXR handles.
1947
1948 //! Owner of this action.
1950
1951 //! The data for this action that must live as long as any session we
1952 //! are attached to.
1954
1955 /*!
1956 * Unique key for the session hashmap.
1957 *
1958 * Duplicated from oxr_action_ref::act_key for efficiency.
1959 */
1960 uint32_t act_key;
1961
1962 //! The item in the name hashset.
1964
1965 //! The item in the localized hashset.
1967};
1968
1969/*!
1970 * Debug object created by the client program.
1971 *
1972 * Parent type/handle is @ref oxr_instance
1973 *
1974 * @obj{XrDebugUtilsMessengerEXT}
1975 */
1977{
1978 //! Common structure for things referred to by OpenXR handles.
1980
1981 //! Owner of this messenger.
1983
1984 //! Severities to submit to this messenger
1985 XrDebugUtilsMessageSeverityFlagsEXT message_severities;
1986
1987 //! Types to submit to this messenger
1988 XrDebugUtilsMessageTypeFlagsEXT message_types;
1989
1990 //! Callback function
1991 PFN_xrDebugUtilsMessengerCallbackEXT user_callback;
1992
1993 //! Opaque user data
1994 void *XR_MAY_ALIAS user_data;
1995};
1996
1997#ifdef OXR_HAVE_FB_passthrough
1998
1999struct oxr_passthrough
2000{
2001 struct oxr_handle_base handle;
2002
2003 struct oxr_session *sess;
2004
2005 XrPassthroughFlagsFB flags;
2006
2007 bool paused;
2008};
2009
2010struct oxr_passthrough_layer
2011{
2012 struct oxr_handle_base handle;
2013
2014 struct oxr_session *sess;
2015
2016 XrPassthroughFB passthrough;
2017
2018 XrPassthroughFlagsFB flags;
2019
2020 XrPassthroughLayerPurposeFB purpose;
2021
2022 bool paused;
2023
2024 XrPassthroughStyleFB style;
2025 XrPassthroughColorMapMonoToRgbaFB monoToRgba;
2026 XrPassthroughColorMapMonoToMonoFB monoToMono;
2027 XrPassthroughBrightnessContrastSaturationFB brightnessContrastSaturation;
2028};
2029
2030XrResult
2031oxr_passthrough_create(struct oxr_logger *log,
2032 struct oxr_session *sess,
2033 const XrPassthroughCreateInfoFB *createInfo,
2034 struct oxr_passthrough **out_passthrough);
2035
2036XrResult
2037oxr_passthrough_layer_create(struct oxr_logger *log,
2038 struct oxr_session *sess,
2039 const XrPassthroughLayerCreateInfoFB *createInfo,
2040 struct oxr_passthrough_layer **out_layer);
2041
2042static inline XrPassthroughFB
2043oxr_passthrough_to_openxr(struct oxr_passthrough *passthrough)
2044{
2045 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPassthroughFB, passthrough);
2046}
2047
2048static inline XrPassthroughLayerFB
2049oxr_passthrough_layer_to_openxr(struct oxr_passthrough_layer *passthroughLayer)
2050{
2051 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPassthroughLayerFB, passthroughLayer);
2052}
2053
2054XrResult
2055oxr_event_push_XrEventDataPassthroughStateChangedFB(struct oxr_logger *log,
2056 struct oxr_session *sess,
2057 XrPassthroughStateChangedFlagsFB flags);
2058
2059#endif // OXR_HAVE_FB_passthrough
2060
2061#ifdef OXR_HAVE_HTC_facial_tracking
2062/*!
2063 * HTC specific Facial tracker.
2064 *
2065 * Parent type/handle is @ref oxr_instance
2066 *
2067 *
2068 * @obj{XrFacialTrackerHTC}
2069 * @extends oxr_handle_base
2070 */
2071struct oxr_facial_tracker_htc
2072{
2073 //! Common structure for things referred to by OpenXR handles.
2074 struct oxr_handle_base handle;
2075
2076 //! Owner of this face tracker.
2077 struct oxr_session *sess;
2078
2079 //! xrt_device backing this face tracker
2080 struct xrt_device *xdev;
2081
2082 //! Type of facial tracking, eyes or lips
2083 enum xrt_facial_tracking_type_htc facial_tracking_type;
2084
2085 //! To track if the feature set has been incremented since creation.
2086 bool feature_incremented;
2087};
2088
2089XrResult
2090oxr_facial_tracker_htc_create(struct oxr_logger *log,
2091 struct oxr_session *sess,
2092 const XrFacialTrackerCreateInfoHTC *createInfo,
2093 struct oxr_facial_tracker_htc **out_face_tracker_htc);
2094
2095XrResult
2096oxr_get_facial_expressions_htc(struct oxr_logger *log,
2097 struct oxr_facial_tracker_htc *facial_tracker_htc,
2098 XrFacialExpressionsHTC *facialExpressions);
2099#endif
2100
2101#ifdef OXR_HAVE_FB_body_tracking
2102/*!
2103 * FB specific Body tracker.
2104 *
2105 * Parent type/handle is @ref oxr_instance
2106 *
2107 * @obj{XrBodyTrackerFB}
2108 * @extends oxr_handle_base
2109 */
2110struct oxr_body_tracker_fb
2111{
2112 //! Common structure for things referred to by OpenXR handles.
2113 struct oxr_handle_base handle;
2114
2115 //! Owner of this face tracker.
2116 struct oxr_session *sess;
2117
2118 //! xrt_body_tracker backing this body tracker
2119 struct xrt_body_tracker *xbt;
2120
2121 //! Type of the body joint set e.g. XR_FB_body_tracking or XR_META_body_tracking_full_body
2122 enum xrt_body_joint_set_type_fb joint_set_type;
2123};
2124
2125XrResult
2126oxr_create_body_tracker_fb(struct oxr_logger *log,
2127 struct oxr_session *sess,
2128 const XrBodyTrackerCreateInfoFB *createInfo,
2129 struct oxr_body_tracker_fb **out_body_tracker_fb);
2130
2131XrResult
2132oxr_get_body_skeleton_fb(struct oxr_logger *log,
2133 struct oxr_body_tracker_fb *body_tracker_fb,
2134 XrBodySkeletonFB *skeleton);
2135
2136XrResult
2137oxr_locate_body_joints_fb(struct oxr_logger *log,
2138 struct oxr_body_tracker_fb *body_tracker_fb,
2139 struct oxr_space *base_spc,
2140 const XrBodyJointsLocateInfoFB *locateInfo,
2141 XrBodyJointLocationsFB *locations);
2142#endif
2143
2144#ifdef OXR_HAVE_BD_body_tracking
2145/*!
2146 * BD (PICO) specific Body tracker.
2147 *
2148 * Parent type/handle is @ref oxr_session
2149 *
2150 * @obj{XrBodyTrackerBD}
2151 * @extends oxr_handle_base
2152 */
2153struct oxr_body_tracker_bd
2154{
2155 //! Common structure for things referred to by OpenXR handles.
2156 struct oxr_handle_base handle;
2157
2158 //! Owner of this body tracker.
2159 struct oxr_session *sess;
2160
2161 //! xrt_body_tracker backing this body tracker
2162 struct xrt_body_tracker *xbt;
2163
2164 //! Type of the body joint set (with or without arms)
2165 enum xrt_body_joint_set_type_bd joint_set_type;
2166};
2167
2168XrResult
2169oxr_create_body_tracker_bd(struct oxr_logger *log,
2170 struct oxr_session *sess,
2171 const XrBodyTrackerCreateInfoBD *createInfo,
2172 struct oxr_body_tracker_bd **out_body_tracker_bd);
2173
2174XrResult
2175oxr_locate_body_joints_bd(struct oxr_logger *log,
2176 struct oxr_body_tracker_bd *body_tracker_bd,
2177 struct oxr_space *base_spc,
2178 const XrBodyJointsLocateInfoBD *locateInfo,
2179 XrBodyJointLocationsBD *locations);
2180
2181bool
2182oxr_system_get_body_tracking_bd_support(struct oxr_logger *log, struct oxr_instance *inst);
2183#endif
2184
2185#ifdef OXR_HAVE_FB_face_tracking2
2186/*!
2187 * FB specific Face tracker2.
2188 *
2189 * Parent type/handle is @ref oxr_instance
2190 *
2191 * @obj{XrFaceTracker2FB}
2192 * @extends oxr_handle_base
2193 */
2194struct oxr_face_tracker2_fb
2195{
2196 //! Common structure for things referred to by OpenXR handles.
2197 struct oxr_handle_base handle;
2198
2199 //! Owner of this face tracker.
2200 struct oxr_session *sess;
2201
2202 //! xrt_device backing this face tracker
2203 struct xrt_device *xdev;
2204
2205 bool audio_enabled;
2206 bool visual_enabled;
2207
2208 //! To track if the feature set has been incremented since creation.
2209 bool feature_incremented;
2210};
2211
2212XrResult
2213oxr_face_tracker2_fb_create(struct oxr_logger *log,
2214 struct oxr_session *sess,
2215 const XrFaceTrackerCreateInfo2FB *createInfo,
2216 struct oxr_face_tracker2_fb **out_face_tracker2_fb);
2217
2218XrResult
2219oxr_get_face_expression_weights2_fb(struct oxr_logger *log,
2220 struct oxr_face_tracker2_fb *face_tracker2_fb,
2221 const XrFaceExpressionInfo2FB *expression_info,
2222 XrFaceExpressionWeights2FB *expression_weights);
2223#endif
2224
2225#ifdef OXR_HAVE_MNDX_xdev_space
2226/*!
2227 * Object that holds a list of the current @ref xrt_devices.
2228 *
2229 * Parent type/handle is @ref oxr_session
2230 *
2231 * @obj{XrXDevList}
2232 * @extends oxr_handle_base
2233 */
2234struct oxr_xdev_list
2235{
2236 //! Common structure for things referred to by OpenXR handles.
2237 struct oxr_handle_base handle;
2238
2239 //! Owner of this @ref xrt_device list.
2240 struct oxr_session *sess;
2241
2242 //! Monotonically increasing number.
2243 uint64_t generation_number;
2244
2245 uint64_t ids[XRT_SYSTEM_MAX_DEVICES];
2246 struct xrt_device *xdevs[XRT_SYSTEM_MAX_DEVICES];
2248
2249 //! Counts ids, names and xdevs.
2250 uint32_t device_count;
2251};
2252#endif // OXR_HAVE_MNDX_xdev_space
2253
2254#ifdef OXR_HAVE_EXT_plane_detection
2255/*!
2256 * A Plane Detector.
2257 *
2258 * Parent type/handle is @ref oxr_session
2259 *
2260 *
2261 * @obj{XrPlaneDetectorEXT}
2262 * @extends oxr_handle_base
2263 */
2264struct oxr_plane_detector_ext
2265{
2266 //! Common structure for things referred to by OpenXR handles.
2267 struct oxr_handle_base handle;
2268
2269 //! Owner of this anchor.
2270 struct oxr_session *sess;
2271
2272 //! Plane detector flags.
2274
2275 //! The last known state of this plane detector.
2276 XrPlaneDetectionStateEXT state;
2277
2278 //! Whether the last DONE plane detection has been retrieved from the xdev.
2279 bool retrieved;
2280
2281 //! The device that this plane detector belongs to.
2282 struct xrt_device *xdev;
2283
2284 //! Detected planes. xrt_plane_detector_locations_ext::relation is kept in xdev space and not updated.
2285 struct xrt_plane_detections_ext detections;
2286
2287 //! Corresponds to xrt_plane_detections_ext::locations, but with OpenXR types and transformed into target space.
2288 //! Enables two call idiom.
2289 XrPlaneDetectorLocationEXT *xr_locations;
2290
2291 //! A globally unique id for the current plane detection or 0, generated by the xrt_device.
2292 uint64_t detection_id;
2293};
2294#endif // OXR_HAVE_EXT_plane_detection
2295
2296#ifdef OXR_HAVE_EXT_future
2297/*!
2298 * EXT futures.
2299 *
2300 * Parent type/handle is @ref oxr_instance
2301 *
2302 * @obj{XrFutureEXT}
2303 * @extends oxr_handle_base
2304 */
2305struct oxr_future_ext
2306{
2307 //! Common structure for things referred to by OpenXR handles.
2308 struct oxr_handle_base handle;
2309
2310 //! (weak) reference to instance (may or not be a direct parent handle")
2311 struct oxr_instance *inst;
2312
2313 //! Owning session.
2314 struct oxr_session *sess;
2315
2316 //! xrt_future backing this future
2317 struct xrt_future *xft;
2318};
2319
2320/*!
2321 * To go back to a OpenXR object.
2322 *
2323 * @relates oxr_future_ext
2324 */
2325static inline XrFutureEXT
2326oxr_future_ext_to_openxr(struct oxr_future_ext *future_ext)
2327{
2328 return XRT_CAST_PTR_TO_OXR_HANDLE(XrFutureEXT, future_ext);
2329}
2330
2331XrResult
2332oxr_future_create(struct oxr_logger *log,
2333 struct oxr_session *sess,
2334 struct xrt_future *xft,
2335 struct oxr_handle_parent_base *parent_handle,
2336 struct oxr_future_ext **out_oxr_future_ext);
2337
2338XrResult
2339oxr_future_invalidate(struct oxr_logger *log, struct oxr_future_ext *oxr_future);
2340
2341XrResult
2342oxr_future_ext_poll(struct oxr_logger *log, const struct oxr_future_ext *oxr_future, XrFuturePollResultEXT *pollResult);
2343
2344XrResult
2345oxr_future_ext_cancel(struct oxr_logger *log, struct oxr_future_ext *oxr_future);
2346
2347XrResult
2348oxr_future_ext_complete(struct oxr_logger *log,
2349 struct oxr_future_ext *oxr_future,
2350 struct xrt_future_result *out_ft_result);
2351
2352#endif
2353
2354#ifdef OXR_HAVE_EXT_user_presence
2355XrResult
2356oxr_event_push_XrEventDataUserPresenceChangedEXT(struct oxr_logger *log, struct oxr_session *sess, bool isUserPresent);
2357#endif // OXR_HAVE_EXT_user_presence
2358
2359#ifdef OXR_HAVE_ANDROID_face_tracking
2360/*!
2361 * Android specific Facial tracker.
2362 *
2363 * Parent type/handle is @ref oxr_instance
2364 *
2365 *
2366 * @obj{XrFaceTrackerANDROID}
2367 * @extends oxr_handle_base
2368 */
2369struct oxr_face_tracker_android
2370{
2371 //! Common structure for things referred to by OpenXR handles.
2372 struct oxr_handle_base handle;
2373
2374 //! Owner of this face tracker.
2375 struct oxr_session *sess;
2376
2377 //! xrt_device backing this face tracker
2378 struct xrt_device *xdev;
2379
2380 //! To track if the feature set has been incremented since creation.
2381 bool feature_incremented;
2382};
2383
2384XrResult
2385oxr_face_tracker_android_create(struct oxr_logger *log,
2386 struct oxr_session *sess,
2387 const XrFaceTrackerCreateInfoANDROID *createInfo,
2388 XrFaceTrackerANDROID *faceTracker);
2389
2390XrResult
2392 struct oxr_face_tracker_android *facial_tracker_android,
2393 const XrFaceStateGetInfoANDROID *getInfo,
2394 XrFaceStateANDROID *faceStateOutput);
2395
2396XrResult
2397oxr_get_face_calibration_state_android(struct oxr_logger *log,
2398 struct oxr_face_tracker_android *facial_tracker_android,
2399 XrBool32 *faceIsCalibratedOutput);
2400#endif // OXR_HAVE_ANDROID_face_tracking
2401
2402/*!
2403 * @}
2404 */
2405
2406
2407#ifdef __cplusplus
2408}
2409#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:1439
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:1454
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:1767
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:232
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
XRT_CHECK_RESULT XrResult oxr_system_poll(struct oxr_logger *log, struct oxr_system *sys)
Definition oxr_system.c:1148
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:418
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:961
xrt_output_name
Name of a output with a baked in type.
Definition xrt_defines.h:1645
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:279
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:1646
struct oxr_session_attached_actions * attached_actions
The session attached actions this action attachment belongs to.
Definition oxr_objects.h:1654
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:1664
struct oxr_action_ref * act_ref
This action's refcounted data.
Definition oxr_objects.h:1651
struct oxr_action_set_attachment * act_set_attached
The owning action set attachment.
Definition oxr_objects.h:1648
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:1657
The set of inputs/outputs for a single sub-action path for an action.
Definition oxr_objects.h:1624
A resolved input binding for an action, along with the required transform.
Definition oxr_objects.h:1579
const struct oxr_io_cache * io_cache
Cache this input is resolved against (owned by the action context).
Definition oxr_objects.h:1581
struct xrt_input * input
The resolved input, pointing into oxr_io_cache::inputs.
Definition oxr_objects.h:1585
struct xrt_device_id device_id
Device this input reads from.
Definition oxr_objects.h:1583
A output action pair of a xrt_output_name and a xrt_device.
Definition oxr_objects.h:1601
struct xrt_device_id device_id
Device this output routes to.
Definition oxr_objects.h:1605
const struct oxr_io_cache * io_cache
Cache this output is resolved against (owned by the action context).
Definition oxr_objects.h:1603
The reference-counted data of an action.
Definition oxr_objects.h:1914
struct oxr_subaction_paths subaction_paths
Which sub action paths that this action was created with.
Definition oxr_objects.h:1927
XrActionType action_type
Type this action was created with.
Definition oxr_objects.h:1924
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:1921
The data associated with the attachment of an Action Set (oxr_action_set) to as Session (oxr_session)...
Definition oxr_objects.h:1511
struct oxr_session_action_context * sess_context
Owning session action context.
Definition oxr_objects.h:1513
struct oxr_action_attachment * act_attachments
An array of action attachments we own.
Definition oxr_objects.h:1536
struct oxr_action_set_ref * act_set_ref
Action set refcounted data.
Definition oxr_objects.h:1516
uint32_t last_sync_priority
Effective action-set priority from the latest xrSyncActions.
Definition oxr_objects.h:1533
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1519
size_t action_attachment_count
Length of oxr_action_set_attachment::act_attachments.
Definition oxr_objects.h:1541
struct oxr_subaction_paths requested_subaction_paths
Which sub-action paths are requested on the latest sync.
Definition oxr_objects.h:1522
The reference-counted data of an action set.
Definition oxr_objects.h:1833
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1846
bool ever_attached
Has this action set even been attached to any session, marking it as immutable.
Definition oxr_objects.h:1843
uint32_t priority
Application supplied action set priority.
Definition oxr_objects.h:1849
A group of actions.
Definition oxr_objects.h:1871
struct oxr_instance_action_context * inst_context
Reference to the instance action context (reference-counted).
Definition oxr_objects.h:1879
struct u_hashset_item * name_item
The item in the name hashset.
Definition oxr_objects.h:1896
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition oxr_objects.h:1899
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:1885
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1893
struct oxr_instance * inst
Owner of this action set.
Definition oxr_objects.h:1876
struct oxr_handle_parent_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1873
The state of a action input.
Definition oxr_objects.h:1554
bool active
Is this active (bound and providing input)?
Definition oxr_objects.h:1561
XrTime timestamp
When was this last changed.
Definition oxr_objects.h:1567
A single action.
Definition oxr_objects.h:1944
struct oxr_action_set * act_set
Owner of this action.
Definition oxr_objects.h:1949
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1946
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition oxr_objects.h:1966
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:1960
struct u_hashset_item * name_item
The item in the name hashset.
Definition oxr_objects.h:1963
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:1953
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:1977
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1979
XrDebugUtilsMessageTypeFlagsEXT message_types
Types to submit to this messenger.
Definition oxr_objects.h:1988
PFN_xrDebugUtilsMessengerCallbackEXT user_callback
Callback function.
Definition oxr_objects.h:1991
struct oxr_instance * inst
Owner of this messenger.
Definition oxr_objects.h:1982
void *XR_MAY_ALIAS user_data
Opaque user data.
Definition oxr_objects.h:1994
XrDebugUtilsMessageSeverityFlagsEXT message_severities
Severities to submit to this messenger.
Definition oxr_objects.h:1985
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:1242
bool parallel_views
For applications that rely on views being parallel, notably some OpenVR games with OpenComposite.
Definition oxr_objects.h:1273
struct oxr_path_store path_store
Path store for managing paths.
Definition oxr_objects.h:1196
struct oxr_instance::@293 openxr_version
The OpenXR version requested in the app info. It determines the instance's OpenXR version.
bool disable_vulkan_format_depth_stencil
Some applications can't handle depth stencil formats, or they trigger a bug in a specific version of ...
Definition oxr_objects.h:1255
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:1264
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:1218
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:1270
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:1212
bool disable_quad_views
Disable the listing of quad views as a supported view config, the extensions are still exposed.
Definition oxr_objects.h:1261
struct oxr_debug_messenger * messengers[256]
Debug messengers.
Definition oxr_objects.h:1301
struct os_mutex sessions_mutex
Protects the sessions list sessions_locked, taken before the event mutex.
Definition oxr_objects.h:1207
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:1215
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:1290
bool map_stage_to_local_floor
For applications that use stage and don't offer recentering.
Definition oxr_objects.h:1276
bool no_layer_flags_bit_validation
Don't return XR_ERROR_VALIDATION_FAILURE if an application sets unsupported flags in XrCompositionLay...
Definition oxr_objects.h:1297
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:1283
struct oxr_session * sessions_locked
The session list, protected by sessions_mutex.
Definition oxr_objects.h:1209
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:1335
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:1421
struct xrt_compositor_native * xcn
Native compositor that is wrapped by client compositors.
Definition oxr_objects.h:1347
struct oxr_session_action_context action_context
Holds all the action state that belongs on the session level.
Definition oxr_objects.h:1398
struct xrt_session * xs
The xrt_session backing this session.
Definition oxr_objects.h:1344
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:1360
uint32_t frame_timing_wait_sleep_ms
Extra sleep in wait frame.
Definition oxr_objects.h:1416
struct os_precise_sleeper sleeper
Used to implement precise extra sleeping in wait frame.
Definition oxr_objects.h:1393
bool presence
State of the head's XRT_INPUT_GENERIC_HEAD_DETECT input, for oxr_poll_event.
Definition oxr_objects.h:1363
struct oxr_session_attached_actions attached_actions
Per-session map of action key to action attachment (thread-safe).
Definition oxr_objects.h:1403
enum oxr_session_graphics_ext gfx_ext
What graphics type was this session created with.
Definition oxr_objects.h:1341
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:1369
bool has_lost
initial relation of head in "global" space.
Definition oxr_objects.h:1430
float ipd_meters
IPD, to be expanded to a proper 3D relation.
Definition oxr_objects.h:1408
struct oxr_handle_parent_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1337
bool frame_timing_spew
Frame timing debug output.
Definition oxr_objects.h:1413
Can be one of several reference space types, or a space that is bound to an action.
Definition oxr_objects.h:1715
struct oxr_subaction_paths subaction_paths
Which sub action path is this?
Definition oxr_objects.h:1732
enum oxr_space_type space_type
What kind of space is this?
Definition oxr_objects.h:1729
uint32_t act_key
Action key from which action this space was created from.
Definition oxr_objects.h:1726
struct xrt_pose pose
Pose that was given during creation.
Definition oxr_objects.h:1723
struct oxr_session * sess
Owner of this space.
Definition oxr_objects.h:1720
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1717
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:1758
struct oxr_session * sess
Owner of this swapchain.
Definition oxr_objects.h:1763
uint32_t face_count
The number of cubemap faces. 6 for cubemaps, 1 otherwise.
Definition oxr_objects.h:1775
struct xrt_swapchain * swapchain
Compositor swapchain.
Definition oxr_objects.h:1766
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1760
uint32_t width
Swapchain size.
Definition oxr_objects.h:1769
uint32_t array_layer_count
For 1 is 2D texture, greater then 1 2D array texture.
Definition oxr_objects.h:1772
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:2337
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:2226
Common compositor client interface/base.
Definition xrt_compositor.h:1054
A unique identifier for an xrt_device instance.
Definition xrt_device.h:47
A single HMD or input device.
Definition xrt_device.h:328
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:522
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:713
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:601
The system compositor handles composition for a system.
Definition xrt_compositor.h:2487
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:1570
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:2494
xrt_perf_domain
Domain type.
Definition xrt_defines.h:2467
xrt_view_type
View type to be rendered to by the compositor.
Definition xrt_defines.h:2453
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.