Monado OpenXR Runtime
oxr_objects.h
Go to the documentation of this file.
1// Copyright 2018-2024, Collabora, Ltd.
2// Copyright 2023-2026, NVIDIA CORPORATION.
3// SPDX-License-Identifier: BSL-1.0
4/*!
5 * @file
6 * @brief The objects representing OpenXR handles, and prototypes for internal functions used in the state tracker.
7 * @author Jakob Bornecrantz <jakob@collabora.com>
8 * @author Korcan Hussein <korcan.hussein@collabora.com>
9 * @ingroup oxr_main
10 */
11
12#pragma once
13
14#include "xrt/xrt_space.h"
15#include "xrt/xrt_limits.h"
16#include "xrt/xrt_system.h"
17#include "xrt/xrt_future.h"
18#include "xrt/xrt_device.h"
19#include "xrt/xrt_tracking.h"
20#include "xrt/xrt_compositor.h"
23#include "xrt/xrt_config_os.h"
24#include "xrt/xrt_config_have.h"
25
26#include "os/os_threading.h"
27
28#include "util/u_index_fifo.h"
29#include "util/u_hashset.h"
30#include "util/u_hashmap.h"
31#include "util/u_device.h"
32
33#include "oxr_extension_support.h"
34#include "oxr_subaction.h"
35#include "oxr_defines.h"
36#include "oxr_frame_sync.h"
37
38#if defined(XRT_HAVE_D3D11) || defined(XRT_HAVE_D3D12)
39#include <dxgi.h>
40#include <d3dcommon.h>
41#endif
42
43#ifdef XRT_FEATURE_RENDERDOC
44#include "renderdoc_app.h"
45#ifndef XRT_OS_WINDOWS
46#include <dlfcn.h>
47#endif // !XRT_OS_WINDOWS
48#endif // XRT_FEATURE_RENDERDOC
49
50#ifdef XRT_OS_ANDROID
51#include "xrt/xrt_android.h"
52#endif // #ifdef XRT_OS_ANDROID
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58
59/*!
60 * @defgroup oxr OpenXR state tracker
61 *
62 * Client application facing code.
63 *
64 * @ingroup xrt
65 */
66
67/*!
68 * @brief Cast a pointer to an OpenXR handle in such a way as to avoid warnings.
69 *
70 * Avoids -Wpointer-to-int-cast by first casting to the same size int, then
71 * promoting to the 64-bit int, then casting to the handle type. That's a lot of
72 * no-ops on 64-bit, but a widening conversion on 32-bit.
73 *
74 * @ingroup oxr
75 */
76#define XRT_CAST_PTR_TO_OXR_HANDLE(HANDLE_TYPE, PTR) ((HANDLE_TYPE)(uint64_t)(uintptr_t)(PTR))
77
78/*!
79 * @brief Cast an OpenXR handle to a pointer in such a way as to avoid warnings.
80 *
81 * Avoids -Wint-to-pointer-cast by first casting to a 64-bit int, then to a
82 * pointer-sized int, then to the desired pointer type. That's a lot of no-ops
83 * on 64-bit, but a narrowing (!) conversion on 32-bit.
84 *
85 * @ingroup oxr
86 */
87#define XRT_CAST_OXR_HANDLE_TO_PTR(PTR_TYPE, HANDLE) ((PTR_TYPE)(uintptr_t)(uint64_t)(HANDLE))
88
89/*!
90 * @defgroup oxr_main OpenXR main code
91 *
92 * Gets called from @ref oxr_api functions and talks to devices and
93 * @ref comp using @ref xrt_iface.
94 *
95 * @ingroup oxr
96 * @{
97 */
98
99
100/*
101 *
102 * Forward declare structs.
103 *
104 */
105
106struct xrt_instance;
107struct oxr_logger;
109struct oxr_instance;
110struct oxr_system;
111struct oxr_session;
112struct oxr_roles;
113struct oxr_event;
114struct oxr_swapchain;
115struct oxr_space;
116struct oxr_action_set;
117struct oxr_action;
119struct oxr_handle_base;
123struct oxr_action_input;
124struct oxr_action_output;
125struct oxr_dpad_state;
126struct oxr_binding;
128struct oxr_action_set_ref;
129struct oxr_action_ref;
130struct oxr_hand_tracker;
131struct oxr_face_tracker_android;
132struct oxr_facial_tracker_htc;
133struct oxr_face_tracker2_fb;
134struct oxr_body_tracker_fb;
135struct oxr_body_tracker_bd;
136struct oxr_xdev_list;
137struct oxr_plane_detector_ext;
138
139#define XRT_MAX_HANDLE_CHILDREN 256
140#define OXR_MAX_BINDINGS_PER_ACTION 32
141
142struct time_state;
143
144/*!
145 * Function pointer type for a handle destruction function.
146 *
147 * @relates oxr_handle_base
148 */
149typedef XrResult (*oxr_handle_destroyer)(struct oxr_logger *log, struct oxr_handle_base *hb);
150
151
152
153/*
154 *
155 * Helpers
156 *
157 */
158
159/*!
160 * Safely copy an xrt_pose to an XrPosef.
161 */
162#define OXR_XRT_POSE_TO_XRPOSEF(FROM, TO) \
163 do { \
164 union { \
165 struct xrt_pose xrt; \
166 XrPosef oxr; \
167 } safe_copy = {FROM}; \
168 TO = safe_copy.oxr; \
169 } while (false)
170
171/*!
172 * Safely copy an xrt_fov to an XrFovf.
173 */
174#define OXR_XRT_FOV_TO_XRFOVF(FROM, TO) \
175 do { \
176 union { \
177 struct xrt_fov xrt; \
178 XrFovf oxr; \
179 } safe_copy = {FROM}; \
180 TO = safe_copy.oxr; \
181 } while (false)
182
183
184static inline const char *
185xr_action_type_to_str(XrActionType type)
186{
187 // clang-format off
188 switch (type) {
189 #define PRINT(name, value) \
190 case name: return #name;
191 XR_LIST_ENUM_XrActionType(PRINT)
192 #undef PRINT
193 default: return "XR_ACTION_TYPE_UNKNOWN";
194 }
195 // clang-format on
196}
197
198/*
199 *
200 * oxr_handle_base.c
201 *
202 */
203
204/*!
205 * Destroy the handle's object, as well as all child handles recursively.
206 *
207 * This should be how all handle-associated objects are destroyed.
208 *
209 * @public @memberof oxr_handle_base
210 */
211XrResult
212oxr_handle_destroy(struct oxr_logger *log, struct oxr_handle_base *hb);
213
214/*!
215 * Returns a human-readable label for a handle state.
216 *
217 * @relates oxr_handle_base
218 */
219const char *
221
222/*!
223 *
224 * @name oxr_instance.c
225 * @{
226 *
227 */
228
229/*!
230 * To go back to a OpenXR object.
231 *
232 * @relates oxr_instance
233 */
234static inline XrInstance
236{
237 return XRT_CAST_PTR_TO_OXR_HANDLE(XrInstance, inst);
238}
239
240/*!
241 * Creates a instance, does minimal validation of @p createInfo.
242 *
243 * @param[in] log Logger
244 * @param[in] createInfo OpenXR creation info.
245 * @param[in] extensions Parsed extension list to be enabled.
246 * @param[out] out_inst Pointer to pointer to a instance, returned instance.
247 *
248 * @public @static @memberof oxr_instance
249 */
250XrResult
252 const XrInstanceCreateInfo *createInfo,
253 XrVersion major_minor,
254 const struct oxr_extension_status *extensions,
255 struct oxr_instance **out_inst);
256
257/*!
258 * Must be called with oxr_instance::system_init_lock held.
259 *
260 * @public @memberof oxr_instance
261 */
262XrResult
264
265/*!
266 * @public @memberof oxr_instance
267 */
268XrResult
269oxr_instance_get_properties(struct oxr_logger *log,
270 struct oxr_instance *inst,
271 XrInstanceProperties *instanceProperties);
272
273#if XR_USE_TIMESPEC
274
275/*!
276 * @public @memberof oxr_instance
277 */
278XrResult
279oxr_instance_convert_time_to_timespec(struct oxr_logger *log,
280 struct oxr_instance *inst,
281 XrTime time,
282 struct timespec *timespecTime);
283
284/*!
285 * @public @memberof oxr_instance
286 */
287XrResult
288oxr_instance_convert_timespec_to_time(struct oxr_logger *log,
289 struct oxr_instance *inst,
290 const struct timespec *timespecTime,
291 XrTime *time);
292#endif // XR_USE_TIMESPEC
293
294#ifdef XR_USE_PLATFORM_WIN32
295
296/*!
297 * @public @memberof oxr_instance
298 */
299XrResult
300oxr_instance_convert_time_to_win32perfcounter(struct oxr_logger *log,
301 struct oxr_instance *inst,
302 XrTime time,
303 LARGE_INTEGER *win32perfcounterTime);
304
305/*!
306 * @public @memberof oxr_instance
307 */
308XrResult
309oxr_instance_convert_win32perfcounter_to_time(struct oxr_logger *log,
310 struct oxr_instance *inst,
311 const LARGE_INTEGER *win32perfcounterTime,
312 XrTime *time);
313
314#endif // XR_USE_PLATFORM_WIN32
315
316/*!
317 * @}
318 */
319
320/*!
321 *
322 * @name oxr_path.c
323 * @{
324 *
325 */
326
327/*!
328 * Initialize the path system.
329 * @private @memberof oxr_instance
330 */
331XrResult
332oxr_path_init(struct oxr_logger *log, struct oxr_instance *inst);
333
334/*!
335 * @public @memberof oxr_instance
336 */
337bool
338oxr_path_is_valid(struct oxr_logger *log, struct oxr_instance *inst, XrPath path);
339
340/*!
341 * @public @memberof oxr_instance
342 */
343void *
344oxr_path_get_attached(struct oxr_logger *log, struct oxr_instance *inst, XrPath path);
345
346/*!
347 * Get the path for the given string if it exists, or create it if it does not.
348 *
349 * @public @memberof oxr_instance
350 */
351XrResult
353 struct oxr_logger *log, struct oxr_instance *inst, const char *str, size_t length, XrPath *out_path);
354
355/*!
356 * Only get the path for the given string if it exists.
357 *
358 * @public @memberof oxr_instance
359 */
360XrResult
361oxr_path_only_get(struct oxr_logger *log, struct oxr_instance *inst, const char *str, size_t length, XrPath *out_path);
362
363/*!
364 * Get a pointer and length of the internal string.
365 *
366 * The pointer has the same life time as the instance. The length is the number
367 * of valid characters, not including the null termination character (but an
368 * extra null byte is always reserved at the end so can strings can be given
369 * to functions expecting null terminated strings).
370 *
371 * @public @memberof oxr_instance
372 */
373XrResult
375 struct oxr_logger *log, const struct oxr_instance *inst, XrPath path, const char **out_str, size_t *out_length);
376
377/*!
378 * Destroy the path system and all paths that the instance has created.
379 *
380 * @private @memberof oxr_instance
381 */
382void
383oxr_path_destroy(struct oxr_logger *log, struct oxr_instance *inst);
384
385/*!
386 * @}
387 */
388
389/*!
390 * To go back to a OpenXR object.
391 *
392 * @relates oxr_action_set
393 */
394static inline XrActionSet
396{
397 return XRT_CAST_PTR_TO_OXR_HANDLE(XrActionSet, act_set);
398}
399
400/*!
401 * To go back to a OpenXR object.
402 *
403 * @relates oxr_hand_tracker
404 */
405static inline XrHandTrackerEXT
407{
408 return XRT_CAST_PTR_TO_OXR_HANDLE(XrHandTrackerEXT, hand_tracker);
409}
410
411#ifdef OXR_HAVE_EXT_plane_detection
412/*!
413 * To go back to a OpenXR object.
414 *
415 * @relates oxr_plane_detector
416 */
417static inline XrPlaneDetectorEXT
418oxr_plane_detector_to_openxr(struct oxr_plane_detector_ext *plane_detector)
419{
420 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPlaneDetectorEXT, plane_detector);
421}
422#endif // OXR_HAVE_EXT_plane_detection
423
424/*!
425 * To go back to a OpenXR object.
426 *
427 * @relates oxr_action
428 */
429static inline XrAction
431{
432 return XRT_CAST_PTR_TO_OXR_HANDLE(XrAction, act);
433}
434
435#ifdef OXR_HAVE_HTC_facial_tracking
436/*!
437 * To go back to a OpenXR object.
438 *
439 * @relates oxr_facial_tracker_htc
440 */
441static inline XrFacialTrackerHTC
442oxr_facial_tracker_htc_to_openxr(struct oxr_facial_tracker_htc *face_tracker_htc)
443{
444 return XRT_CAST_PTR_TO_OXR_HANDLE(XrFacialTrackerHTC, face_tracker_htc);
445}
446#endif
447
448#ifdef OXR_HAVE_FB_body_tracking
449/*!
450 * To go back to a OpenXR object.
451 *
452 * @relates oxr_facial_tracker_htc
453 */
454static inline XrBodyTrackerFB
455oxr_body_tracker_fb_to_openxr(struct oxr_body_tracker_fb *body_tracker_fb)
456{
457 return XRT_CAST_PTR_TO_OXR_HANDLE(XrBodyTrackerFB, body_tracker_fb);
458}
459#endif
460
461#ifdef OXR_HAVE_BD_body_tracking
462/*!
463 * To go back to a OpenXR object.
464 *
465 * @relates oxr_body_tracker_bd
466 */
467static inline XrBodyTrackerBD
468oxr_body_tracker_bd_to_openxr(struct oxr_body_tracker_bd *body_tracker_bd)
469{
470 return XRT_CAST_PTR_TO_OXR_HANDLE(XrBodyTrackerBD, body_tracker_bd);
471}
472#endif
473
474#ifdef OXR_HAVE_FB_face_tracking2
475/*!
476 * To go back to a OpenXR object.
477 *
478 * @relates oxr_face_tracker2_fb
479 */
480static inline XrFaceTracker2FB
481oxr_face_tracker2_fb_to_openxr(struct oxr_face_tracker2_fb *face_tracker2_fb)
482{
483 return XRT_CAST_PTR_TO_OXR_HANDLE(XrFaceTracker2FB, face_tracker2_fb);
484}
485#endif
486
487#ifdef OXR_HAVE_ANDROID_face_tracking
488/*!
489 * To go back to a OpenXR object.
490 *
491 * @relates oxr_facial_tracker_htc
492 */
493static inline XrFaceTrackerANDROID
494oxr_face_tracker_android_to_openxr(struct oxr_face_tracker_android *face_tracker_android)
495{
496 return XRT_CAST_PTR_TO_OXR_HANDLE(XrFaceTrackerANDROID, face_tracker_android);
497}
498#endif
499
500/*!
501 *
502 * @name oxr_input.c
503 * @{
504 *
505 */
506
507/*!
508 * Helper function to classify subaction_paths.
509 *
510 * Sets all members of @p subaction_paths ( @ref oxr_subaction_paths ) as
511 * appropriate based on the subaction paths found in the list.
512 *
513 * If no paths are provided, @p subaction_paths->any will be true.
514 *
515 * @return false if an invalid subaction path is provided.
516 *
517 * @public @memberof oxr_instance
518 * @see oxr_subaction_paths
519 */
520bool
522 const struct oxr_instance *inst,
523 uint32_t subaction_path_count,
524 const XrPath *subaction_paths,
525 struct oxr_subaction_paths *subaction_paths_out);
526
527/*!
528 * Find the pose input for the set of subaction_paths
529 *
530 * @public @memberof oxr_session
531 */
532XrResult
534 uint32_t act_key,
535 const struct oxr_subaction_paths *subaction_paths_ptr,
536 struct oxr_action_input **out_input);
537
538/*!
539 * @public @memberof oxr_instance
540 */
541XrResult
542oxr_action_set_create(struct oxr_logger *log,
543 struct oxr_instance *inst,
544 const XrActionSetCreateInfo *createInfo,
545 struct oxr_action_set **out_act_set);
546
547/*!
548 * @public @memberof oxr_action
549 */
550XrResult
551oxr_action_create(struct oxr_logger *log,
552 struct oxr_action_set *act_set,
553 const XrActionCreateInfo *createInfo,
554 struct oxr_action **out_act);
555
556/*!
557 * @public @memberof oxr_session
558 * @see oxr_action_set
559 */
560XrResult
562 struct oxr_session *sess,
563 const XrSessionActionSetsAttachInfo *bindInfo);
564
565
566XrResult
567oxr_session_update_action_bindings(struct oxr_logger *log, struct oxr_session *sess, const struct oxr_roles *roles);
568
569/*!
570 * Given an action act_key, look up the @ref oxr_action_attachment of
571 * the associated action in the given Session.
572 *
573 * @private @memberof oxr_session
574 */
575void
576oxr_session_get_action_attachment(struct oxr_session *sess,
577 uint32_t act_key,
578 struct oxr_action_attachment **out_act_attached);
579
580/*!
581 * @public @memberof oxr_session
582 */
583XrResult
585 struct oxr_session *sess,
586 uint32_t countActionSets,
587 const XrActiveActionSet *actionSets,
588 const XrActiveActionSetPrioritiesEXT *activePriorities);
589
590/*!
591 * @public @memberof oxr_session
592 */
593XrResult
594oxr_action_enumerate_bound_sources(struct oxr_logger *log,
595 struct oxr_session *sess,
596 uint32_t act_key,
597 uint32_t sourceCapacityInput,
598 uint32_t *sourceCountOutput,
599 XrPath *sources);
600
601/*!
602 * @public @memberof oxr_session
603 */
604XrResult
605oxr_action_get_boolean(struct oxr_logger *log,
606 struct oxr_session *sess,
607 uint32_t act_key,
608 struct oxr_subaction_paths subaction_paths,
609 XrActionStateBoolean *data);
610
611/*!
612 * @public @memberof oxr_session
613 */
614XrResult
615oxr_action_get_vector1f(struct oxr_logger *log,
616 struct oxr_session *sess,
617 uint32_t act_key,
618 struct oxr_subaction_paths subaction_paths,
619 XrActionStateFloat *data);
620
621/*!
622 * @public @memberof oxr_session
623 */
624XrResult
625oxr_action_get_vector2f(struct oxr_logger *log,
626 struct oxr_session *sess,
627 uint32_t act_key,
628 struct oxr_subaction_paths subaction_paths,
629 XrActionStateVector2f *data);
630/*!
631 * @public @memberof oxr_session
632 */
633XrResult
634oxr_action_get_pose(struct oxr_logger *log,
635 struct oxr_session *sess,
636 uint32_t act_key,
637 struct oxr_subaction_paths subaction_paths,
638 XrActionStatePose *data);
639/*!
640 * @public @memberof oxr_session
641 */
642XrResult
643oxr_action_apply_haptic_feedback(struct oxr_logger *log,
644 struct oxr_session *sess,
645 uint32_t act_key,
646 struct oxr_subaction_paths subaction_paths,
647 const XrHapticBaseHeader *hapticEvent);
648/*!
649 * @public @memberof oxr_session
650 */
651XrResult
652oxr_action_stop_haptic_feedback(struct oxr_logger *log,
653 struct oxr_session *sess,
654 uint32_t act_key,
655 struct oxr_subaction_paths subaction_paths);
656
657/*!
658 * @}
659 */
660
661/*!
662 *
663 * @name oxr_binding.c
664 * @{
665 *
666 */
667
668/*!
669 * Find the best matching profile for the given @ref xrt_device.
670 *
671 * @param log Logger.
672 * @param sess Session.
673 * @param xdev Can be null.
674 * @param[out] out_p Returned interaction profile.
675 *
676 * @public @memberof oxr_session
677 */
678void
680 struct oxr_session *sess,
681 struct xrt_device *xdev,
682 struct oxr_interaction_profile **out_p);
683
684bool
685oxr_get_profile_for_device_name(struct oxr_logger *log,
686 struct oxr_session *sess,
687 enum xrt_device_name name,
688 struct oxr_interaction_profile **out_p);
689
691oxr_clone_profile(const struct oxr_interaction_profile *src_profile);
692
693/*!
694 * Free all memory allocated by the binding system.
695 *
696 * @public @memberof oxr_instance
697 */
698void
699oxr_binding_destroy_all(struct oxr_logger *log, struct oxr_instance *inst);
700
701/*!
702 * Free all memory allocated by the binding system.
703 *
704 * @public @memberof oxr_instance
705 */
706void
708
709/*!
710 * Find all bindings that is the given action key is bound to.
711 * @public @memberof oxr_interaction_profile
712 */
713void
715 struct oxr_interaction_profile *profile,
716 uint32_t key,
717 size_t max_binding_count,
718 struct oxr_binding **out_bindings,
719 size_t *out_binding_count);
720
721/*!
722 * @public @memberof oxr_instance
723 */
724XrResult
725oxr_action_suggest_interaction_profile_bindings(struct oxr_logger *log,
726 struct oxr_instance *inst,
727 const XrInteractionProfileSuggestedBinding *suggestedBindings,
728 struct oxr_dpad_state *state);
729
730/*!
731 * @public @memberof oxr_instance
732 */
733XrResult
734oxr_action_get_current_interaction_profile(struct oxr_logger *log,
735 struct oxr_session *sess,
736 XrPath topLevelUserPath,
737 XrInteractionProfileState *interactionProfile);
738
739/*!
740 * @public @memberof oxr_session
741 */
742XrResult
744 struct oxr_session *sess,
745 const XrInputSourceLocalizedNameGetInfo *getInfo,
746 uint32_t bufferCapacityInput,
747 uint32_t *bufferCountOutput,
748 char *buffer);
749
750/*!
751 * @}
752 */
753
754
755/*!
756 *
757 * @name oxr_dpad.c
758 * @{
759 *
760 */
761
762/*!
763 * Initialises a dpad state, has to be zero init before a call to this function.
764 *
765 * @public @memberof oxr_dpad_state_get
766 */
767bool
768oxr_dpad_state_init(struct oxr_dpad_state *state);
769
770/*!
771 * Look for a entry in the state for the given action set key,
772 * returns NULL if no entry has been made for that action set.
773 *
774 * @public @memberof oxr_dpad_state_get
775 */
776struct oxr_dpad_entry *
777oxr_dpad_state_get(struct oxr_dpad_state *state, uint64_t key);
778
779/*!
780 * Look for a entry in the state for the given action set key,
781 * allocates a new entry if none was found.
782 *
783 * @public @memberof oxr_dpad_state_get
784 */
785struct oxr_dpad_entry *
786oxr_dpad_state_get_or_add(struct oxr_dpad_state *state, uint64_t key);
787
788/*!
789 * Frees all state and entries attached to this dpad state.
790 *
791 * @public @memberof oxr_dpad_state_get
792 */
793void
794oxr_dpad_state_deinit(struct oxr_dpad_state *state);
795
796/*!
797 * Clones all oxr_dpad_state
798 * @param dst_dpad_state destination of cloning
799 * @param src_dpad_state source of cloning
800 * @public @memberof oxr_dpad_state_clone
801 */
802bool
803oxr_dpad_state_clone(struct oxr_dpad_state *dst_dpad_state, const struct oxr_dpad_state *src_dpad_state);
804
805
806/*!
807 * @}
808 */
809
810
811/*!
812 *
813 * @name oxr_session.c
814 * @{
815 *
816 */
817
818/*!
819 * To go back to a OpenXR object.
820 *
821 * @relates oxr_session
822 */
823static inline XrSession
825{
826 return XRT_CAST_PTR_TO_OXR_HANDLE(XrSession, sess);
827}
828
829XrResult
830oxr_session_create(struct oxr_logger *log,
831 struct oxr_system *sys,
832 const XrSessionCreateInfo *createInfo,
833 struct oxr_session **out_session);
834
835XrResult
836oxr_session_enumerate_formats(struct oxr_logger *log,
837 struct oxr_session *sess,
838 uint32_t formatCapacityInput,
839 uint32_t *formatCountOutput,
840 int64_t *formats);
841
842/*!
843 * Change the state of the session, queues a event.
844 */
845void
846oxr_session_change_state(struct oxr_logger *log, struct oxr_session *sess, XrSessionState state, XrTime time);
847
848XrResult
849oxr_session_begin(struct oxr_logger *log, struct oxr_session *sess, const XrSessionBeginInfo *beginInfo);
850
851XrResult
852oxr_session_end(struct oxr_logger *log, struct oxr_session *sess);
853
854XrResult
855oxr_session_request_exit(struct oxr_logger *log, struct oxr_session *sess);
856
857XRT_CHECK_RESULT XrResult
858oxr_session_poll(struct oxr_logger *log, struct oxr_session *sess);
859
860XrResult
861oxr_session_locate_views(struct oxr_logger *log,
862 struct oxr_session *sess,
863 const XrViewLocateInfo *viewLocateInfo,
864 XrViewState *viewState,
865 uint32_t viewCapacityInput,
866 uint32_t *viewCountOutput,
867 XrView *views);
868
869XrResult
870oxr_session_frame_wait(struct oxr_logger *log, struct oxr_session *sess, XrFrameState *frameState);
871
872XrResult
873oxr_session_frame_begin(struct oxr_logger *log, struct oxr_session *sess);
874
875XrResult
876oxr_session_frame_end(struct oxr_logger *log, struct oxr_session *sess, const XrFrameEndInfo *frameEndInfo);
877
878/*
879 * Gets the body pose in the base space.
880 */
881XrResult
882oxr_get_base_body_pose(struct oxr_logger *log,
883 const struct xrt_body_joint_set *body_joint_set,
884 struct oxr_space *base_spc,
885 struct xrt_device *body_xdev,
886 XrTime at_time,
887 struct xrt_space_relation *out_base_body);
888
889#ifdef OXR_HAVE_KHR_android_thread_settings
890XrResult
891oxr_session_android_thread_settings(struct oxr_logger *log,
892 struct oxr_session *sess,
893 XrAndroidThreadTypeKHR threadType,
894 uint32_t threadId);
895#endif // OXR_HAVE_KHR_android_thread_settings
896
897#ifdef OXR_HAVE_KHR_visibility_mask
898XrResult
899oxr_session_get_visibility_mask(struct oxr_logger *log,
900 struct oxr_session *session,
901 XrVisibilityMaskTypeKHR visibilityMaskType,
902 uint32_t viewIndex,
903 XrVisibilityMaskKHR *visibilityMask);
904
905XrResult
906oxr_event_push_XrEventDataVisibilityMaskChangedKHR(struct oxr_logger *log,
907 struct oxr_session *sess,
908 XrViewConfigurationType viewConfigurationType,
909 uint32_t viewIndex);
910#endif // OXR_HAVE_KHR_visibility_mask
911
912#ifdef OXR_HAVE_EXT_performance_settings
913XrResult
914oxr_session_set_perf_level(struct oxr_logger *log,
915 struct oxr_session *sess,
916 XrPerfSettingsDomainEXT domain,
917 XrPerfSettingsLevelEXT level);
918#endif // OXR_HAVE_EXT_performance_settings
919
920/*
921 *
922 * oxr_space.c
923 *
924 */
925
926/*!
927 * To go back to a OpenXR object.
928 */
929static inline XrSpace
931{
932 return XRT_CAST_PTR_TO_OXR_HANDLE(XrSpace, spc);
933}
934
935XrResult
936oxr_space_action_create(struct oxr_logger *log,
937 struct oxr_session *sess,
938 uint32_t key,
939 const XrActionSpaceCreateInfo *createInfo,
940 struct oxr_space **out_space);
941
942XrResult
943oxr_space_get_reference_bounds_rect(struct oxr_logger *log,
944 struct oxr_session *sess,
945 XrReferenceSpaceType referenceSpaceType,
946 XrExtent2Df *bounds);
947
948XrResult
949oxr_space_reference_create(struct oxr_logger *log,
950 struct oxr_session *sess,
951 const XrReferenceSpaceCreateInfo *createInfo,
952 struct oxr_space **out_space);
953
954/*!
955 * Monado special space that always points to a specific @ref xrt_device and
956 * pose, useful when you want to bypass the action binding system for instance.
957 */
958XrResult
960 struct oxr_session *sess,
961 struct xrt_device *xdev,
962 enum xrt_input_name name,
963 const struct xrt_pose *pose,
964 struct oxr_space **out_space);
965
966XrResult
968 struct oxr_logger *log, struct oxr_space *spc, struct oxr_space *baseSpc, XrTime time, XrSpaceLocation *location);
969
970XrResult
971oxr_spaces_locate(struct oxr_logger *log,
972 struct oxr_space **spcs,
973 uint32_t spc_count,
974 struct oxr_space *baseSpc,
975 XrTime time,
976 XrSpaceLocations *locations);
977
978/*!
979 * Locate the @ref xrt_device in the given base space, useful for implementing
980 * hand tracking location look ups and the like.
981 *
982 * @param log Logging struct.
983 * @param xdev Device to locate in the base space.
984 * @param baseSpc Base space where the device is to be located.
985 * @param[in] time Time in OpenXR domain.
986 * @param[out] out_relation Returns T_base_xdev, aka xdev in base space.
987 *
988 * @return Any errors, XR_SUCCESS, pose might not be valid on XR_SUCCESS.
989 */
990XRT_CHECK_RESULT XrResult
992 struct xrt_device *xdev,
993 struct oxr_space *baseSpc,
994 XrTime time,
995 struct xrt_space_relation *out_relation);
996
997/*!
998 * Get the xrt_space associated with this oxr_space, the @ref xrt_space will
999 * be reference counted by this function so the caller will need to call
1000 * @ref xrt_space_reference to decrement the reference count.
1001 *
1002 * @param log Logging struct.
1003 * @param spc Oxr space to get the xrt_space from.
1004 * @param[out] out_xspace Returns the xrt_space associated with this oxr_space.
1005 * @return Any errors, XR_SUCCESS, xspace is not set on XR_ERROR_*.
1006 */
1007XRT_CHECK_RESULT XrResult
1008oxr_space_get_xrt_space(struct oxr_logger *log, struct oxr_space *spc, struct xrt_space **out_xspace);
1009
1010
1011/*
1012 *
1013 * oxr_swapchain.c
1014 *
1015 */
1016
1017/*!
1018 * To go back to a OpenXR object.
1019 */
1020static inline XrSwapchain
1022{
1023 return XRT_CAST_PTR_TO_OXR_HANDLE(XrSwapchain, sc);
1024}
1025
1026
1027/*
1028 *
1029 * oxr_messenger.c
1030 *
1031 */
1032
1033/*!
1034 * To go back to a OpenXR object.
1035 */
1036static inline XrDebugUtilsMessengerEXT
1038{
1039 return XRT_CAST_PTR_TO_OXR_HANDLE(XrDebugUtilsMessengerEXT, mssngr);
1040}
1041
1042XrResult
1044 struct oxr_instance *inst,
1045 const XrDebugUtilsMessengerCreateInfoEXT *,
1046 struct oxr_debug_messenger **out_mssngr);
1047XrResult
1048oxr_destroy_messenger(struct oxr_logger *log, struct oxr_debug_messenger *mssngr);
1049
1050
1051/*
1052 *
1053 * oxr_system.c
1054 *
1055 */
1056
1057XrResult
1058oxr_system_select(struct oxr_logger *log,
1059 struct oxr_system **systems,
1060 uint32_t system_count,
1061 XrFormFactor form_factor,
1062 struct oxr_system **out_selected);
1063
1064XrResult
1065oxr_system_fill_in(struct oxr_logger *log,
1066 struct oxr_instance *inst,
1067 XrSystemId systemId,
1068 uint32_t view_count,
1069 struct oxr_system *sys);
1070
1071XrResult
1072oxr_system_verify_id(struct oxr_logger *log, const struct oxr_instance *inst, XrSystemId systemId);
1073
1074XrResult
1075oxr_system_get_by_id(struct oxr_logger *log,
1076 struct oxr_instance *inst,
1077 XrSystemId systemId,
1078 struct oxr_system **system);
1079
1080XrResult
1081oxr_system_get_properties(struct oxr_logger *log, struct oxr_system *sys, XrSystemProperties *properties);
1082
1083XrResult
1084oxr_system_enumerate_view_confs(struct oxr_logger *log,
1085 struct oxr_system *sys,
1086 uint32_t viewConfigurationTypeCapacityInput,
1087 uint32_t *viewConfigurationTypeCountOutput,
1088 XrViewConfigurationType *viewConfigurationTypes);
1089
1090XrResult
1091oxr_system_enumerate_blend_modes(struct oxr_logger *log,
1092 struct oxr_system *sys,
1093 XrViewConfigurationType viewConfigurationType,
1094 uint32_t environmentBlendModeCapacityInput,
1095 uint32_t *environmentBlendModeCountOutput,
1096 XrEnvironmentBlendMode *environmentBlendModes);
1097
1098XrResult
1099oxr_system_get_view_conf_properties(struct oxr_logger *log,
1100 struct oxr_system *sys,
1101 XrViewConfigurationType viewConfigurationType,
1102 XrViewConfigurationProperties *configurationProperties);
1103
1104XrResult
1105oxr_system_enumerate_view_conf_views(struct oxr_logger *log,
1106 struct oxr_system *sys,
1107 XrViewConfigurationType viewConfigurationType,
1108 uint32_t viewCapacityInput,
1109 uint32_t *viewCountOutput,
1110 XrViewConfigurationView *views);
1111
1112bool
1113oxr_system_get_hand_tracking_support(struct oxr_logger *log, struct oxr_instance *inst);
1114
1115bool
1116oxr_system_get_eye_gaze_support(struct oxr_logger *log, struct oxr_instance *inst);
1117
1118bool
1119oxr_system_get_force_feedback_support(struct oxr_logger *log, struct oxr_instance *inst);
1120
1121void
1122oxr_system_get_face_tracking_android_support(struct oxr_logger *log, struct oxr_instance *inst, bool *supported);
1123
1124void
1125oxr_system_get_face_tracking_htc_support(struct oxr_logger *log,
1126 struct oxr_instance *inst,
1127 bool *supports_eye,
1128 bool *supports_lip);
1129
1130void
1131oxr_system_get_face_tracking2_fb_support(struct oxr_logger *log,
1132 struct oxr_instance *inst,
1133 bool *supports_audio,
1134 bool *supports_visual);
1135
1136bool
1137oxr_system_get_body_tracking_fb_support(struct oxr_logger *log, struct oxr_instance *inst);
1138
1139bool
1140oxr_system_get_full_body_tracking_meta_support(struct oxr_logger *log, struct oxr_instance *inst);
1141
1142bool
1143oxr_system_get_body_tracking_calibration_meta_support(struct oxr_logger *log, struct oxr_instance *inst);
1144
1145/*
1146 *
1147 * oxr_event.cpp
1148 *
1149 */
1150
1151XrResult
1152oxr_event_push_XrEventDataSessionStateChanged(struct oxr_logger *log,
1153 struct oxr_session *sess,
1154 XrSessionState state,
1155 XrTime time);
1156
1157XrResult
1158oxr_event_push_XrEventDataInteractionProfileChanged(struct oxr_logger *log, struct oxr_session *sess);
1159
1160XrResult
1161oxr_event_push_XrEventDataReferenceSpaceChangePending(struct oxr_logger *log,
1162 struct oxr_session *sess,
1163 XrReferenceSpaceType referenceSpaceType,
1164 XrTime changeTime,
1165 XrBool32 poseValid,
1166 const XrPosef *poseInPreviousSpace);
1167
1168#ifdef OXR_HAVE_FB_display_refresh_rate
1169XrResult
1170oxr_event_push_XrEventDataDisplayRefreshRateChangedFB(struct oxr_logger *log,
1171 struct oxr_session *sess,
1172 float fromDisplayRefreshRate,
1173 float toDisplayRefreshRate);
1174#endif // OXR_HAVE_FB_display_refresh_rate
1175
1176#ifdef OXR_HAVE_EXTX_overlay
1177XrResult
1178oxr_event_push_XrEventDataMainSessionVisibilityChangedEXTX(struct oxr_logger *log,
1179 struct oxr_session *sess,
1180 bool visible);
1181#endif // OXR_HAVE_EXTX_overlay
1182
1183#ifdef OXR_HAVE_EXT_performance_settings
1184XrResult
1185oxr_event_push_XrEventDataPerfSettingsEXTX(struct oxr_logger *log,
1186 struct oxr_session *sess,
1187 enum xrt_perf_domain domain,
1188 enum xrt_perf_sub_domain subDomain,
1189 enum xrt_perf_notify_level fromLevel,
1190 enum xrt_perf_notify_level toLevel);
1191#endif // OXR_HAVE_EXT_performance_settings
1192/*!
1193 * This clears all pending events refers to the given session.
1194 */
1195XrResult
1196oxr_event_remove_session_events(struct oxr_logger *log, struct oxr_session *sess);
1197
1198/*!
1199 * Will return one event if available, also drain the sessions event queues.
1200 */
1201XrResult
1202oxr_poll_event(struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuffer *eventData);
1203
1204
1205/*
1206 *
1207 * oxr_xdev.c
1208 *
1209 */
1210
1211void
1212oxr_xdev_destroy(struct xrt_device **xdev_ptr);
1213
1214/*!
1215 * Return true if it finds an input of that name on this device.
1216 */
1217bool
1218oxr_xdev_find_input(struct xrt_device *xdev, enum xrt_input_name name, struct xrt_input **out_input);
1219
1220/*!
1221 * Return true if it finds an output of that name on this device.
1222 */
1223bool
1224oxr_xdev_find_output(struct xrt_device *xdev, enum xrt_output_name name, struct xrt_output **out_output);
1225
1226#ifdef OXR_HAVE_MNDX_xdev_space
1227static inline XrXDevListMNDX
1228oxr_xdev_list_to_openxr(struct oxr_xdev_list *sc)
1229{
1230 return XRT_CAST_PTR_TO_OXR_HANDLE(XrXDevListMNDX, sc);
1231}
1232
1233XrResult
1234oxr_xdev_list_create(struct oxr_logger *log,
1235 struct oxr_session *sess,
1236 const XrCreateXDevListInfoMNDX *createInfo,
1237 struct oxr_xdev_list **out_xdl);
1238
1239XrResult
1240oxr_xdev_list_get_properties(struct oxr_logger *log,
1241 struct oxr_xdev_list *xdl,
1242 uint32_t index,
1243 XrXDevPropertiesMNDX *properties);
1244
1245XrResult
1246oxr_xdev_list_space_create(struct oxr_logger *log,
1247 struct oxr_xdev_list *xdl,
1248 const XrCreateXDevSpaceInfoMNDX *createInfo,
1249 uint32_t index,
1250 struct oxr_space **out_space);
1251
1252#endif // OXR_HAVE_MNDX_xdev_space
1253
1254
1255/*
1256 *
1257 * OpenGL, located in various files.
1258 *
1259 */
1260
1261#ifdef XR_USE_GRAPHICS_API_OPENGL
1262#ifdef XR_USE_PLATFORM_XLIB
1263
1264XrResult
1265oxr_session_populate_gl_xlib(struct oxr_logger *log,
1266 struct oxr_system *sys,
1267 XrGraphicsBindingOpenGLXlibKHR const *next,
1268 struct oxr_session *sess);
1269#endif // XR_USE_PLATFORM_XLIB
1270
1271#ifdef XR_USE_PLATFORM_WIN32
1272XrResult
1273oxr_session_populate_gl_win32(struct oxr_logger *log,
1274 struct oxr_system *sys,
1275 XrGraphicsBindingOpenGLWin32KHR const *next,
1276 struct oxr_session *sess);
1277#endif // XR_USE_PLATFORM_WIN32
1278#endif // XR_USE_GRAPHICS_API_OPENGL
1279
1280#if defined(XR_USE_GRAPHICS_API_OPENGL) || defined(XR_USE_GRAPHICS_API_OPENGL_ES)
1281XrResult
1282oxr_swapchain_gl_create(struct oxr_logger * /*log*/,
1283 struct oxr_session *sess,
1284 const XrSwapchainCreateInfo * /*createInfo*/,
1285 struct oxr_swapchain **out_swapchain);
1286
1287#endif // XR_USE_GRAPHICS_API_OPENGL || XR_USE_GRAPHICS_API_OPENGL_ES
1288
1289#if defined(XR_USE_GRAPHICS_API_OPENGL_ES)
1290#if defined(XR_USE_PLATFORM_ANDROID)
1291XrResult
1292oxr_session_populate_gles_android(struct oxr_logger *log,
1293 struct oxr_system *sys,
1294 XrGraphicsBindingOpenGLESAndroidKHR const *next,
1295 struct oxr_session *sess);
1296#endif // XR_USE_PLATFORM_ANDROID
1297#endif // XR_USE_GRAPHICS_API_OPENGL_ES
1298
1299
1300/*
1301 *
1302 * Vulkan, located in various files.
1303 *
1304 */
1305
1306#ifdef XR_USE_GRAPHICS_API_VULKAN
1307
1308XrResult
1309oxr_vk_get_instance_exts(struct oxr_logger *log,
1310 struct oxr_system *sys,
1311 uint32_t namesCapacityInput,
1312 uint32_t *namesCountOutput,
1313 char *namesString);
1314
1315XrResult
1316oxr_vk_get_device_exts(struct oxr_logger *log,
1317 struct oxr_system *sys,
1318 uint32_t namesCapacityInput,
1319 uint32_t *namesCountOutput,
1320 char *namesString);
1321
1322XrResult
1323oxr_vk_get_requirements(struct oxr_logger *log,
1324 struct oxr_system *sys,
1325 XrGraphicsRequirementsVulkanKHR *graphicsRequirements);
1326
1327XrResult
1329 struct oxr_system *sys,
1330 const XrVulkanInstanceCreateInfoKHR *createInfo,
1331 VkInstance *vulkanInstance,
1332 VkResult *vulkanResult);
1333
1334XrResult
1336 struct oxr_system *sys,
1337 const XrVulkanDeviceCreateInfoKHR *createInfo,
1338 VkDevice *vulkanDevice,
1339 VkResult *vulkanResult);
1340
1341XrResult
1342oxr_vk_get_physical_device(struct oxr_logger *log,
1343 struct oxr_instance *inst,
1344 struct oxr_system *sys,
1345 VkInstance vkInstance,
1346 PFN_vkGetInstanceProcAddr getProc,
1347 VkPhysicalDevice *vkPhysicalDevice);
1348
1349XrResult
1350oxr_session_populate_vk(struct oxr_logger *log,
1351 struct oxr_system *sys,
1352 XrGraphicsBindingVulkanKHR const *next,
1353 struct oxr_session *sess);
1354
1355XrResult
1356oxr_swapchain_vk_create(struct oxr_logger * /*log*/,
1357 struct oxr_session *sess,
1358 const XrSwapchainCreateInfo * /*createInfo*/,
1359 struct oxr_swapchain **out_swapchain);
1360
1361#endif
1362
1363
1364/*
1365 *
1366 * EGL, located in various files.
1367 *
1368 */
1369
1370#ifdef XR_USE_PLATFORM_EGL
1371
1372XrResult
1373oxr_session_populate_egl(struct oxr_logger *log,
1374 struct oxr_system *sys,
1375 XrGraphicsBindingEGLMNDX const *next,
1376 struct oxr_session *sess);
1377
1378#endif
1379
1380/*
1381 *
1382 * D3D version independent routines, located in oxr_d3d.cpp
1383 *
1384 */
1385
1386#if defined(XRT_HAVE_D3D11) || defined(XRT_HAVE_D3D12) || defined(XRT_DOXYGEN)
1387/// Common GetRequirements call for D3D11 and D3D12
1388XrResult
1390 struct oxr_system *sys,
1391 LUID *adapter_luid,
1392 D3D_FEATURE_LEVEL *min_feature_level);
1393
1394/// Verify the provided LUID matches the expected one in @p sys
1395XrResult
1396oxr_d3d_check_luid(struct oxr_logger *log, struct oxr_system *sys, LUID *adapter_luid);
1397#endif
1398
1399/*
1400 *
1401 * D3D11, located in various files.
1402 *
1403 */
1404
1405#ifdef XR_USE_GRAPHICS_API_D3D11
1406
1407XrResult
1408oxr_d3d11_get_requirements(struct oxr_logger *log,
1409 struct oxr_system *sys,
1410 XrGraphicsRequirementsD3D11KHR *graphicsRequirements);
1411
1412/**
1413 * @brief Check to ensure the device provided at session create matches the LUID we returned earlier.
1414 *
1415 * @return XR_SUCCESS if the device matches the LUID
1416 */
1417XrResult
1418oxr_d3d11_check_device(struct oxr_logger *log, struct oxr_system *sys, ID3D11Device *device);
1419
1420
1421XrResult
1422oxr_session_populate_d3d11(struct oxr_logger *log,
1423 struct oxr_system *sys,
1424 XrGraphicsBindingD3D11KHR const *next,
1425 struct oxr_session *sess);
1426
1427XrResult
1428oxr_swapchain_d3d11_create(struct oxr_logger *,
1429 struct oxr_session *sess,
1430 const XrSwapchainCreateInfo *,
1431 struct oxr_swapchain **out_swapchain);
1432
1433#endif
1434
1435/*
1436 *
1437 * D3D12, located in various files.
1438 *
1439 */
1440
1441#ifdef XR_USE_GRAPHICS_API_D3D12
1442
1443XrResult
1444oxr_d3d12_get_requirements(struct oxr_logger *log,
1445 struct oxr_system *sys,
1446 XrGraphicsRequirementsD3D12KHR *graphicsRequirements);
1447
1448/**
1449 * @brief Check to ensure the device provided at session create matches the LUID we returned earlier.
1450 *
1451 * @return XR_SUCCESS if the device matches the LUID
1452 */
1453XrResult
1454oxr_d3d12_check_device(struct oxr_logger *log, struct oxr_system *sys, ID3D12Device *device);
1455
1456
1457XrResult
1458oxr_session_populate_d3d12(struct oxr_logger *log,
1459 struct oxr_system *sys,
1460 XrGraphicsBindingD3D12KHR const *next,
1461 struct oxr_session *sess);
1462
1463XrResult
1464oxr_swapchain_d3d12_create(struct oxr_logger *,
1465 struct oxr_session *sess,
1466 const XrSwapchainCreateInfo *,
1467 struct oxr_swapchain **out_swapchain);
1468
1469#endif
1470
1471/*
1472 *
1473 * Structs
1474 *
1475 */
1476
1477
1478/*!
1479 * Used to hold diverse child handles and ensure orderly destruction.
1480 *
1481 * Each object referenced by an OpenXR handle should have one of these as its
1482 * first element, thus "extending" this class.
1483 */
1485{
1486 //! Magic (per-handle-type) value for debugging.
1487 uint64_t debug;
1488
1489 /*!
1490 * Pointer to this object's parent handle holder, if any.
1491 */
1493
1494 /*!
1495 * Array of children, if any.
1496 */
1497 struct oxr_handle_base *children[XRT_MAX_HANDLE_CHILDREN];
1498
1499 /*!
1500 * Current handle state.
1501 */
1503
1504 /*!
1505 * Destroy the object this handle refers to.
1506 */
1508};
1509
1510/*!
1511 * Holds the properties that a system supports for a view configuration type.
1512 *
1513 * @relates oxr_system
1514 */
1516{
1517 XrViewConfigurationType view_config_type;
1518
1519 uint32_t view_count;
1520 XrViewConfigurationView views[XRT_MAX_COMPOSITOR_VIEW_CONFIGS_VIEW_COUNT];
1521
1522 uint32_t blend_mode_count;
1523 XrEnvironmentBlendMode blend_modes[3];
1524};
1525
1526/*!
1527 * Single or multiple devices grouped together to form a system that sessions
1528 * can be created from. Might need to open devices to get all
1529 * properties from it, but shouldn't.
1530 *
1531 * Not strictly an object, but an atom.
1532 *
1533 * Valid only within an XrInstance (@ref oxr_instance)
1534 *
1535 * @obj{XrSystemId}
1536 */
1538{
1539 struct oxr_instance *inst;
1540
1541 //! The @ref xrt_iface level system.
1543
1544 //! System devices used in all session types.
1546
1547 //! Space overseer used in all session types.
1549
1550 //! System compositor, used to create session compositors.
1552
1553 XrSystemId systemId;
1554
1555 //! Have the client application called the gfx api requirements func?
1557
1558 uint32_t view_config_count;
1559 struct oxr_view_config_properties view_configs[XRT_MAX_COMPOSITOR_VIEW_CONFIGS_COUNT];
1560
1561 XrReferenceSpaceType reference_spaces[5];
1562 uint32_t reference_space_count;
1563
1564 struct xrt_visibility_mask *visibility_mask[2];
1565
1566#ifdef OXR_HAVE_MNDX_xdev_space
1567 bool supports_xdev_space;
1568#endif
1569
1570#ifdef XR_USE_GRAPHICS_API_VULKAN
1571 //! The instance/device we create when vulkan_enable2 is used
1573 //! The device returned with the last xrGetVulkanGraphicsDeviceKHR or xrGetVulkanGraphicsDevice2KHR call.
1574 //! XR_NULL_HANDLE if neither has been called.
1576
1577 /*!
1578 * Stores the vkGetInstanceProcAddr passed to xrCreateVulkanInstanceKHR to be
1579 * used when looking up Vulkan functions used by xrGetVulkanGraphicsDevice2KHR.
1580 */
1581 PFN_vkGetInstanceProcAddr vk_get_instance_proc_addr;
1582
1583 struct
1584 {
1585 // No better place to keep this state.
1586 bool external_fence_fd_enabled;
1587 bool external_semaphore_fd_enabled;
1588 bool timeline_semaphore_enabled;
1589 bool debug_utils_enabled;
1590 bool image_format_list_enabled;
1591 } vk;
1592
1593#endif
1594
1595#if defined(XR_USE_GRAPHICS_API_D3D11) || defined(XR_USE_GRAPHICS_API_D3D12)
1596 LUID suggested_d3d_luid;
1597 bool suggested_d3d_luid_valid;
1598#endif
1599};
1600
1601/*
1602 * Extensions helpers.
1603 */
1604
1605#define MAKE_EXT_STATUS(mixed_case, all_caps) bool mixed_case;
1606/*!
1607 * Structure tracking which extensions are enabled for a given instance.
1608 *
1609 * Names are systematic: the extension name with the XR_ prefix removed.
1610 */
1612{
1613 OXR_EXTENSION_SUPPORT_GENERATE(MAKE_EXT_STATUS)
1614};
1615#undef MAKE_EXT_STATUS
1616
1617/*!
1618 * Main object that ties everything together.
1619 *
1620 * No parent type/handle: this is the root handle.
1621 *
1622 * @obj{XrInstance}
1623 * @extends oxr_handle_base
1624 */
1626{
1627 //! Common structure for things referred to by OpenXR handles.
1629
1630 struct u_debug_gui *debug_ui;
1631
1632 struct xrt_instance *xinst;
1633
1634 //! Enabled extensions
1636
1637 //! The OpenXR version requested in the app info. It determines the instance's OpenXR version.
1638 struct
1639 {
1640 //! Stores only major.minor version. Simplifies comparisons for e.g. "at least OpenXR 1.1".
1641 XrVersion major_minor;
1643
1644 // Protects the function oxr_instance_init_system_locked.
1645 struct os_mutex system_init_lock;
1646
1647 // Hardcoded single system.
1648 struct oxr_system system;
1649
1650 struct time_state *timekeeping;
1651
1652 struct
1653 {
1654 struct u_hashset *name_store;
1655 struct u_hashset *loc_store;
1656 } action_sets;
1657
1658 //! Path store, for looking up paths.
1660 //! Mapping from ID to path.
1662 //! Total length of path array.
1664 //! Number of paths in the array (0 is always null).
1665 size_t path_num;
1666
1667 // Event queue.
1668 struct
1669 {
1670 struct os_mutex mutex;
1671 struct oxr_event *last;
1672 struct oxr_event *next;
1673 } event;
1674
1675 //! Interaction profile bindings that have been suggested by the client.
1677 size_t profile_count;
1678
1679 struct oxr_session *sessions;
1680
1681 struct
1682 {
1683
1684#define SUBACTION_PATH_MEMBER(X) XrPath X;
1685 OXR_FOR_EACH_SUBACTION_PATH(SUBACTION_PATH_MEMBER)
1686
1687#undef SUBACTION_PATH_MEMBER
1688 } path_cache;
1689
1690 struct
1691 {
1692 struct
1693 {
1694 struct
1695 {
1696 uint32_t major;
1697 uint32_t minor;
1698 uint32_t patch;
1699 const char *name; //< Engine name, not freed.
1700 } engine;
1701 } detected;
1702 } appinfo;
1703
1704 struct
1705 {
1706 /*!
1707 * Some applications can't handle depth formats, or they trigger
1708 * a bug in a specific version of the application or engine.
1709 * This flag only disables depth formats
1710 * @see disable_vulkan_format_depth_stencil for depth-stencil formats.
1711 */
1713
1714 /*!
1715 * Some applications can't handle depth stencil formats, or they
1716 * trigger a bug in a specific version of the application or
1717 * engine.
1718 *
1719 * This flag only disables depth-stencil formats,
1720 * @see disable_vulkan_format_depth flag for depth only formats.
1721 *
1722 * In the past it was used to work around a bug in Unreal's
1723 * VulkanRHI backend.
1724 */
1727 //! Unreal 4 has a bug calling xrEndSession; the function should just exit
1728 bool skip_end_session;
1729
1730 /*!
1731 * Return XR_ERROR_REFERENCE_SPACE_UNSUPPORTED instead of
1732 * XR_ERROR_VALIDATION_FAILURE in xrCreateReferenceSpace.
1733 */
1736 //! For applications that rely on views being parallel, notably some OpenVR games with OpenComposite.
1737 bool parallel_views;
1739 //! For applications that use stage and don't offer recentering.
1741
1742 /*!
1743 * Beat Saber submits its projection layer with XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT set.
1744 * This breaks rendering because the game uses the alpha texture to store data for the bloom shader,
1745 * causing most of the game to render as black, only showing glowing parts of the image.
1746 */
1748 } quirks;
1750 //! Debug messengers
1751 struct oxr_debug_messenger *messengers[XRT_MAX_HANDLE_CHILDREN];
1752
1753 bool lifecycle_verbose;
1754 bool debug_views;
1755 bool debug_spaces;
1756 bool debug_bindings;
1757
1758#ifdef XRT_FEATURE_RENDERDOC
1759 RENDERDOC_API_1_4_1 *rdoc_api;
1760#endif
1761
1762#ifdef XRT_OS_ANDROID
1763 enum xrt_android_lifecycle_event activity_state;
1764#endif // XRT_OS_ANDROID
1765};
1766
1767/*!
1768 * Object that client program interact with.
1769 *
1770 * Parent type/handle is @ref oxr_instance
1771 *
1772 * @obj{XrSession}
1773 * @extends oxr_handle_base
1774 */
1775struct oxr_session
1777 //! Common structure for things referred to by OpenXR handles.
1778 struct oxr_handle_base handle;
1779 struct oxr_system *sys;
1781 //! What graphics type was this session created with.
1784 //! The @ref xrt_session backing this session.
1785 struct xrt_session *xs;
1787 //! Native compositor that is wrapped by client compositors.
1788 struct xrt_compositor_native *xcn;
1789
1790 struct xrt_compositor *compositor;
1791
1792 struct oxr_session *next;
1793
1794 XrSessionState state;
1795
1796 /*!
1797 * This is set in xrBeginSession and is the primaryViewConfiguration
1798 * argument, this is then used in xrEndFrame to know which view
1799 * configuration the application is submitting it's frame in.
1800 */
1801 XrViewConfigurationType current_view_config_type;
1802
1803 /*!
1804 * There is a extra state between xrBeginSession has been called and
1805 * the first xrEndFrame has been called. These are to track this.
1806 */
1807 bool has_ended_once;
1808
1809 bool compositor_visible;
1810 bool compositor_focused;
1811
1812 // the number of xrWaitFrame calls that did not yet have a corresponding
1813 // xrEndFrame or xrBeginFrame (discarded frame) call
1814 int active_wait_frames;
1815 struct os_mutex active_wait_frames_lock;
1816
1817 bool frame_started;
1818 bool exiting;
1819
1820 struct
1821 {
1822 int64_t waited;
1823 int64_t begun;
1824 } frame_id;
1825
1826 struct oxr_frame_sync frame_sync;
1827
1828 /*!
1829 * Used to implement precise extra sleeping in wait frame.
1830 */
1832
1833 /*!
1834 * An array of action set attachments that this session owns.
1835 *
1836 * If non-null, this means action sets have been attached to this
1837 * session.
1838 */
1840
1841 /*!
1842 * Length of @ref oxr_session::act_set_attachments.
1843 */
1845
1846 /*!
1847 * A map of action set key to action set attachments.
1848 *
1849 * If non-null, this means action sets have been attached to this
1850 * session, since this map points to elements of
1851 * oxr_session::act_set_attachments
1852 */
1854
1855 /*!
1856 * A map of action key to action attachment.
1857 *
1858 * The action attachments are actually owned by the action set
1859 * attachments, but we own the action set attachments, so this is OK.
1860 *
1861 * If non-null, this means action sets have been attached to this
1862 * session, since this map points to @p oxr_action_attachment members of
1863 * @ref oxr_session::act_set_attachments elements.
1864 */
1866
1867 /*!
1868 * Clone of all suggested binding profiles at the point of action set/session attachment.
1869 * @ref oxr_session_attach_action_sets
1870 */
1872 struct oxr_interaction_profile **profiles_on_attachment;
1874 //! Cache of the last known system roles generation_id
1877 //! Protects access to dynamic_roles_generation_id during sync actions
1879
1880 /*!
1881 * Currently bound interaction profile.
1882 * @{
1884
1885#define OXR_PATH_MEMBER(X) XrPath X;
1886
1888#undef OXR_PATH_MEMBER
1889 /*!
1890 * @}
1891 */
1892
1893 /*!
1894 * IPD, to be expanded to a proper 3D relation.
1895 */
1896 float ipd_meters;
1897
1898 /*!
1899 * Frame timing debug output.
1900 */
1902
1903 //! Extra sleep in wait frame.
1905
1906 /*!
1907 * To pipe swapchain creation to right code.
1908 */
1909 XrResult (*create_swapchain)(struct oxr_logger *,
1910 struct oxr_session *sess,
1911 const XrSwapchainCreateInfo *,
1912 struct oxr_swapchain **);
1914 /*! initial relation of head in "global" space.
1915 * Used as reference for local space. */
1917
1918 bool has_lost;
1919};
1920
1921/*!
1922 * Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate.
1923 *
1924 * @public @memberof oxr_session
1925 */
1926static inline XrResult
1928{
1929 switch (session->state) {
1930 case XR_SESSION_STATE_LOSS_PENDING: return XR_SESSION_LOSS_PENDING;
1931 default: return XR_SUCCESS;
1932 }
1933}
1934
1935/*!
1936 * Returns XR_SUCCESS, XR_SESSION_LOSS_PENDING, or XR_SESSION_NOT_FOCUSED, as
1937 * appropriate.
1938 *
1939 * @public @memberof oxr_session
1940 */
1941static inline XrResult
1943{
1944 switch (session->state) {
1945 case XR_SESSION_STATE_LOSS_PENDING: return XR_SESSION_LOSS_PENDING;
1946 case XR_SESSION_STATE_FOCUSED: return XR_SUCCESS;
1947 default: return XR_SESSION_NOT_FOCUSED;
1948 }
1949}
1950
1951#ifdef OXR_HAVE_FB_display_refresh_rate
1952XrResult
1953oxr_session_get_display_refresh_rate(struct oxr_logger *log, struct oxr_session *sess, float *displayRefreshRate);
1954
1955XrResult
1956oxr_session_request_display_refresh_rate(struct oxr_logger *log, struct oxr_session *sess, float displayRefreshRate);
1957#endif // OXR_HAVE_FB_display_refresh_rate
1958
1959/*!
1960 * dpad settings we need extracted from XrInteractionProfileDpadBindingEXT
1962 * @ingroup oxr_input
1963 */
1964struct oxr_dpad_settings
1965{
1966 float forceThreshold;
1967 float forceThresholdReleased;
1968 float centerRegion;
1969 float wedgeAngle;
1970 bool isSticky;
1971};
1972
1974 * dpad binding extracted from XrInteractionProfileDpadBindingEXT
1975 */
1977{
1978 XrPath binding;
1979 struct oxr_dpad_settings settings;
1980};
1981
1982/*!
1983 * A entry in the dpad state for one action set.
1985 * @ingroup oxr_input
1986 */
1987struct oxr_dpad_entry
1988{
1989#ifdef XR_EXT_dpad_binding
1990 struct oxr_dpad_binding_modification dpads[4];
1991 uint32_t dpad_count;
1992#endif
1993
1994 uint64_t key;
1995};
1996
1997/*!
1998 * Holds dpad binding state for a single interaction profile.
2000 * @ingroup oxr_input
2001 */
2002struct oxr_dpad_state
2003{
2004 struct u_hashmap_int *uhi;
2005};
2006
2008 * dpad emulation settings from oxr_interaction_profile
2009 */
2010struct oxr_dpad_emulation
2011{
2012 enum oxr_subaction_path subaction_path;
2013 XrPath *paths;
2014 uint32_t path_count;
2015 enum xrt_input_name position;
2016 enum xrt_input_name activate; // Can be zero
2017};
2018
2020 * A single interaction profile.
2021 */
2023{
2024 XrPath path;
2025
2026 //! Used to lookup @ref xrt_binding_profile for fallback.
2028
2029 //! Name presented to the user.
2030 const char *localized_name;
2031
2032 struct oxr_binding *bindings;
2033 size_t binding_count;
2034
2035 struct oxr_dpad_emulation *dpads;
2036 size_t dpad_count;
2037
2038 struct oxr_dpad_state dpad_state;
2039};
2040
2042 * Interaction profile binding state.
2043 */
2044struct oxr_binding
2045{
2046 XrPath *paths;
2047 uint32_t path_count;
2048
2049 //! Name presented to the user.
2050 const char *localized_name;
2051
2052 enum oxr_subaction_path subaction_path;
2053
2054 uint32_t act_key_count;
2055 uint32_t *act_keys;
2056 //! store which entry in paths was suggested, for each action key
2058
2059 enum xrt_input_name input;
2060 enum xrt_input_name dpad_activate;
2061
2062 enum xrt_output_name output;
2063};
2064
2065/*!
2066 * @defgroup oxr_input OpenXR input
2067 * @ingroup oxr_main
2068 *
2069 * @brief The action-set/action-based input subsystem of OpenXR.
2070 *
2071 *
2072 * Action sets are created as children of the Instance, but are primarily used
2073 * with one or more Sessions. They may be used with multiple sessions at a time,
2074 * so we can't just put the per-session information directly in the action set
2075 * or action. Instead, we have the `_attachment `structures, which mirror the
2076 * action sets and actions but are rooted under the Session:
2077 *
2078 * - For every action set attached to a session, that session owns a @ref
2079 * oxr_action_set_attachment.
2080 * - For each action in those attached action sets, the action set attachment
2081 * owns an @ref oxr_action_attachment.
2082 *
2083 * We go from the public handle to the `_attachment` structure by using a `key`
2084 * value and a hash map: specifically, we look up the
2085 * oxr_action_set::act_set_key and oxr_action::act_key in the session.
2086 *
2087 * ![](monado-input-class-relationships.drawio.svg)
2088 */
2089
2090/*!
2091 * A parsed equivalent of a list of sub-action paths.
2092 *
2093 * If @p any is true, then no paths were provided, which typically means any
2094 * input is acceptable.
2095 *
2096 * @ingroup oxr_main
2097 * @ingroup oxr_input
2098 */
2100{
2101 bool any;
2102#define OXR_SUBPATH_MEMBER(X) bool X;
2103 OXR_FOR_EACH_SUBACTION_PATH(OXR_SUBPATH_MEMBER)
2104#undef OXR_SUBPATH_MEMBER
2105};
2106
2107/*!
2108 * Helper function to determine if the set of paths in @p a is a subset of the
2109 * paths in @p b.
2111 * @public @memberof oxr_subaction_paths
2112 */
2113static inline bool
2115{
2116#define OXR_CHECK_SUBACTION_PATHS(X) \
2117 if (a->X && !b->X) { \
2118 return false; \
2119 }
2120 OXR_FOR_EACH_SUBACTION_PATH(OXR_CHECK_SUBACTION_PATHS)
2121#undef OXR_CHECK_SUBACTION_PATHS
2122 return true;
2123}
2124
2125/*!
2126 * The data associated with the attachment of an Action Set (@ref
2127 * oxr_action_set) to as Session (@ref oxr_session).
2128 *
2129 * This structure has no pointer to the @ref oxr_action_set that created it
2130 * because the application is allowed to destroy an action before the session,
2131 * which should change nothing except not allow the application to use the
2132 * corresponding data anymore.
2134 * @ingroup oxr_input
2135 *
2136 * @see oxr_action_set
2137 */
2140 //! Owning session.
2141 struct oxr_session *sess;
2143 //! Action set refcounted data
2146 //! Unique key for the session hashmap.
2147 uint32_t act_set_key;
2149 //! Which sub-action paths are requested on the latest sync.
2151
2152 //! An array of action attachments we own.
2154
2155 /*!
2156 * Length of @ref oxr_action_set_attachment::act_attachments.
2157 */
2159};
2160
2161/*!
2162 * De-initialize an action set attachment and its action attachments.
2163 *
2164 * Frees the action attachments, but does not de-allocate the action set
2165 * attachment.
2166 *
2167 * @public @memberof oxr_action_set_attachment
2168 */
2169void
2171
2172
2173/*!
2174 * The state of a action input.
2176 * @ingroup oxr_input
2177 *
2178 * @see oxr_action_attachment
2179 */
2181{
2182 /*!
2183 * The actual value - must interpret using action type
2184 */
2185 union xrt_input_value value;
2186
2187 //! Is this active (bound and providing input)?
2188 bool active;
2190 // Was this changed.
2191 bool changed;
2192
2193 //! When was this last changed.
2194 XrTime timestamp;
2195};
2196
2197/*!
2198 * A input action pair of a @ref xrt_input and a @ref xrt_device, along with the
2199 * required transform.
2200 *
2201 * @ingroup oxr_input
2202 *
2203 * @see xrt_device
2204 * @see xrt_input
2205 */
2206struct oxr_action_input
2207{
2208 struct xrt_device *xdev; // Used for poses and transform is null.
2209 struct xrt_input *input; // Ditto
2210 enum xrt_input_name dpad_activate_name; // used to activate dpad emulation if present
2211 struct xrt_input *dpad_activate; // used to activate dpad emulation if present
2212 struct oxr_input_transform *transforms;
2213 size_t transform_count;
2214 XrPath bound_path;
2215};
2216
2217/*!
2218 * A output action pair of a @ref xrt_output_name and a @ref xrt_device.
2219 *
2220 * @ingroup oxr_input
2221 *
2222 * @see xrt_device
2223 * @see xrt_output_name
2224 */
2225struct oxr_action_output
2226{
2227 struct xrt_device *xdev;
2228 enum xrt_output_name name;
2229 XrPath bound_path;
2230};
2231
2232
2233/*!
2234 * The set of inputs/outputs for a single sub-action path for an action.
2235 *
2236 * Each @ref oxr_action_attachment has one of these for every known sub-action
2237 * path in the spec. Many, or even most, will be "empty".
2238 *
2239 * A single action will either be input or output, not both.
2241 * @ingroup oxr_input
2242 *
2243 * @see oxr_action_attachment
2244 */
2245struct oxr_action_cache
2246{
2247 struct oxr_action_state current;
2248
2249 size_t input_count;
2250 struct oxr_action_input *inputs;
2251
2252 int64_t stop_output_time;
2253 size_t output_count;
2254 struct oxr_action_output *outputs;
2255};
2256
2257/*!
2258 * Data associated with an Action that has been attached to a Session.
2259 *
2260 * More information on the action vs action attachment and action set vs action
2261 * set attachment parallel is in the docs for @ref oxr_input
2263 * @ingroup oxr_input
2264 *
2265 * @see oxr_action
2266 */
2269 //! The owning action set attachment
2271
2272 //! This action's refcounted data
2273 struct oxr_action_ref *act_ref;
2274
2275 /*!
2276 * The corresponding session.
2277 *
2278 * This will always be valid: the session outlives this object because
2279 * it owns act_set_attached.
2280 */
2281 struct oxr_session *sess;
2282
2283 //! Unique key for the session hashmap.
2284 uint32_t act_key;
2285
2286
2287 /*!
2288 * For pose actions any subaction paths are special treated, at bind
2289 * time we pick one subaction path and stick to it as long as the action
2290 * lives.
2291 */
2293
2294 struct oxr_action_state any_state;
2295
2296#define OXR_CACHE_MEMBER(X) struct oxr_action_cache X;
2297 OXR_FOR_EACH_SUBACTION_PATH(OXR_CACHE_MEMBER)
2298#undef OXR_CACHE_MEMBER
2299};
2300
2301/*!
2302 * @}
2303 */
2304
2305
2306static inline bool
2307oxr_space_type_is_reference(enum oxr_space_type space_type)
2308{
2309 switch (space_type) {
2310 case OXR_SPACE_TYPE_REFERENCE_VIEW:
2311 case OXR_SPACE_TYPE_REFERENCE_LOCAL:
2312 case OXR_SPACE_TYPE_REFERENCE_LOCAL_FLOOR:
2313 case OXR_SPACE_TYPE_REFERENCE_STAGE:
2314 case OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_MSFT:
2315 case OXR_SPACE_TYPE_REFERENCE_COMBINED_EYE_VARJO:
2316 case OXR_SPACE_TYPE_REFERENCE_LOCALIZATION_MAP_ML:
2317 // These are reference spaces.
2318 return true;
2319
2320 case OXR_SPACE_TYPE_ACTION:
2321 case OXR_SPACE_TYPE_XDEV_POSE:
2322 // These are not reference spaces.
2323 return false;
2324 }
2325
2326 // Handles invalid value.
2327 return false;
2328}
2329
2330
2331/*!
2332 * Can be one of several reference space types, or a space that is bound to an
2333 * action.
2335 * Parent type/handle is @ref oxr_session
2336 *
2337 * @obj{XrSpace}
2338 * @extends oxr_handle_base
2339 */
2341{
2342 //! Common structure for things referred to by OpenXR handles.
2344
2345 //! Owner of this space.
2347
2348 //! Pose that was given during creation.
2350
2351 //! Action key from which action this space was created from.
2352 uint32_t act_key;
2353
2354 //! What kind of space is this?
2356
2357 //! Which sub action path is this?
2359
2360 struct
2361 {
2362 struct xrt_space *xs;
2363 struct xrt_device *xdev;
2364 enum xrt_input_name name;
2365
2366 bool feature_eye_tracking;
2367 } action;
2368
2369 struct
2370 {
2371 struct xrt_space *xs;
2372 } xdev_pose;
2373};
2374
2375/*!
2376 * A set of images used for rendering.
2378 * Parent type/handle is @ref oxr_session
2379 *
2380 * @obj{XrSwapchain}
2381 * @extends oxr_handle_base
2382 */
2384{
2385 //! Common structure for things referred to by OpenXR handles.
2387
2388 //! Owner of this swapchain.
2390
2391 //! Compositor swapchain.
2393
2394 //! Swapchain size.
2395 uint32_t width, height;
2396
2397 //! For 1 is 2D texture, greater then 1 2D array texture.
2398 uint32_t array_layer_count;
2399
2400 //! The number of cubemap faces. 6 for cubemaps, 1 otherwise.
2401 uint32_t face_count;
2402
2403 struct
2404 {
2405 enum oxr_image_state state;
2406 } images[XRT_MAX_SWAPCHAIN_IMAGES];
2407
2408 struct
2409 {
2410 size_t num;
2411 struct u_index_fifo fifo;
2412 } acquired;
2413
2414 struct
2415 {
2416 bool yes;
2417 int index;
2418 } inflight; // This is the image that the app is working on.
2419
2420 struct
2421 {
2422 bool yes;
2423 int index;
2424 } released;
2425
2426 // Is this a static swapchain, needed for acquire semantics.
2427 bool is_static;
2428
2429
2430 XrResult (*destroy)(struct oxr_logger *, struct oxr_swapchain *);
2431
2432 XrResult (*enumerate_images)(struct oxr_logger *,
2433 struct oxr_swapchain *,
2434 uint32_t,
2435 XrSwapchainImageBaseHeader *);
2436
2437 XrResult (*acquire_image)(struct oxr_logger *,
2438 struct oxr_swapchain *,
2439 const XrSwapchainImageAcquireInfo *,
2440 uint32_t *);
2442 XrResult (*wait_image)(struct oxr_logger *, struct oxr_swapchain *, const XrSwapchainImageWaitInfo *);
2443
2444 XrResult (*release_image)(struct oxr_logger *, struct oxr_swapchain *, const XrSwapchainImageReleaseInfo *);
2446
2447struct oxr_refcounted
2448{
2449 struct xrt_reference base;
2450 //! Destruction callback
2451 void (*destroy)(struct oxr_refcounted *);
2453
2454/*!
2455 * Increase the reference count of @p orc.
2456 */
2457static inline void
2459{
2460 xrt_reference_inc(&orc->base);
2462
2463/*!
2464 * Decrease the reference count of @p orc, destroying it if it reaches 0.
2465 */
2466static inline void
2468{
2469 if (xrt_reference_dec_and_is_zero(&orc->base)) {
2470 orc->destroy(orc);
2471 }
2472}
2473
2474/*!
2475 * The reference-counted data of an action set.
2476 *
2477 * One or more sessions may still need this data after the application destroys
2478 * its XrActionSet handle, so this data is refcounted.
2480 * @ingroup oxr_input
2481 *
2482 * @see oxr_action_set
2483 * @extends oxr_refcounted
2485struct oxr_action_set_ref
2486{
2487 struct oxr_refcounted base;
2488
2489 //! Application supplied name of this action.
2490 char name[XR_MAX_ACTION_SET_NAME_SIZE];
2491
2492 /*!
2493 * Has this action set even been attached to any session, marking it as
2494 * immutable.
2495 */
2497
2498 //! Unique key for the session hashmap.
2499 uint32_t act_set_key;
2500
2501 //! Application supplied action set priority.
2502 uint32_t priority;
2503
2504 struct
2505 {
2506 struct u_hashset *name_store;
2507 struct u_hashset *loc_store;
2508 } actions;
2509
2510 struct oxr_subaction_paths permitted_subaction_paths;
2511};
2512
2513/*!
2514 * A group of actions.
2515 *
2516 * Parent type/handle is @ref oxr_instance
2517 *
2518 * Note, however, that an action set must be "attached" to a session
2519 * ( @ref oxr_session ) to be used and not just configured.
2520 * The corresponding data is in @ref oxr_action_set_attachment.
2522 * @ingroup oxr_input
2523 *
2524 * @obj{XrActionSet}
2525 * @extends oxr_handle_base
2526 */
2528{
2529 //! Common structure for things referred to by OpenXR handles.
2530 struct oxr_handle_base handle;
2531
2532 //! Owner of this action set.
2534
2535 /*!
2536 * The data for this action set that must live as long as any session we
2537 * are attached to.
2538 */
2539 struct oxr_action_set_ref *data;
2540
2542 /*!
2543 * Unique key for the session hashmap.
2545 * Duplicated from oxr_action_set_ref::act_set_key for efficiency.
2546 */
2547 uint32_t act_set_key;
2548
2549 //! The item in the name hashset.
2550 struct u_hashset_item *name_item;
2551
2552 //! The item in the localized hashset.
2553 struct u_hashset_item *loc_item;
2554};
2555
2556/*!
2557 * The reference-counted data of an action.
2558 *
2559 * One or more sessions may still need this data after the application destroys
2560 * its XrAction handle, so this data is refcounted.
2562 * @ingroup oxr_input
2563 *
2564 * @see oxr_action
2565 * @extends oxr_refcounted
2567struct oxr_action_ref
2568{
2569 struct oxr_refcounted base;
2570
2571 //! Application supplied name of this action.
2572 char name[XR_MAX_ACTION_NAME_SIZE];
2573
2574 //! Unique key for the session hashmap.
2575 uint32_t act_key;
2576
2577 //! Type this action was created with.
2578 XrActionType action_type;
2579
2580 //! Which sub action paths that this action was created with.
2582};
2583
2584/*!
2585 * A single action.
2586 *
2587 * Parent type/handle is @ref oxr_action_set
2588 *
2589 * For actual usage, an action is attached to a session: the corresponding data
2590 * is in @ref oxr_action_attachment
2592 * @ingroup oxr_input
2593 *
2594 * @obj{XrAction}
2595 * @extends oxr_handle_base
2596 */
2598{
2599 //! Common structure for things referred to by OpenXR handles.
2600 struct oxr_handle_base handle;
2602 //! Owner of this action.
2603 struct oxr_action_set *act_set;
2604
2605 //! The data for this action that must live as long as any session we
2606 //! are attached to.
2607 struct oxr_action_ref *data;
2609 /*!
2610 * Unique key for the session hashmap.
2612 * Duplicated from oxr_action_ref::act_key for efficiency.
2613 */
2614 uint32_t act_key;
2615
2616 //! The item in the name hashset.
2617 struct u_hashset_item *name_item;
2618
2619 //! The item in the localized hashset.
2620 struct u_hashset_item *loc_item;
2621};
2622
2623/*!
2624 * Debug object created by the client program.
2625 *
2626 * Parent type/handle is @ref oxr_instance
2628 * @obj{XrDebugUtilsMessengerEXT}
2629 */
2631{
2632 //! Common structure for things referred to by OpenXR handles.
2634
2635 //! Owner of this messenger.
2637
2638 //! Severities to submit to this messenger
2639 XrDebugUtilsMessageSeverityFlagsEXT message_severities;
2640
2641 //! Types to submit to this messenger
2642 XrDebugUtilsMessageTypeFlagsEXT message_types;
2643
2644 //! Callback function
2645 PFN_xrDebugUtilsMessengerCallbackEXT user_callback;
2646
2647 //! Opaque user data
2648 void *XR_MAY_ALIAS user_data;
2649};
2650
2651#ifdef OXR_HAVE_FB_passthrough
2652
2653struct oxr_passthrough
2654{
2655 struct oxr_handle_base handle;
2656
2657 struct oxr_session *sess;
2658
2659 XrPassthroughFlagsFB flags;
2660
2661 bool paused;
2662};
2663
2664struct oxr_passthrough_layer
2665{
2666 struct oxr_handle_base handle;
2667
2668 struct oxr_session *sess;
2669
2670 XrPassthroughFB passthrough;
2671
2672 XrPassthroughFlagsFB flags;
2673
2674 XrPassthroughLayerPurposeFB purpose;
2675
2676 bool paused;
2677
2678 XrPassthroughStyleFB style;
2679 XrPassthroughColorMapMonoToRgbaFB monoToRgba;
2680 XrPassthroughColorMapMonoToMonoFB monoToMono;
2681 XrPassthroughBrightnessContrastSaturationFB brightnessContrastSaturation;
2682};
2683
2684XrResult
2685oxr_passthrough_create(struct oxr_logger *log,
2686 struct oxr_session *sess,
2687 const XrPassthroughCreateInfoFB *createInfo,
2688 struct oxr_passthrough **out_passthrough);
2689
2690XrResult
2691oxr_passthrough_layer_create(struct oxr_logger *log,
2692 struct oxr_session *sess,
2693 const XrPassthroughLayerCreateInfoFB *createInfo,
2694 struct oxr_passthrough_layer **out_layer);
2695
2696static inline XrPassthroughFB
2697oxr_passthrough_to_openxr(struct oxr_passthrough *passthrough)
2698{
2699 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPassthroughFB, passthrough);
2700}
2701
2702static inline XrPassthroughLayerFB
2703oxr_passthrough_layer_to_openxr(struct oxr_passthrough_layer *passthroughLayer)
2704{
2705 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPassthroughLayerFB, passthroughLayer);
2706}
2707
2708XrResult
2709oxr_event_push_XrEventDataPassthroughStateChangedFB(struct oxr_logger *log,
2710 struct oxr_session *sess,
2711 XrPassthroughStateChangedFlagsFB flags);
2712
2713#endif // OXR_HAVE_FB_passthrough
2714
2715#ifdef OXR_HAVE_HTC_facial_tracking
2716/*!
2717 * HTC specific Facial tracker.
2718 *
2719 * Parent type/handle is @ref oxr_instance
2720 *
2721 *
2722 * @obj{XrFacialTrackerHTC}
2723 * @extends oxr_handle_base
2724 */
2725struct oxr_facial_tracker_htc
2726{
2727 //! Common structure for things referred to by OpenXR handles.
2728 struct oxr_handle_base handle;
2729
2730 //! Owner of this face tracker.
2731 struct oxr_session *sess;
2732
2733 //! xrt_device backing this face tracker
2734 struct xrt_device *xdev;
2735
2736 //! Type of facial tracking, eyes or lips
2737 enum xrt_facial_tracking_type_htc facial_tracking_type;
2738
2739 //! To track if the feature set has been incremented since creation.
2740 bool feature_incremented;
2741};
2742
2743XrResult
2744oxr_facial_tracker_htc_create(struct oxr_logger *log,
2745 struct oxr_session *sess,
2746 const XrFacialTrackerCreateInfoHTC *createInfo,
2747 struct oxr_facial_tracker_htc **out_face_tracker_htc);
2748
2749XrResult
2750oxr_get_facial_expressions_htc(struct oxr_logger *log,
2751 struct oxr_facial_tracker_htc *facial_tracker_htc,
2752 XrFacialExpressionsHTC *facialExpressions);
2753#endif
2754
2755#ifdef OXR_HAVE_FB_body_tracking
2756/*!
2757 * FB specific Body tracker.
2758 *
2759 * Parent type/handle is @ref oxr_instance
2760 *
2761 * @obj{XrBodyTrackerFB}
2762 * @extends oxr_handle_base
2763 */
2764struct oxr_body_tracker_fb
2765{
2766 //! Common structure for things referred to by OpenXR handles.
2767 struct oxr_handle_base handle;
2768
2769 //! Owner of this face tracker.
2770 struct oxr_session *sess;
2771
2772 //! xrt_device backing this face tracker
2773 struct xrt_device *xdev;
2774
2775 //! Type of the body joint set e.g. XR_FB_body_tracking or XR_META_body_tracking_full_body
2776 enum xrt_body_joint_set_type_fb joint_set_type;
2777};
2778
2779XrResult
2780oxr_create_body_tracker_fb(struct oxr_logger *log,
2781 struct oxr_session *sess,
2782 const XrBodyTrackerCreateInfoFB *createInfo,
2783 struct oxr_body_tracker_fb **out_body_tracker_fb);
2784
2785XrResult
2786oxr_get_body_skeleton_fb(struct oxr_logger *log,
2787 struct oxr_body_tracker_fb *body_tracker_fb,
2788 XrBodySkeletonFB *skeleton);
2789
2790XrResult
2791oxr_locate_body_joints_fb(struct oxr_logger *log,
2792 struct oxr_body_tracker_fb *body_tracker_fb,
2793 struct oxr_space *base_spc,
2794 const XrBodyJointsLocateInfoFB *locateInfo,
2795 XrBodyJointLocationsFB *locations);
2796#endif
2797
2798#ifdef OXR_HAVE_BD_body_tracking
2799/*!
2800 * BD (PICO) specific Body tracker.
2801 *
2802 * Parent type/handle is @ref oxr_session
2803 *
2804 * @obj{XrBodyTrackerBD}
2805 * @extends oxr_handle_base
2806 */
2807struct oxr_body_tracker_bd
2808{
2809 //! Common structure for things referred to by OpenXR handles.
2810 struct oxr_handle_base handle;
2811
2812 //! Owner of this body tracker.
2813 struct oxr_session *sess;
2814
2815 //! xrt_device backing this body tracker
2816 struct xrt_device *xdev;
2817
2818 //! Type of the body joint set (with or without arms)
2819 enum xrt_body_joint_set_type_bd joint_set_type;
2820};
2821
2822XrResult
2823oxr_create_body_tracker_bd(struct oxr_logger *log,
2824 struct oxr_session *sess,
2825 const XrBodyTrackerCreateInfoBD *createInfo,
2826 struct oxr_body_tracker_bd **out_body_tracker_bd);
2827
2828XrResult
2829oxr_locate_body_joints_bd(struct oxr_logger *log,
2830 struct oxr_body_tracker_bd *body_tracker_bd,
2831 struct oxr_space *base_spc,
2832 const XrBodyJointsLocateInfoBD *locateInfo,
2833 XrBodyJointLocationsBD *locations);
2834
2835bool
2836oxr_system_get_body_tracking_bd_support(struct oxr_logger *log, struct oxr_instance *inst);
2837#endif
2838
2839#ifdef OXR_HAVE_FB_face_tracking2
2840/*!
2841 * FB specific Face tracker2.
2842 *
2843 * Parent type/handle is @ref oxr_instance
2844 *
2845 * @obj{XrFaceTracker2FB}
2846 * @extends oxr_handle_base
2847 */
2848struct oxr_face_tracker2_fb
2849{
2850 //! Common structure for things referred to by OpenXR handles.
2851 struct oxr_handle_base handle;
2852
2853 //! Owner of this face tracker.
2854 struct oxr_session *sess;
2855
2856 //! xrt_device backing this face tracker
2857 struct xrt_device *xdev;
2858
2859 bool audio_enabled;
2860 bool visual_enabled;
2861
2862 //! To track if the feature set has been incremented since creation.
2863 bool feature_incremented;
2864};
2865
2866XrResult
2867oxr_face_tracker2_fb_create(struct oxr_logger *log,
2868 struct oxr_session *sess,
2869 const XrFaceTrackerCreateInfo2FB *createInfo,
2870 struct oxr_face_tracker2_fb **out_face_tracker2_fb);
2871
2872XrResult
2873oxr_get_face_expression_weights2_fb(struct oxr_logger *log,
2874 struct oxr_face_tracker2_fb *face_tracker2_fb,
2875 const XrFaceExpressionInfo2FB *expression_info,
2876 XrFaceExpressionWeights2FB *expression_weights);
2877#endif
2878
2879#ifdef OXR_HAVE_MNDX_xdev_space
2880/*!
2881 * Object that holds a list of the current @ref xrt_devices.
2882 *
2883 * Parent type/handle is @ref oxr_session
2884 *
2885 * @obj{XrXDevList}
2886 * @extends oxr_handle_base
2887 */
2888struct oxr_xdev_list
2889{
2890 //! Common structure for things referred to by OpenXR handles.
2891 struct oxr_handle_base handle;
2892
2893 //! Owner of this @ref xrt_device list.
2894 struct oxr_session *sess;
2895
2896 //! Monotonically increasing number.
2897 uint64_t generation_number;
2898
2899 uint64_t ids[XRT_SYSTEM_MAX_DEVICES];
2900 struct xrt_device *xdevs[XRT_SYSTEM_MAX_DEVICES];
2902
2903 //! Counts ids, names and xdevs.
2904 uint32_t device_count;
2905};
2906#endif // OXR_HAVE_MNDX_xdev_space
2907
2908#ifdef OXR_HAVE_EXT_plane_detection
2909/*!
2910 * A Plane Detector.
2911 *
2912 * Parent type/handle is @ref oxr_session
2913 *
2914 *
2915 * @obj{XrPlaneDetectorEXT}
2916 * @extends oxr_handle_base
2917 */
2918struct oxr_plane_detector_ext
2919{
2920 //! Common structure for things referred to by OpenXR handles.
2921 struct oxr_handle_base handle;
2922
2923 //! Owner of this anchor.
2924 struct oxr_session *sess;
2925
2926 //! Plane detector flags.
2928
2929 //! The last known state of this plane detector.
2930 XrPlaneDetectionStateEXT state;
2931
2932 //! Whether the last DONE plane detection has been retrieved from the xdev.
2933 bool retrieved;
2934
2935 //! The device that this plane detector belongs to.
2936 struct xrt_device *xdev;
2937
2938 //! Detected planes. xrt_plane_detector_locations_ext::relation is kept in xdev space and not updated.
2939 struct xrt_plane_detections_ext detections;
2940
2941 //! Corresponds to xrt_plane_detections_ext::locations, but with OpenXR types and transformed into target space.
2942 //! Enables two call idiom.
2943 XrPlaneDetectorLocationEXT *xr_locations;
2944
2945 //! A globally unique id for the current plane detection or 0, generated by the xrt_device.
2946 uint64_t detection_id;
2947};
2948#endif // OXR_HAVE_EXT_plane_detection
2949
2950#ifdef OXR_HAVE_EXT_future
2951/*!
2952 * EXT futures.
2953 *
2954 * Parent type/handle is @ref oxr_instance
2955 *
2956 * @obj{XrFutureEXT}
2957 * @extends oxr_handle_base
2958 */
2959struct oxr_future_ext
2960{
2961 //! Common structure for things referred to by OpenXR handles.
2962 struct oxr_handle_base handle;
2963
2964 //! (weak) reference to instance (may or not be a direct parent handle")
2965 struct oxr_instance *inst;
2966
2967 //! Owning session.
2968 struct oxr_session *sess;
2969
2970 //! xrt_future backing this future
2971 struct xrt_future *xft;
2972};
2973
2974/*!
2975 * To go back to a OpenXR object.
2976 *
2977 * @relates oxr_future_ext
2978 */
2979static inline XrFutureEXT
2980oxr_future_ext_to_openxr(struct oxr_future_ext *future_ext)
2981{
2982 return XRT_CAST_PTR_TO_OXR_HANDLE(XrFutureEXT, future_ext);
2983}
2984
2985XrResult
2986oxr_future_create(struct oxr_logger *log,
2987 struct oxr_session *sess,
2988 struct xrt_future *xft,
2989 struct oxr_handle_base *parent_handle,
2990 struct oxr_future_ext **out_oxr_future_ext);
2991
2992XrResult
2993oxr_future_invalidate(struct oxr_logger *log, struct oxr_future_ext *oxr_future);
2994
2995XrResult
2996oxr_future_ext_poll(struct oxr_logger *log, const struct oxr_future_ext *oxr_future, XrFuturePollResultEXT *pollResult);
2997
2998XrResult
2999oxr_future_ext_cancel(struct oxr_logger *log, struct oxr_future_ext *oxr_future);
3000
3001XrResult
3002oxr_future_ext_complete(struct oxr_logger *log,
3003 struct oxr_future_ext *oxr_future,
3004 struct xrt_future_result *out_ft_result);
3005
3006#endif
3007
3008#ifdef OXR_HAVE_EXT_user_presence
3009XrResult
3010oxr_event_push_XrEventDataUserPresenceChangedEXT(struct oxr_logger *log, struct oxr_session *sess, bool isUserPresent);
3011#endif // OXR_HAVE_EXT_user_presence
3012
3013#ifdef OXR_HAVE_ANDROID_face_tracking
3014/*!
3015 * Android specific Facial tracker.
3016 *
3017 * Parent type/handle is @ref oxr_instance
3018 *
3019 *
3020 * @obj{XrFaceTrackerANDROID}
3021 * @extends oxr_handle_base
3022 */
3023struct oxr_face_tracker_android
3024{
3025 //! Common structure for things referred to by OpenXR handles.
3026 struct oxr_handle_base handle;
3027
3028 //! Owner of this face tracker.
3029 struct oxr_session *sess;
3030
3031 //! xrt_device backing this face tracker
3032 struct xrt_device *xdev;
3033
3034 //! To track if the feature set has been incremented since creation.
3035 bool feature_incremented;
3036};
3037
3038XrResult
3039oxr_face_tracker_android_create(struct oxr_logger *log,
3040 struct oxr_session *sess,
3041 const XrFaceTrackerCreateInfoANDROID *createInfo,
3042 XrFaceTrackerANDROID *faceTracker);
3043
3044XrResult
3046 struct oxr_face_tracker_android *facial_tracker_android,
3047 const XrFaceStateGetInfoANDROID *getInfo,
3048 XrFaceStateANDROID *faceStateOutput);
3049
3050XrResult
3051oxr_get_face_calibration_state_android(struct oxr_logger *log,
3052 struct oxr_face_tracker_android *facial_tracker_android,
3053 XrBool32 *faceIsCalibratedOutput);
3054#endif // OXR_HAVE_ANDROID_face_tracking
3055
3056/*!
3057 * @}
3058 */
3059
3060
3061#ifdef __cplusplus
3062}
3063#endif
void oxr_action_set_attachment_teardown(struct oxr_action_set_attachment *act_set_attached)
De-initialize an action set attachment and its action attachments.
Definition: oxr_input.c:225
static void oxr_refcounted_unref(struct oxr_refcounted *orc)
Decrease the reference count of orc, destroying it if it reaches 0.
Definition: oxr_objects.h:2461
XrResult oxr_poll_event(struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuffer *eventData)
Will return one event if available, also drain the sessions event queues.
Definition: oxr_event.c:400
XrResult oxr_spaces_locate(struct oxr_logger *log, struct oxr_space **spcs, uint32_t spc_count, struct oxr_space *baseSpc, XrTime time, XrSpaceLocations *locations)
Definition: oxr_space.c:304
static XrSwapchain oxr_swapchain_to_openxr(struct oxr_swapchain *sc)
To go back to a OpenXR object.
Definition: oxr_objects.h:1021
oxr_image_state
Tracks the state of a image that belongs to a oxr_swapchain.
Definition: oxr_defines.h:97
XrResult oxr_path_get_or_create(struct oxr_logger *log, struct oxr_instance *inst, const char *str, size_t length, XrPath *out_path)
Get the path for the given string if it exists, or create it if it does not.
Definition: oxr_path.c:172
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
void oxr_binding_find_bindings_from_act_key(struct oxr_logger *log, struct oxr_interaction_profile *profile, uint32_t key, size_t max_binding_count, struct oxr_binding **out_bindings, size_t *out_binding_count)
Find all bindings that is the given action key is bound to.
Definition: oxr_binding.c:533
XrResult oxr_handle_destroy(struct oxr_logger *log, struct oxr_handle_base *hb)
Destroy the handle's object, as well as all child handles recursively.
Definition: oxr_handle_base.c:197
XrResult oxr_event_remove_session_events(struct oxr_logger *log, struct oxr_session *sess)
This clears all pending events refers to the given session.
Definition: oxr_event.c:368
static XrResult oxr_session_success_result(struct oxr_session *session)
Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate.
Definition: oxr_objects.h:1924
XrResult oxr_action_get_pose_input(struct oxr_session *sess, uint32_t act_key, const struct oxr_subaction_paths *subaction_paths_ptr, struct oxr_action_input **out_input)
Find the pose input for the set of subaction_paths.
Definition: oxr_input.c:476
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:1939
XrResult oxr_path_only_get(struct oxr_logger *log, struct oxr_instance *inst, const char *str, size_t length, XrPath *out_path)
Only get the path for the given string if it exists.
Definition: oxr_path.c:199
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:251
void oxr_find_profile_for_device(struct oxr_logger *log, struct oxr_session *sess, struct xrt_device *xdev, struct oxr_interaction_profile **out_p)
Find the best matching profile for the given xrt_device.
Definition: oxr_binding.c:507
XrResult oxr_session_attach_action_sets(struct oxr_logger *log, struct oxr_session *sess, const XrSessionActionSetsAttachInfo *bindInfo)
Definition: oxr_input.c:1801
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:594
static XrDebugUtilsMessengerEXT oxr_messenger_to_openxr(struct oxr_debug_messenger *mssngr)
To go back to a OpenXR object.
Definition: oxr_objects.h:1037
XrResult oxr_space_locate(struct oxr_logger *log, struct oxr_space *spc, struct oxr_space *baseSpc, XrTime time, XrSpaceLocation *location)
Definition: oxr_space.c:461
XrResult oxr_session_frame_end(struct oxr_logger *log, struct oxr_session *sess, const XrFrameEndInfo *frameEndInfo)
Definition: oxr_session_frame_end.c:1643
static XrInstance oxr_instance_to_openxr(struct oxr_instance *inst)
To go back to a OpenXR object.
Definition: oxr_objects.h:235
static XrHandTrackerEXT oxr_hand_tracker_to_openxr(struct oxr_hand_tracker *hand_tracker)
To go back to a OpenXR object.
Definition: oxr_objects.h:406
static XrActionSet oxr_action_set_to_openxr(struct oxr_action_set *act_set)
To go back to a OpenXR object.
Definition: oxr_objects.h:395
bool oxr_classify_subaction_paths(struct oxr_logger *log, const struct oxr_instance *inst, uint32_t subaction_path_count, const XrPath *subaction_paths, struct oxr_subaction_paths *subaction_paths_out)
Helper function to classify subaction_paths.
Definition: oxr_input.c:432
static bool oxr_subaction_paths_is_subset_of(const struct oxr_subaction_paths *a, const struct oxr_subaction_paths *b)
Helper function to determine if the set of paths in a is a subset of the paths in b.
Definition: oxr_objects.h:2110
static XrSession oxr_session_to_openxr(struct oxr_session *sess)
To go back to a OpenXR object.
Definition: oxr_objects.h:824
oxr_session_graphics_ext
What graphics API was this session created with.
Definition: oxr_defines.h:128
static XrAction oxr_action_to_openxr(struct oxr_action *act)
To go back to a OpenXR object.
Definition: oxr_objects.h:430
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:91
oxr_space_type
Internal enum for the type of space, lets us reason about action spaces.
Definition: oxr_defines.h:109
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
static void oxr_refcounted_ref(struct oxr_refcounted *orc)
Increase the reference count of orc.
Definition: oxr_objects.h:2452
void oxr_binding_destroy_all(struct oxr_logger *log, struct oxr_instance *inst)
Free all memory allocated by the binding system.
Definition: oxr_binding.c:696
XrResult oxr_session_request_exit(struct oxr_logger *log, struct oxr_session *sess)
Definition: oxr_session.c:462
XrResult(* oxr_handle_destroyer)(struct oxr_logger *log, struct oxr_handle_base *hb)
Function pointer type for a handle destruction function.
Definition: oxr_objects.h:149
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:243
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:248
XrResult oxr_create_messenger(struct oxr_logger *, struct oxr_instance *inst, const XrDebugUtilsMessengerCreateInfoEXT *, struct oxr_debug_messenger **out_mssngr)
Definition: oxr_messenger.c:41
void oxr_session_binding_destroy_all(struct oxr_logger *log, struct oxr_session *sess)
Free all memory allocated by the binding system.
Definition: oxr_binding.c:704
XrResult oxr_instance_init_system_locked(struct oxr_logger *log, struct oxr_instance *inst)
Must be called with oxr_instance::system_init_lock held.
Definition: oxr_instance.c:486
XrResult oxr_path_get_string(struct oxr_logger *log, const struct oxr_instance *inst, XrPath path, const char **out_str, size_t *out_length)
Get a pointer and length of the internal string.
Definition: oxr_path.c:216
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:626
XrResult oxr_session_frame_wait(struct oxr_logger *log, struct oxr_session *sess, XrFrameState *frameState)
Definition: oxr_session.c:937
oxr_handle_state
State of a handle base, to reduce likelihood of going "boom" on out-of-order destruction or other uns...
Definition: oxr_defines.h:51
XrResult oxr_instance_create(struct oxr_logger *log, const XrInstanceCreateInfo *createInfo, XrVersion major_minor, const struct oxr_extension_status *extensions, struct oxr_instance **out_inst)
Creates a instance, does minimal validation of createInfo.
Definition: oxr_instance.c:247
static XrSpace oxr_space_to_openxr(struct oxr_space *spc)
To go back to a OpenXR object.
Definition: oxr_objects.h:930
oxr_subaction_path
Sub action paths.
Definition: oxr_defines.h:68
XrResult oxr_vk_create_vulkan_device(struct oxr_logger *log, struct oxr_system *sys, const XrVulkanDeviceCreateInfoKHR *createInfo, VkDevice *vulkanDevice, VkResult *vulkanResult)
Definition: oxr_vulkan.c:386
const char * oxr_handle_state_to_string(enum oxr_handle_state state)
Returns a human-readable label for a handle state.
Definition: oxr_handle_base.c:42
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:110
#define XRT_CAST_PTR_TO_OXR_HANDLE(HANDLE_TYPE, PTR)
Cast a pointer to an OpenXR handle in such a way as to avoid warnings.
Definition: oxr_objects.h:76
static XRT_CHECK_RESULT bool xrt_reference_dec_and_is_zero(struct xrt_reference *xref)
Decrement the reference and return true if the value is now zero.
Definition: xrt_defines.h:2502
#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:915
static void xrt_reference_inc(struct xrt_reference *xref)
Increment the reference, probably want xrt_reference_inc_and_was_zero.
Definition: xrt_defines.h:2458
xrt_output_name
Name of a output with a baked in type.
Definition: xrt_defines.h:1582
xrt_plane_detector_flags_ext
Flags used when running plane detection.
Definition: xrt_plane_detector.h:46
Wrapper around OS threading native functions.
XrResult oxr_action_get_input_source_localized_name(struct oxr_logger *log, struct oxr_session *sess, const XrInputSourceLocalizedNameGetInfo *getInfo, uint32_t bufferCapacityInput, uint32_t *bufferCountOutput, char *buffer)
Definition: oxr_binding.c:784
Shared internal defines and enums in the state tracker.
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:76
The objects that handle session running status and blocking of xrWaitFrame.
XrResult oxr_action_sync_data(struct oxr_logger *log, struct oxr_session *sess, uint32_t countActionSets, const XrActiveActionSet *actionSets, const XrActiveActionSetPrioritiesEXT *activePriorities)
Definition: oxr_input.c:1888
#define OXR_PATH_MEMBER(X)
Currently bound interaction profile.
Definition: oxr_objects.h:1883
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:39
#define OXR_FOR_EACH_VALID_SUBACTION_PATH(_)
Expansion macro (x-macro) that calls the macro you pass with the shorthand name of each valid subacti...
Definition: oxr_subaction.h:23
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:2263
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:2287
struct oxr_action_ref * act_ref
This action's refcounted data.
Definition: oxr_objects.h:2268
struct oxr_action_set_attachment * act_set_attached
The owning action set attachment.
Definition: oxr_objects.h:2265
uint32_t act_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2279
struct oxr_session * sess
The corresponding session.
Definition: oxr_objects.h:2276
The set of inputs/outputs for a single sub-action path for an action.
Definition: oxr_objects.h:2241
A input action pair of a xrt_input and a xrt_device, along with the required transform.
Definition: oxr_objects.h:2202
A output action pair of a xrt_output_name and a xrt_device.
Definition: oxr_objects.h:2221
The reference-counted data of an action.
Definition: oxr_objects.h:2562
char name[XR_MAX_ACTION_NAME_SIZE]
Application supplied name of this action.
Definition: oxr_objects.h:2566
struct oxr_subaction_paths subaction_paths
Which sub action paths that this action was created with.
Definition: oxr_objects.h:2575
XrActionType action_type
Type this action was created with.
Definition: oxr_objects.h:2572
uint32_t act_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2569
The data associated with the attachment of an Action Set (oxr_action_set) to as Session (oxr_session)...
Definition: oxr_objects.h:2134
struct oxr_action_attachment * act_attachments
An array of action attachments we own.
Definition: oxr_objects.h:2148
struct oxr_session * sess
Owning session.
Definition: oxr_objects.h:2136
struct oxr_action_set_ref * act_set_ref
Action set refcounted data.
Definition: oxr_objects.h:2139
uint32_t act_set_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2142
size_t action_attachment_count
Length of oxr_action_set_attachment::act_attachments.
Definition: oxr_objects.h:2153
struct oxr_subaction_paths requested_subaction_paths
Which sub-action paths are requested on the latest sync.
Definition: oxr_objects.h:2145
The reference-counted data of an action set.
Definition: oxr_objects.h:2480
uint32_t act_set_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2493
char name[XR_MAX_ACTION_SET_NAME_SIZE]
Application supplied name of this action.
Definition: oxr_objects.h:2484
bool ever_attached
Has this action set even been attached to any session, marking it as immutable.
Definition: oxr_objects.h:2490
uint32_t priority
Application supplied action set priority.
Definition: oxr_objects.h:2496
A group of actions.
Definition: oxr_objects.h:2522
struct u_hashset_item * name_item
The item in the name hashset.
Definition: oxr_objects.h:2544
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition: oxr_objects.h:2547
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:2533
uint32_t act_set_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2541
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:2524
struct oxr_instance * inst
Owner of this action set.
Definition: oxr_objects.h:2527
The state of a action input.
Definition: oxr_objects.h:2176
bool active
Is this active (bound and providing input)?
Definition: oxr_objects.h:2183
XrTime timestamp
When was this last changed.
Definition: oxr_objects.h:2189
A single action.
Definition: oxr_objects.h:2592
struct oxr_action_set * act_set
Owner of this action.
Definition: oxr_objects.h:2597
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:2594
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition: oxr_objects.h:2614
uint32_t act_key
Unique key for the session hashmap.
Definition: oxr_objects.h:2608
struct u_hashset_item * name_item
The item in the name hashset.
Definition: oxr_objects.h:2611
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:2601
Interaction profile binding state.
Definition: oxr_objects.h:2042
uint32_t * preferred_binding_path_index
store which entry in paths was suggested, for each action key
Definition: oxr_objects.h:2054
const char * localized_name
Name presented to the user.
Definition: oxr_objects.h:2047
Debug object created by the client program.
Definition: oxr_objects.h:2625
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:2627
XrDebugUtilsMessageTypeFlagsEXT message_types
Types to submit to this messenger.
Definition: oxr_objects.h:2636
PFN_xrDebugUtilsMessengerCallbackEXT user_callback
Callback function.
Definition: oxr_objects.h:2639
struct oxr_instance * inst
Owner of this messenger.
Definition: oxr_objects.h:2630
void *XR_MAY_ALIAS user_data
Opaque user data.
Definition: oxr_objects.h:2642
XrDebugUtilsMessageSeverityFlagsEXT message_severities
Severities to submit to this messenger.
Definition: oxr_objects.h:2633
dpad binding extracted from XrInteractionProfileDpadBindingEXT
Definition: oxr_objects.h:1974
dpad emulation settings from oxr_interaction_profile
Definition: oxr_objects.h:2008
A entry in the dpad state for one action set.
Definition: oxr_objects.h:1985
dpad settings we need extracted from XrInteractionProfileDpadBindingEXT
Definition: oxr_objects.h:1962
Holds dpad binding state for a single interaction profile.
Definition: oxr_objects.h:2000
Definition: oxr_event.c:30
Structure tracking which extensions are enabled for a given instance.
Definition: oxr_objects.h:1612
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:58
Used to hold diverse child handles and ensure orderly destruction.
Definition: oxr_objects.h:1485
struct oxr_handle_base * parent
Pointer to this object's parent handle holder, if any.
Definition: oxr_objects.h:1492
uint64_t debug
Magic (per-handle-type) value for debugging.
Definition: oxr_objects.h:1487
struct oxr_handle_base * children[256]
Array of children, if any.
Definition: oxr_objects.h:1497
enum oxr_handle_state state
Current handle state.
Definition: oxr_objects.h:1502
oxr_handle_destroyer destroy
Destroy the object this handle refers to.
Definition: oxr_objects.h:1507
Variant type for input transforms.
Definition: oxr_input_transform.h:144
Main object that ties everything together.
Definition: oxr_objects.h:1626
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:1710
bool parallel_views
For applications that rely on views being parallel, notably some OpenVR games with OpenComposite.
Definition: oxr_objects.h:1735
size_t path_num
Number of paths in the array (0 is always null).
Definition: oxr_objects.h:1665
struct oxr_instance::@286 openxr_version
The OpenXR version requested in the app info. It determines the instance's OpenXR version.
bool disable_vulkan_format_depth_stencil
Some applications can't handle depth stencil formats, or they trigger a bug in a specific version of ...
Definition: oxr_objects.h:1723
XrVersion major_minor
Stores only major.minor version. Simplifies comparisons for e.g. "at least OpenXR 1....
Definition: oxr_objects.h:1641
bool skip_end_session
Unreal 4 has a bug calling xrEndSession; the function should just exit.
Definition: oxr_objects.h:1726
struct oxr_path ** path_array
Mapping from ID to path.
Definition: oxr_objects.h:1661
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:1732
size_t path_array_length
Total length of path array.
Definition: oxr_objects.h:1663
struct oxr_extension_status extensions
Enabled extensions.
Definition: oxr_objects.h:1635
struct oxr_debug_messenger * messengers[256]
Debug messengers.
Definition: oxr_objects.h:1749
struct u_hashset * path_store
Path store, for looking up paths.
Definition: oxr_objects.h:1659
bool map_stage_to_local_floor
For applications that use stage and don't offer recentering.
Definition: oxr_objects.h:1738
struct oxr_interaction_profile ** profiles
Interaction profile bindings that have been suggested by the client.
Definition: oxr_objects.h:1676
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:1628
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:1745
A single interaction profile.
Definition: oxr_objects.h:2020
enum xrt_device_name xname
Used to lookup xrt_binding_profile for fallback.
Definition: oxr_objects.h:2024
const char * localized_name
Name presented to the user.
Definition: oxr_objects.h:2027
Logger struct that lives on the stack, one for each call client call.
Definition: oxr_logger.h:40
Internal representation of a path, item follows this struct in memory and that in turn is followed by...
Definition: oxr_path.c:28
Definition: oxr_objects.h:2442
void(* destroy)(struct oxr_refcounted *)
Destruction callback.
Definition: oxr_objects.h:2445
Helper struct that wraps xrt_system_roles for OpenXR state tracker usage.
Definition: oxr_roles.h:30
Object that client program interact with.
Definition: oxr_objects.h:1774
struct u_hashmap_int * act_attachments_by_key
A map of action key to action attachment.
Definition: oxr_objects.h:1863
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:1906
struct xrt_compositor_native * xcn
Native compositor that is wrapped by client compositors.
Definition: oxr_objects.h:1786
struct xrt_space_relation local_space_pure_relation
initial relation of head in "global" space.
Definition: oxr_objects.h:1913
struct xrt_session * xs
The xrt_session backing this session.
Definition: oxr_objects.h:1783
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:1799
struct oxr_action_set_attachment * act_set_attachments
An array of action set attachments that this session owns.
Definition: oxr_objects.h:1837
uint32_t frame_timing_wait_sleep_ms
Extra sleep in wait frame.
Definition: oxr_objects.h:1901
struct os_precise_sleeper sleeper
Used to implement precise extra sleeping in wait frame.
Definition: oxr_objects.h:1829
uint64_t dynamic_roles_generation_id
Cache of the last known system roles generation_id.
Definition: oxr_objects.h:1873
enum oxr_session_graphics_ext gfx_ext
What graphics type was this session created with.
Definition: oxr_objects.h:1780
size_t profiles_on_attachment_size
Clone of all suggested binding profiles at the point of action set/session attachment.
Definition: oxr_objects.h:1869
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:1805
struct u_hashmap_int * act_sets_attachments_by_key
A map of action set key to action set attachments.
Definition: oxr_objects.h:1851
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:1776
float ipd_meters
IPD, to be expanded to a proper 3D relation.
Definition: oxr_objects.h:1893
struct os_mutex sync_actions_mutex
Protects access to dynamic_roles_generation_id during sync actions.
Definition: oxr_objects.h:1876
size_t action_set_attachment_count
Length of oxr_session::act_set_attachments.
Definition: oxr_objects.h:1842
bool frame_timing_spew
Frame timing debug output.
Definition: oxr_objects.h:1898
Can be one of several reference space types, or a space that is bound to an action.
Definition: oxr_objects.h:2335
struct oxr_subaction_paths subaction_paths
Which sub action path is this?
Definition: oxr_objects.h:2352
enum oxr_space_type space_type
What kind of space is this?
Definition: oxr_objects.h:2349
uint32_t act_key
Action key from which action this space was created from.
Definition: oxr_objects.h:2346
struct xrt_pose pose
Pose that was given during creation.
Definition: oxr_objects.h:2343
struct oxr_session * sess
Owner of this space.
Definition: oxr_objects.h:2340
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:2337
A parsed equivalent of a list of sub-action paths.
Definition: oxr_objects.h:2097
A set of images used for rendering.
Definition: oxr_objects.h:2378
struct oxr_session * sess
Owner of this swapchain.
Definition: oxr_objects.h:2383
uint32_t face_count
The number of cubemap faces. 6 for cubemaps, 1 otherwise.
Definition: oxr_objects.h:2395
struct xrt_swapchain * swapchain
Compositor swapchain.
Definition: oxr_objects.h:2386
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition: oxr_objects.h:2380
uint32_t width
Swapchain size.
Definition: oxr_objects.h:2389
uint32_t array_layer_count
For 1 is 2D texture, greater then 1 2D array texture.
Definition: oxr_objects.h:2392
Single or multiple devices grouped together to form a system that sessions can be created from.
Definition: oxr_objects.h:1538
struct xrt_system * xsys
The XRT interfaces level system.
Definition: oxr_objects.h:1542
VkPhysicalDevice suggested_vulkan_physical_device
The device returned with the last xrGetVulkanGraphicsDeviceKHR or xrGetVulkanGraphicsDevice2KHR call.
Definition: oxr_objects.h:1575
PFN_vkGetInstanceProcAddr vk_get_instance_proc_addr
Stores the vkGetInstanceProcAddr passed to xrCreateVulkanInstanceKHR to be used when looking up Vulka...
Definition: oxr_objects.h:1581
struct xrt_system_devices * xsysd
System devices used in all session types.
Definition: oxr_objects.h:1545
struct xrt_space_overseer * xso
Space overseer used in all session types.
Definition: oxr_objects.h:1548
VkInstance vulkan_enable2_instance
The instance/device we create when vulkan_enable2 is used.
Definition: oxr_objects.h:1572
bool gotten_requirements
Have the client application called the gfx api requirements func?
Definition: oxr_objects.h:1556
struct xrt_system_compositor * xsysc
System compositor, used to create session compositors.
Definition: oxr_objects.h:1551
Holds the properties that a system supports for a view configuration type.
Definition: oxr_objects.h:1516
Time-keeping state structure.
Definition: u_time.cpp:30
A simple uint64_t key to a void pointer hashmap.
Definition: u_hashmap.cpp:24
A embeddable hashset item, note that the string directly follows the u_hashset_item.
Definition: u_hashset.h:37
Kind of bespoke hashset implementation, where the user is responsible for allocating and freeing the ...
Definition: u_hashset.cpp:26
Definition: u_index_fifo.h:21
Definition: xrt_defines.h:2258
Main compositor server interface.
Definition: xrt_compositor.h:2236
Common compositor client interface/base.
Definition: xrt_compositor.h:992
A single HMD or input device.
Definition: xrt_device.h:310
enum xrt_device_name name
Enum identifier of the device.
Definition: xrt_device.h:312
The (future) result of an asynchronous operation.
Definition: xrt_future.h:39
A future is a concurrency primitive that provides a mechanism to access results of asynchronous opera...
Definition: xrt_future.h:75
A single named input, that sits on a xrt_device.
Definition: xrt_device.h:188
This interface acts as a root object for Monado.
Definition: xrt_instance.h:120
A single named output, that sits on a xrt_device.
Definition: xrt_device.h:206
Each plane has n polygons; ultimately plane metadata from xrt_plane_detections_ext::locations and xrt...
Definition: xrt_plane_detector.h:172
A pose composed of a position and orientation.
Definition: xrt_defines.h:479
A base class for reference counted objects.
Definition: xrt_defines.h:99
The XRT representation of XrSession, this object does not have all of the functionality of a session,...
Definition: xrt_session.h:277
Object that oversees and manages spaces, one created for each XR system.
Definition: xrt_space.h:97
A relation with two spaces, includes velocity and acceleration.
Definition: xrt_defines.h:670
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:540
The system compositor handles composition for a system.
Definition: xrt_compositor.h:2448
A collection of xrt_device, and an interface for identifying the roles they have been assigned.
Definition: xrt_system.h:214
A system is a collection of devices, policies and optionally a compositor that is organised into a ch...
Definition: xrt_system.h:63
Visibility mask helper, the indices and vertices are tightly packed after this struct.
Definition: xrt_visibility_mask.h:26
Misc helpers for device drivers.
Hashmap for integer values header.
Hashset struct header.
A FIFO for indices.
A union of all input types.
Definition: xrt_defines.h:1507
Header holding Android-specific details.
xrt_android_lifecycle_event
Distinguishes the possible Android lifecycle events from each other.
Definition: xrt_android.h:43
Header declaring XRT graphics interfaces.
Auto detect OS and certain features.
xrt_perf_notify_level
Performance level.
Definition: xrt_defines.h:2412
xrt_device_name
A enum that is used to name devices so that the state trackers can reason about the devices easier.
Definition: xrt_defines.h:724
xrt_perf_domain
Domain type.
Definition: xrt_defines.h:2385
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.