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