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
969XrResult
970oxr_egl_get_device(struct oxr_logger *log,
971 struct oxr_system *sys,
972 PFN_xrEglGetProcAddressMNDX getProcAddress,
973 EGLDeviceEXT *out_egl_device);
974
975#endif
976
977/*
978 *
979 * D3D version independent routines, located in oxr_d3d.cpp
980 *
981 */
982
983#if defined(XRT_HAVE_D3D11) || defined(XRT_HAVE_D3D12) || defined(XRT_DOXYGEN)
984/// Common GetRequirements call for D3D11 and D3D12
985XrResult
987 struct oxr_system *sys,
988 LUID *adapter_luid,
989 D3D_FEATURE_LEVEL *min_feature_level);
990
991/// Verify the provided LUID matches the expected one in @p sys
992XrResult
993oxr_d3d_check_luid(struct oxr_logger *log, struct oxr_system *sys, LUID *adapter_luid);
994#endif
995
996/*
997 *
998 * D3D11, located in various files.
999 *
1000 */
1001
1002#ifdef XR_USE_GRAPHICS_API_D3D11
1003
1004XrResult
1005oxr_d3d11_get_requirements(struct oxr_logger *log,
1006 struct oxr_system *sys,
1007 XrGraphicsRequirementsD3D11KHR *graphicsRequirements);
1008
1009/**
1010 * @brief Check to ensure the device provided at session create matches the LUID we returned earlier.
1011 *
1012 * @return XR_SUCCESS if the device matches the LUID
1013 */
1014XrResult
1015oxr_d3d11_check_device(struct oxr_logger *log, struct oxr_system *sys, ID3D11Device *device);
1016
1017
1018XrResult
1019oxr_session_populate_d3d11(struct oxr_logger *log,
1020 struct oxr_system *sys,
1021 XrGraphicsBindingD3D11KHR const *next,
1022 struct oxr_session *sess);
1023
1024XrResult
1025oxr_swapchain_d3d11_create(struct oxr_logger *,
1026 struct oxr_session *sess,
1027 const XrSwapchainCreateInfo *,
1028 struct oxr_swapchain **out_swapchain);
1029
1030#endif
1031
1032/*
1033 *
1034 * D3D12, located in various files.
1035 *
1036 */
1037
1038#ifdef XR_USE_GRAPHICS_API_D3D12
1039
1040XrResult
1041oxr_d3d12_get_requirements(struct oxr_logger *log,
1042 struct oxr_system *sys,
1043 XrGraphicsRequirementsD3D12KHR *graphicsRequirements);
1044
1045/**
1046 * @brief Check to ensure the device provided at session create matches the LUID we returned earlier.
1047 *
1048 * @return XR_SUCCESS if the device matches the LUID
1049 */
1050XrResult
1051oxr_d3d12_check_device(struct oxr_logger *log, struct oxr_system *sys, ID3D12Device *device);
1052
1053
1054XrResult
1055oxr_session_populate_d3d12(struct oxr_logger *log,
1056 struct oxr_system *sys,
1057 XrGraphicsBindingD3D12KHR const *next,
1058 struct oxr_session *sess);
1059
1060XrResult
1061oxr_swapchain_d3d12_create(struct oxr_logger *,
1062 struct oxr_session *sess,
1063 const XrSwapchainCreateInfo *,
1064 struct oxr_swapchain **out_swapchain);
1065
1066#endif
1067
1068/*
1069 *
1070 * Structs
1071 *
1072 */
1073
1074
1075/*!
1076 * Used to hold diverse child handles and ensure orderly destruction.
1077 *
1078 * Each object referenced by an OpenXR handle should have one of these as its
1079 * first element, thus "extending" this class.
1080 */
1082{
1083 //! Magic (per-handle-type) value for debugging.
1084 uint64_t debug;
1085
1086 /*!
1087 * Pointer to this object's parent handle holder, if any.
1088 */
1090
1091 /*!
1092 * Array of children, if any.
1093 */
1094 struct oxr_handle_base *children[XRT_MAX_HANDLE_CHILDREN];
1095
1096 /*!
1097 * Current handle state.
1098 */
1100
1101 /*!
1102 * Destroy the object this handle refers to.
1103 */
1105};
1106
1107/*!
1108 * Holds the properties that a system supports for a view configuration type.
1109 *
1110 * @relates oxr_system
1111 */
1113{
1114 XrViewConfigurationType view_config_type;
1115
1116 uint32_t view_count;
1117 XrViewConfigurationView views[XRT_MAX_COMPOSITOR_VIEW_CONFIGS_VIEW_COUNT];
1118
1119 uint32_t blend_mode_count;
1120 XrEnvironmentBlendMode blend_modes[3];
1121};
1122
1123/*!
1124 * Single or multiple devices grouped together to form a system that sessions
1125 * can be created from. Might need to open devices to get all
1126 * properties from it, but shouldn't.
1127 *
1128 * Not strictly an object, but an atom.
1129 *
1130 * Valid only within an XrInstance (@ref oxr_instance)
1131 *
1132 * @obj{XrSystemId}
1133 */
1135{
1136 struct oxr_instance *inst;
1137
1138 //! The @ref xrt_iface level system.
1140
1141 //! System devices used in all session types.
1143
1144 //! Space overseer used in all session types.
1146
1147 //! System compositor, used to create session compositors.
1149
1150 XrSystemId systemId;
1151
1152 //! Have the client application called the gfx api requirements func?
1154
1155 uint32_t view_config_count;
1156 struct oxr_view_config_properties view_configs[XRT_MAX_COMPOSITOR_VIEW_CONFIGS_COUNT];
1157
1158 XrReferenceSpaceType reference_spaces[5];
1159 uint32_t reference_space_count;
1160
1161 struct xrt_visibility_mask *visibility_mask[2];
1162
1163#ifdef OXR_HAVE_MNDX_xdev_space
1164 bool supports_xdev_space;
1165#endif
1166
1167#ifdef XR_USE_GRAPHICS_API_VULKAN
1168 //! The instance/device we create when vulkan_enable2 is used
1170 //! The device returned with the last xrGetVulkanGraphicsDeviceKHR or xrGetVulkanGraphicsDevice2KHR call.
1171 //! XR_NULL_HANDLE if neither has been called.
1173
1174 /*!
1175 * Stores the vkGetInstanceProcAddr passed to xrCreateVulkanInstanceKHR to be
1176 * used when looking up Vulkan functions used by xrGetVulkanGraphicsDevice2KHR.
1177 */
1178 PFN_vkGetInstanceProcAddr vk_get_instance_proc_addr;
1179
1180 struct
1181 {
1182 // No better place to keep this state.
1183 bool external_fence_fd_enabled;
1184 bool external_semaphore_fd_enabled;
1185 bool timeline_semaphore_enabled;
1186 bool debug_utils_enabled;
1187 bool image_format_list_enabled;
1188 } vk;
1189
1190#endif
1191
1192#if defined(XR_USE_GRAPHICS_API_D3D11) || defined(XR_USE_GRAPHICS_API_D3D12)
1193 LUID suggested_d3d_luid;
1194 bool suggested_d3d_luid_valid;
1195#endif
1196};
1197
1198/*
1199 * Extensions helpers.
1200 */
1201
1202#define MAKE_EXT_STATUS(mixed_case, all_caps) bool mixed_case;
1203/*!
1204 * Structure tracking which extensions are enabled for a given instance.
1205 *
1206 * Names are systematic: the extension name with the XR_ prefix removed.
1207 */
1209{
1210 OXR_EXTENSION_SUPPORT_GENERATE(MAKE_EXT_STATUS)
1211};
1212#undef MAKE_EXT_STATUS
1213
1214/*!
1215 * Main object that ties everything together.
1216 *
1217 * No parent type/handle: this is the root handle.
1218 *
1219 * @obj{XrInstance}
1220 * @extends oxr_handle_base
1221 */
1223{
1224 //! Common structure for things referred to by OpenXR handles.
1226
1227 struct u_debug_gui *debug_ui;
1228
1229 struct xrt_instance *xinst;
1230
1231 //! Enabled extensions
1233
1234 //! The OpenXR version requested in the app info. It determines the instance's OpenXR version.
1235 struct
1236 {
1237 //! Stores only major.minor version. Simplifies comparisons for e.g. "at least OpenXR 1.1".
1238 XrVersion major_minor;
1240
1241 // Protects the function oxr_instance_init_system_locked.
1242 struct os_mutex system_init_lock;
1243
1244 // Hardcoded single system.
1245 struct oxr_system system;
1246
1247 struct time_state *timekeeping;
1248
1249 //! Path store for managing paths.
1251
1252 // Event queue.
1253 struct
1254 {
1255 struct os_mutex mutex;
1256 struct oxr_event *last;
1257 struct oxr_event *next;
1258 } event;
1259
1260 struct oxr_session *sessions;
1261
1262 //! Path cache for actions, needs path_store to work.
1264
1265 //! The default action context (reference-counted). Owned by instance; action sets also hold references.
1267
1268 struct
1269 {
1270 struct
1271 {
1272 struct
1273 {
1274 uint32_t major;
1275 uint32_t minor;
1276 uint32_t patch;
1277 const char *name; //< Engine name, not freed.
1278 } engine;
1279 } detected;
1280 } appinfo;
1281
1282 struct
1283 {
1284 /*!
1285 * Some applications can't handle depth formats, or they trigger
1286 * a bug in a specific version of the application or engine.
1287 * This flag only disables depth formats
1288 * @see disable_vulkan_format_depth_stencil for depth-stencil formats.
1289 */
1291
1292 /*!
1293 * Some applications can't handle depth stencil formats, or they
1294 * trigger a bug in a specific version of the application or
1295 * engine.
1296 *
1297 * This flag only disables depth-stencil formats,
1298 * @see disable_vulkan_format_depth flag for depth only formats.
1299 *
1300 * In the past it was used to work around a bug in Unreal's
1301 * VulkanRHI backend.
1302 */
1304
1305 //! Unreal 4 has a bug calling xrEndSession; the function should just exit
1307
1308 /*!
1309 * Return XR_ERROR_REFERENCE_SPACE_UNSUPPORTED instead of
1310 * XR_ERROR_VALIDATION_FAILURE in xrCreateReferenceSpace.
1311 */
1313
1314 //! For applications that rely on views being parallel, notably some OpenVR games with OpenComposite.
1316
1317 //! For applications that use stage and don't offer recentering.
1319
1320 /*!
1321 * Beat Saber submits its projection layer with XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT set.
1322 * This breaks rendering because the game uses the alpha texture to store data for the bloom shader,
1323 * causing most of the game to render as black, only showing glowing parts of the image.
1324 */
1326
1327 /*!
1328 * Don't return XR_ERROR_VALIDATION_FAILURE if an
1329 * application sets unsupported usage flags when
1330 * calling xrCreateSwapchain.
1331 */
1333 } quirks;
1334
1335 //! Debug messengers
1336 struct oxr_debug_messenger *messengers[XRT_MAX_HANDLE_CHILDREN];
1337
1338 bool lifecycle_verbose;
1339 bool debug_views;
1340 bool debug_spaces;
1341 bool debug_bindings;
1342
1343#ifdef XRT_FEATURE_RENDERDOC
1344 RENDERDOC_API_1_4_1 *rdoc_api;
1345#endif
1346
1347#ifdef XRT_OS_ANDROID
1348 enum xrt_android_lifecycle_event activity_state;
1349#endif // XRT_OS_ANDROID
1350};
1351
1352/*
1353 * This includes needs to be here because it has static inline functions that
1354 * de-references the oxr_instance object. This refactor was made mid-patchset
1355 * so doing too many changes to other files would have been really disruptive
1356 * but this include will be removed soon.
1357 */
1358#include "path/oxr_path_wrappers.h"
1359
1360
1361/*!
1362 * Object that client program interact with.
1363 *
1364 * Parent type/handle is @ref oxr_instance
1365 *
1366 * @obj{XrSession}
1367 * @extends oxr_handle_base
1368 */
1370{
1371 //! Common structure for things referred to by OpenXR handles.
1373 struct oxr_system *sys;
1374
1375 //! What graphics type was this session created with.
1377
1378 //! The @ref xrt_session backing this session.
1380
1381 //! Native compositor that is wrapped by client compositors.
1383
1384 struct xrt_compositor *compositor;
1385
1386 struct oxr_session *next;
1387
1388 XrSessionState state;
1389
1390 /*!
1391 * This is set in xrBeginSession and is the primaryViewConfiguration
1392 * argument, this is then used in xrEndFrame to know which view
1393 * configuration the application is submitting it's frame in.
1394 */
1395 XrViewConfigurationType current_view_config_type;
1396
1397 /*!
1398 * There is a extra state between xrBeginSession has been called and
1399 * the first xrEndFrame has been called. These are to track this.
1400 */
1402
1403 bool compositor_visible;
1404 bool compositor_focused;
1405
1406 // the number of xrWaitFrame calls that did not yet have a corresponding
1407 // xrEndFrame or xrBeginFrame (discarded frame) call
1408 int active_wait_frames;
1409 struct os_mutex active_wait_frames_lock;
1410
1411 bool frame_started;
1412 bool exiting;
1413
1414 struct
1415 {
1416 int64_t waited;
1417 int64_t begun;
1418 } frame_id;
1419
1420 struct oxr_frame_sync frame_sync;
1421
1422 /*!
1423 * Used to implement precise extra sleeping in wait frame.
1424 */
1426
1427 /*!
1428 * Holds all the action state that belongs on the session level.
1429 */
1431
1432 /*!
1433 * Per-session map of action key to action attachment (thread-safe).
1434 */
1436
1437 /*!
1438 * IPD, to be expanded to a proper 3D relation.
1439 */
1441
1442 /*!
1443 * Frame timing debug output.
1444 */
1446
1447 //! Extra sleep in wait frame.
1449
1450 /*!
1451 * To pipe swapchain creation to right code.
1452 */
1453 XrResult (*create_swapchain)(struct oxr_logger *,
1454 struct oxr_session *sess,
1455 const XrSwapchainCreateInfo *,
1456 struct oxr_swapchain **);
1457
1458 /*! initial relation of head in "global" space.
1459 * Used as reference for local space. */
1460 // struct xrt_space_relation local_space_pure_relation;
1461
1463};
1464
1465/*!
1466 * Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate.
1467 *
1468 * @public @memberof oxr_session
1469 */
1470static inline XrResult
1472{
1473 switch (session->state) {
1474 case XR_SESSION_STATE_LOSS_PENDING: return XR_SESSION_LOSS_PENDING;
1475 default: return XR_SUCCESS;
1476 }
1477}
1478
1479/*!
1480 * Returns XR_SUCCESS, XR_SESSION_LOSS_PENDING, or XR_SESSION_NOT_FOCUSED, as
1481 * appropriate.
1482 *
1483 * @public @memberof oxr_session
1484 */
1485static inline XrResult
1487{
1488 switch (session->state) {
1489 case XR_SESSION_STATE_LOSS_PENDING: return XR_SESSION_LOSS_PENDING;
1490 case XR_SESSION_STATE_FOCUSED: return XR_SUCCESS;
1491 default: return XR_SESSION_NOT_FOCUSED;
1492 }
1493}
1494
1495#ifdef OXR_HAVE_FB_display_refresh_rate
1496XrResult
1497oxr_session_get_display_refresh_rate(struct oxr_logger *log, struct oxr_session *sess, float *displayRefreshRate);
1498
1499XrResult
1500oxr_session_request_display_refresh_rate(struct oxr_logger *log, struct oxr_session *sess, float displayRefreshRate);
1501#endif // OXR_HAVE_FB_display_refresh_rate
1502
1503
1504/*!
1505 * dpad emulation settings from oxr_interaction_profile
1506 */
1508{
1509 enum oxr_subaction_path subaction_path;
1510 XrPath *paths;
1511 uint32_t path_count;
1512 enum xrt_input_name position;
1513 enum xrt_input_name activate; // Can be zero
1514};
1515
1516/*!
1517 * A single interaction profile.
1518 */
1520{
1521 XrPath path;
1522
1523 //! Used to lookup @ref xrt_binding_profile for fallback.
1525
1526 //! Name presented to the user.
1527 const char *localized_name;
1528
1529 struct oxr_binding *bindings;
1530 size_t binding_count;
1531
1532 struct oxr_dpad_emulation *dpads;
1533 size_t dpad_count;
1534
1535 struct oxr_dpad_state dpad_state;
1536};
1537
1538/*!
1539 * Interaction profile binding state.
1540 */
1542{
1543 XrPath *paths;
1544 uint32_t path_count;
1545
1546 //! Name presented to the user.
1547 const char *localized_name;
1548
1549 enum oxr_subaction_path subaction_path;
1550
1551 uint32_t act_key_count;
1552 uint32_t *act_keys;
1553 //! store which entry in paths was suggested, for each action key
1555
1556 enum xrt_input_name input;
1557 enum xrt_input_name dpad_activate;
1558
1559 enum xrt_output_name output;
1560};
1561
1562/*!
1563 * @defgroup oxr_input OpenXR input
1564 * @ingroup oxr_main
1565 *
1566 * @brief The action-set/action-based input subsystem of OpenXR.
1567 *
1568 *
1569 * Action sets are created as children of the Instance, but are primarily used
1570 * with one or more Sessions. They may be used with multiple sessions at a time,
1571 * so we can't just put the per-session information directly in the action set
1572 * or action. Instead, we have the `_attachment `structures, which mirror the
1573 * action sets and actions but are rooted under the Session:
1574 *
1575 * - For every action set attached to a session, that session owns a @ref
1576 * oxr_action_set_attachment.
1577 * - For each action in those attached action sets, the action set attachment
1578 * owns an @ref oxr_action_attachment.
1579 *
1580 * We go from the public handle to the `_attachment` structure by using a `key`
1581 * value and a hash map: specifically, we look up the
1582 * oxr_action_set::act_set_key and oxr_action::act_key in the session.
1583 *
1584 * ![](monado-input-class-relationships.drawio.svg)
1585 */
1586
1587/*!
1588 * The data associated with the attachment of an Action Set (@ref
1589 * oxr_action_set) to as Session (@ref oxr_session).
1590 *
1591 * This structure has no pointer to the @ref oxr_action_set that created it
1592 * because the application is allowed to destroy an action before the session,
1593 * which should change nothing except not allow the application to use the
1594 * corresponding data anymore.
1595 *
1596 * @ingroup oxr_input
1597 *
1598 * @see oxr_action_set
1599 */
1601{
1602 //! Owning session action context.
1604
1605 //! Action set refcounted data
1607
1608 //! Unique key for the session hashmap.
1609 uint32_t act_set_key;
1610
1611 //! Which sub-action paths are requested on the latest sync.
1613
1614 //! An array of action attachments we own.
1616
1617 /*!
1618 * Length of @ref oxr_action_set_attachment::act_attachments.
1619 */
1621};
1622
1623
1624
1625/*!
1626 * The state of a action input.
1627 *
1628 * @ingroup oxr_input
1629 *
1630 * @see oxr_action_attachment
1631 */
1633{
1634 /*!
1635 * The actual value - must interpret using action type
1636 */
1637 union xrt_input_value value;
1638
1639 //! Is this active (bound and providing input)?
1641
1642 // Was this changed.
1643 bool changed;
1644
1645 //! When was this last changed.
1647};
1648
1649/*!
1650 * A input action pair of a @ref xrt_input and a @ref xrt_device, along with the
1651 * required transform.
1652 *
1653 * @ingroup oxr_input
1654 *
1655 * @see xrt_device
1656 * @see xrt_input
1657 */
1659{
1660 struct xrt_device *xdev; // Used for poses and transform is null.
1661 struct xrt_input *input; // Ditto
1662 enum xrt_input_name dpad_activate_name; // used to activate dpad emulation if present
1663 struct xrt_input *dpad_activate; // used to activate dpad emulation if present
1664 struct oxr_input_transform *transforms;
1665 size_t transform_count;
1666 XrPath bound_path;
1667};
1668
1669/*!
1670 * A output action pair of a @ref xrt_output_name and a @ref xrt_device.
1671 *
1672 * @ingroup oxr_input
1673 *
1674 * @see xrt_device
1675 * @see xrt_output_name
1676 */
1678{
1679 struct xrt_device *xdev;
1680 enum xrt_output_name name;
1681 XrPath bound_path;
1682};
1683
1684
1685/*!
1686 * The set of inputs/outputs for a single sub-action path for an action.
1687 *
1688 * Each @ref oxr_action_attachment has one of these for every known sub-action
1689 * path in the spec. Many, or even most, will be "empty".
1690 *
1691 * A single action will either be input or output, not both.
1692 *
1693 * @ingroup oxr_input
1694 *
1695 * @see oxr_action_attachment
1696 */
1698{
1699 struct oxr_action_state current;
1700
1701 size_t input_count;
1702 struct oxr_action_input *inputs;
1703
1704 int64_t stop_output_time;
1705 size_t output_count;
1706 struct oxr_action_output *outputs;
1707};
1708
1709/*!
1710 * Data associated with an Action that has been attached to a Session.
1711 *
1712 * More information on the action vs action attachment and action set vs action
1713 * set attachment parallel is in the docs for @ref oxr_input
1714 *
1715 * @ingroup oxr_input
1716 *
1717 * @see oxr_action
1718 */
1720{
1721 //! The owning action set attachment
1723
1724 //! This action's refcounted data
1726
1727 //! The session attached actions this action attachment belongs to.
1729
1730 //! Unique key for the session hashmap.
1731 uint32_t act_key;
1732
1733 /*!
1734 * For pose actions any subaction paths are special treated, at bind
1735 * time we pick one subaction path and stick to it as long as the action
1736 * lives.
1737 */
1739
1740 struct oxr_action_state any_state;
1741
1742#define OXR_CACHE_MEMBER(X) struct oxr_action_cache X;
1743 OXR_FOR_EACH_SUBACTION_PATH(OXR_CACHE_MEMBER)
1744#undef OXR_CACHE_MEMBER
1745};
1746
1747/*!
1748 * @}
1749 */
1750
1751
1752static inline bool
1753oxr_space_type_is_reference(enum oxr_space_type space_type)
1754{
1755 switch (space_type) {
1756 case OXR_SPACE_TYPE_REFERENCE_VIEW:
1757 case OXR_SPACE_TYPE_REFERENCE_LOCAL:
1758 case OXR_SPACE_TYPE_REFERENCE_LOCAL_FLOOR:
1759 case OXR_SPACE_TYPE_REFERENCE_STAGE:
1760 case OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_MSFT:
1761 case OXR_SPACE_TYPE_REFERENCE_COMBINED_EYE_VARJO:
1762 case OXR_SPACE_TYPE_REFERENCE_LOCALIZATION_MAP_ML:
1763 case OXR_SPACE_TYPE_REFERENCE_UNBOUNDED_ANDROID:
1764 // These are reference spaces.
1765 return true;
1766
1767 case OXR_SPACE_TYPE_ACTION:
1768 case OXR_SPACE_TYPE_XDEV_POSE:
1769 // These are not reference spaces.
1770 return false;
1771 }
1772
1773 // Handles invalid value.
1774 return false;
1775}
1776
1777
1778/*!
1779 * Can be one of several reference space types, or a space that is bound to an
1780 * action.
1781 *
1782 * Parent type/handle is @ref oxr_session
1783 *
1784 * @obj{XrSpace}
1785 * @extends oxr_handle_base
1786 */
1788{
1789 //! Common structure for things referred to by OpenXR handles.
1791
1792 //! Owner of this space.
1794
1795 //! Pose that was given during creation.
1797
1798 //! Action key from which action this space was created from.
1799 uint32_t act_key;
1800
1801 //! What kind of space is this?
1803
1804 //! Which sub action path is this?
1806
1807 struct
1808 {
1809 struct xrt_space *xs;
1810 struct xrt_device *xdev;
1811 enum xrt_input_name name;
1812
1813 bool feature_eye_tracking;
1814 } action;
1815
1816 struct
1817 {
1818 struct xrt_space *xs;
1819 } xdev_pose;
1820};
1821
1822/*!
1823 * A set of images used for rendering.
1824 *
1825 * Parent type/handle is @ref oxr_session
1826 *
1827 * @obj{XrSwapchain}
1828 * @extends oxr_handle_base
1829 */
1831{
1832 //! Common structure for things referred to by OpenXR handles.
1834
1835 //! Owner of this swapchain.
1837
1838 //! Compositor swapchain.
1840
1841 //! Swapchain size.
1842 uint32_t width, height;
1843
1844 //! For 1 is 2D texture, greater then 1 2D array texture.
1846
1847 //! The number of cubemap faces. 6 for cubemaps, 1 otherwise.
1848 uint32_t face_count;
1849
1850 struct
1851 {
1852 enum oxr_image_state state;
1853 } images[XRT_MAX_SWAPCHAIN_IMAGES];
1854
1855 struct
1856 {
1857 size_t num;
1858 struct u_index_fifo fifo;
1859 } acquired;
1860
1861 struct
1862 {
1863 bool yes;
1864 int index;
1865 } inflight; // This is the image that the app is working on.
1866
1867 struct
1868 {
1869 bool yes;
1870 int index;
1871 } released;
1872
1873 // Is this a static swapchain, needed for acquire semantics.
1874 bool is_static;
1875
1876
1877 XrResult (*destroy)(struct oxr_logger *, struct oxr_swapchain *);
1878
1879 XrResult (*enumerate_images)(struct oxr_logger *,
1880 struct oxr_swapchain *,
1881 uint32_t,
1882 XrSwapchainImageBaseHeader *);
1883
1884 XrResult (*acquire_image)(struct oxr_logger *,
1885 struct oxr_swapchain *,
1886 const XrSwapchainImageAcquireInfo *,
1887 uint32_t *);
1888
1889 XrResult (*wait_image)(struct oxr_logger *, struct oxr_swapchain *, const XrSwapchainImageWaitInfo *);
1890
1891 XrResult (*release_image)(struct oxr_logger *, struct oxr_swapchain *, const XrSwapchainImageReleaseInfo *);
1892};
1893
1894/*!
1895 * The reference-counted data of an action set.
1896 *
1897 * One or more sessions may still need this data after the application destroys
1898 * its XrActionSet handle, so this data is refcounted.
1899 *
1900 * @ingroup oxr_input
1901 *
1902 * @see oxr_action_set
1903 * @extends oxr_refcounted
1904 */
1906{
1907 struct oxr_refcounted base;
1908
1909 //! Application supplied name of this action.
1910 char name[XR_MAX_ACTION_SET_NAME_SIZE];
1911
1912 /*!
1913 * Has this action set even been attached to any session, marking it as
1914 * immutable.
1915 */
1917
1918 //! Unique key for the session hashmap.
1919 uint32_t act_set_key;
1920
1921 //! Application supplied action set priority.
1922 uint32_t priority;
1923
1924 struct oxr_pair_hashset actions;
1925
1926 struct oxr_subaction_paths permitted_subaction_paths;
1927};
1928
1929/*!
1930 * A group of actions.
1931 *
1932 * Parent type/handle is @ref oxr_instance
1933 *
1934 * Note, however, that an action set must be "attached" to a session
1935 * ( @ref oxr_session ) to be used and not just configured.
1936 * The corresponding data is in @ref oxr_action_set_attachment.
1937 *
1938 * @ingroup oxr_input
1939 *
1940 * @obj{XrActionSet}
1941 * @extends oxr_handle_base
1942 */
1944{
1945 //! Common structure for things referred to by OpenXR handles.
1947
1948 //! Owner of this action set.
1950
1951 //! Reference to the instance action context (reference-counted).
1953
1954 /*!
1955 * The data for this action set that must live as long as any session we
1956 * are attached to.
1957 */
1959
1960
1961 /*!
1962 * Unique key for the session hashmap.
1963 *
1964 * Duplicated from oxr_action_set_ref::act_set_key for efficiency.
1965 */
1966 uint32_t act_set_key;
1967
1968 //! The item in the name hashset.
1970
1971 //! The item in the localized hashset.
1973};
1974
1975/*!
1976 * The reference-counted data of an action.
1977 *
1978 * One or more sessions may still need this data after the application destroys
1979 * its XrAction handle, so this data is refcounted.
1980 *
1981 * @ingroup oxr_input
1982 *
1983 * @see oxr_action
1984 * @extends oxr_refcounted
1985 */
1987{
1988 struct oxr_refcounted base;
1989
1990 //! Application supplied name of this action.
1991 char name[XR_MAX_ACTION_NAME_SIZE];
1992
1993 //! Unique key for the session hashmap.
1994 uint32_t act_key;
1995
1996 //! Type this action was created with.
1997 XrActionType action_type;
1998
1999 //! Which sub action paths that this action was created with.
2001};
2002
2003/*!
2004 * A single action.
2005 *
2006 * Parent type/handle is @ref oxr_action_set
2007 *
2008 * For actual usage, an action is attached to a session: the corresponding data
2009 * is in @ref oxr_action_attachment
2010 *
2011 * @ingroup oxr_input
2012 *
2013 * @obj{XrAction}
2014 * @extends oxr_handle_base
2015 */
2017{
2018 //! Common structure for things referred to by OpenXR handles.
2020
2021 //! Owner of this action.
2023
2024 //! The data for this action that must live as long as any session we
2025 //! are attached to.
2027
2028 /*!
2029 * Unique key for the session hashmap.
2030 *
2031 * Duplicated from oxr_action_ref::act_key for efficiency.
2032 */
2033 uint32_t act_key;
2034
2035 //! The item in the name hashset.
2037
2038 //! The item in the localized hashset.
2040};
2041
2042/*!
2043 * Debug object created by the client program.
2044 *
2045 * Parent type/handle is @ref oxr_instance
2046 *
2047 * @obj{XrDebugUtilsMessengerEXT}
2048 */
2050{
2051 //! Common structure for things referred to by OpenXR handles.
2053
2054 //! Owner of this messenger.
2056
2057 //! Severities to submit to this messenger
2058 XrDebugUtilsMessageSeverityFlagsEXT message_severities;
2059
2060 //! Types to submit to this messenger
2061 XrDebugUtilsMessageTypeFlagsEXT message_types;
2062
2063 //! Callback function
2064 PFN_xrDebugUtilsMessengerCallbackEXT user_callback;
2065
2066 //! Opaque user data
2067 void *XR_MAY_ALIAS user_data;
2068};
2069
2070#ifdef OXR_HAVE_FB_passthrough
2071
2072struct oxr_passthrough
2073{
2074 struct oxr_handle_base handle;
2075
2076 struct oxr_session *sess;
2077
2078 XrPassthroughFlagsFB flags;
2079
2080 bool paused;
2081};
2082
2083struct oxr_passthrough_layer
2084{
2085 struct oxr_handle_base handle;
2086
2087 struct oxr_session *sess;
2088
2089 XrPassthroughFB passthrough;
2090
2091 XrPassthroughFlagsFB flags;
2092
2093 XrPassthroughLayerPurposeFB purpose;
2094
2095 bool paused;
2096
2097 XrPassthroughStyleFB style;
2098 XrPassthroughColorMapMonoToRgbaFB monoToRgba;
2099 XrPassthroughColorMapMonoToMonoFB monoToMono;
2100 XrPassthroughBrightnessContrastSaturationFB brightnessContrastSaturation;
2101};
2102
2103XrResult
2104oxr_passthrough_create(struct oxr_logger *log,
2105 struct oxr_session *sess,
2106 const XrPassthroughCreateInfoFB *createInfo,
2107 struct oxr_passthrough **out_passthrough);
2108
2109XrResult
2110oxr_passthrough_layer_create(struct oxr_logger *log,
2111 struct oxr_session *sess,
2112 const XrPassthroughLayerCreateInfoFB *createInfo,
2113 struct oxr_passthrough_layer **out_layer);
2114
2115static inline XrPassthroughFB
2116oxr_passthrough_to_openxr(struct oxr_passthrough *passthrough)
2117{
2118 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPassthroughFB, passthrough);
2119}
2120
2121static inline XrPassthroughLayerFB
2122oxr_passthrough_layer_to_openxr(struct oxr_passthrough_layer *passthroughLayer)
2123{
2124 return XRT_CAST_PTR_TO_OXR_HANDLE(XrPassthroughLayerFB, passthroughLayer);
2125}
2126
2127XrResult
2128oxr_event_push_XrEventDataPassthroughStateChangedFB(struct oxr_logger *log,
2129 struct oxr_session *sess,
2130 XrPassthroughStateChangedFlagsFB flags);
2131
2132#endif // OXR_HAVE_FB_passthrough
2133
2134#ifdef OXR_HAVE_HTC_facial_tracking
2135/*!
2136 * HTC specific Facial tracker.
2137 *
2138 * Parent type/handle is @ref oxr_instance
2139 *
2140 *
2141 * @obj{XrFacialTrackerHTC}
2142 * @extends oxr_handle_base
2143 */
2144struct oxr_facial_tracker_htc
2145{
2146 //! Common structure for things referred to by OpenXR handles.
2147 struct oxr_handle_base handle;
2148
2149 //! Owner of this face tracker.
2150 struct oxr_session *sess;
2151
2152 //! xrt_device backing this face tracker
2153 struct xrt_device *xdev;
2154
2155 //! Type of facial tracking, eyes or lips
2156 enum xrt_facial_tracking_type_htc facial_tracking_type;
2157
2158 //! To track if the feature set has been incremented since creation.
2159 bool feature_incremented;
2160};
2161
2162XrResult
2163oxr_facial_tracker_htc_create(struct oxr_logger *log,
2164 struct oxr_session *sess,
2165 const XrFacialTrackerCreateInfoHTC *createInfo,
2166 struct oxr_facial_tracker_htc **out_face_tracker_htc);
2167
2168XrResult
2169oxr_get_facial_expressions_htc(struct oxr_logger *log,
2170 struct oxr_facial_tracker_htc *facial_tracker_htc,
2171 XrFacialExpressionsHTC *facialExpressions);
2172#endif
2173
2174#ifdef OXR_HAVE_FB_body_tracking
2175/*!
2176 * FB specific Body tracker.
2177 *
2178 * Parent type/handle is @ref oxr_instance
2179 *
2180 * @obj{XrBodyTrackerFB}
2181 * @extends oxr_handle_base
2182 */
2183struct oxr_body_tracker_fb
2184{
2185 //! Common structure for things referred to by OpenXR handles.
2186 struct oxr_handle_base handle;
2187
2188 //! Owner of this face tracker.
2189 struct oxr_session *sess;
2190
2191 //! xrt_device backing this face tracker
2192 struct xrt_device *xdev;
2193
2194 //! Type of the body joint set e.g. XR_FB_body_tracking or XR_META_body_tracking_full_body
2195 enum xrt_body_joint_set_type_fb joint_set_type;
2196};
2197
2198XrResult
2199oxr_create_body_tracker_fb(struct oxr_logger *log,
2200 struct oxr_session *sess,
2201 const XrBodyTrackerCreateInfoFB *createInfo,
2202 struct oxr_body_tracker_fb **out_body_tracker_fb);
2203
2204XrResult
2205oxr_get_body_skeleton_fb(struct oxr_logger *log,
2206 struct oxr_body_tracker_fb *body_tracker_fb,
2207 XrBodySkeletonFB *skeleton);
2208
2209XrResult
2210oxr_locate_body_joints_fb(struct oxr_logger *log,
2211 struct oxr_body_tracker_fb *body_tracker_fb,
2212 struct oxr_space *base_spc,
2213 const XrBodyJointsLocateInfoFB *locateInfo,
2214 XrBodyJointLocationsFB *locations);
2215#endif
2216
2217#ifdef OXR_HAVE_BD_body_tracking
2218/*!
2219 * BD (PICO) specific Body tracker.
2220 *
2221 * Parent type/handle is @ref oxr_session
2222 *
2223 * @obj{XrBodyTrackerBD}
2224 * @extends oxr_handle_base
2225 */
2226struct oxr_body_tracker_bd
2227{
2228 //! Common structure for things referred to by OpenXR handles.
2229 struct oxr_handle_base handle;
2230
2231 //! Owner of this body tracker.
2232 struct oxr_session *sess;
2233
2234 //! xrt_device backing this body tracker
2235 struct xrt_device *xdev;
2236
2237 //! Type of the body joint set (with or without arms)
2238 enum xrt_body_joint_set_type_bd joint_set_type;
2239};
2240
2241XrResult
2242oxr_create_body_tracker_bd(struct oxr_logger *log,
2243 struct oxr_session *sess,
2244 const XrBodyTrackerCreateInfoBD *createInfo,
2245 struct oxr_body_tracker_bd **out_body_tracker_bd);
2246
2247XrResult
2248oxr_locate_body_joints_bd(struct oxr_logger *log,
2249 struct oxr_body_tracker_bd *body_tracker_bd,
2250 struct oxr_space *base_spc,
2251 const XrBodyJointsLocateInfoBD *locateInfo,
2252 XrBodyJointLocationsBD *locations);
2253
2254bool
2255oxr_system_get_body_tracking_bd_support(struct oxr_logger *log, struct oxr_instance *inst);
2256#endif
2257
2258#ifdef OXR_HAVE_FB_face_tracking2
2259/*!
2260 * FB specific Face tracker2.
2261 *
2262 * Parent type/handle is @ref oxr_instance
2263 *
2264 * @obj{XrFaceTracker2FB}
2265 * @extends oxr_handle_base
2266 */
2267struct oxr_face_tracker2_fb
2268{
2269 //! Common structure for things referred to by OpenXR handles.
2270 struct oxr_handle_base handle;
2271
2272 //! Owner of this face tracker.
2273 struct oxr_session *sess;
2274
2275 //! xrt_device backing this face tracker
2276 struct xrt_device *xdev;
2277
2278 bool audio_enabled;
2279 bool visual_enabled;
2280
2281 //! To track if the feature set has been incremented since creation.
2282 bool feature_incremented;
2283};
2284
2285XrResult
2286oxr_face_tracker2_fb_create(struct oxr_logger *log,
2287 struct oxr_session *sess,
2288 const XrFaceTrackerCreateInfo2FB *createInfo,
2289 struct oxr_face_tracker2_fb **out_face_tracker2_fb);
2290
2291XrResult
2292oxr_get_face_expression_weights2_fb(struct oxr_logger *log,
2293 struct oxr_face_tracker2_fb *face_tracker2_fb,
2294 const XrFaceExpressionInfo2FB *expression_info,
2295 XrFaceExpressionWeights2FB *expression_weights);
2296#endif
2297
2298#ifdef OXR_HAVE_MNDX_xdev_space
2299/*!
2300 * Object that holds a list of the current @ref xrt_devices.
2301 *
2302 * Parent type/handle is @ref oxr_session
2303 *
2304 * @obj{XrXDevList}
2305 * @extends oxr_handle_base
2306 */
2307struct oxr_xdev_list
2308{
2309 //! Common structure for things referred to by OpenXR handles.
2310 struct oxr_handle_base handle;
2311
2312 //! Owner of this @ref xrt_device list.
2313 struct oxr_session *sess;
2314
2315 //! Monotonically increasing number.
2316 uint64_t generation_number;
2317
2318 uint64_t ids[XRT_SYSTEM_MAX_DEVICES];
2319 struct xrt_device *xdevs[XRT_SYSTEM_MAX_DEVICES];
2321
2322 //! Counts ids, names and xdevs.
2323 uint32_t device_count;
2324};
2325#endif // OXR_HAVE_MNDX_xdev_space
2326
2327#ifdef OXR_HAVE_EXT_plane_detection
2328/*!
2329 * A Plane Detector.
2330 *
2331 * Parent type/handle is @ref oxr_session
2332 *
2333 *
2334 * @obj{XrPlaneDetectorEXT}
2335 * @extends oxr_handle_base
2336 */
2337struct oxr_plane_detector_ext
2338{
2339 //! Common structure for things referred to by OpenXR handles.
2340 struct oxr_handle_base handle;
2341
2342 //! Owner of this anchor.
2343 struct oxr_session *sess;
2344
2345 //! Plane detector flags.
2347
2348 //! The last known state of this plane detector.
2349 XrPlaneDetectionStateEXT state;
2350
2351 //! Whether the last DONE plane detection has been retrieved from the xdev.
2352 bool retrieved;
2353
2354 //! The device that this plane detector belongs to.
2355 struct xrt_device *xdev;
2356
2357 //! Detected planes. xrt_plane_detector_locations_ext::relation is kept in xdev space and not updated.
2358 struct xrt_plane_detections_ext detections;
2359
2360 //! Corresponds to xrt_plane_detections_ext::locations, but with OpenXR types and transformed into target space.
2361 //! Enables two call idiom.
2362 XrPlaneDetectorLocationEXT *xr_locations;
2363
2364 //! A globally unique id for the current plane detection or 0, generated by the xrt_device.
2365 uint64_t detection_id;
2366};
2367#endif // OXR_HAVE_EXT_plane_detection
2368
2369#ifdef OXR_HAVE_EXT_future
2370/*!
2371 * EXT futures.
2372 *
2373 * Parent type/handle is @ref oxr_instance
2374 *
2375 * @obj{XrFutureEXT}
2376 * @extends oxr_handle_base
2377 */
2378struct oxr_future_ext
2379{
2380 //! Common structure for things referred to by OpenXR handles.
2381 struct oxr_handle_base handle;
2382
2383 //! (weak) reference to instance (may or not be a direct parent handle")
2384 struct oxr_instance *inst;
2385
2386 //! Owning session.
2387 struct oxr_session *sess;
2388
2389 //! xrt_future backing this future
2390 struct xrt_future *xft;
2391};
2392
2393/*!
2394 * To go back to a OpenXR object.
2395 *
2396 * @relates oxr_future_ext
2397 */
2398static inline XrFutureEXT
2399oxr_future_ext_to_openxr(struct oxr_future_ext *future_ext)
2400{
2401 return XRT_CAST_PTR_TO_OXR_HANDLE(XrFutureEXT, future_ext);
2402}
2403
2404XrResult
2405oxr_future_create(struct oxr_logger *log,
2406 struct oxr_session *sess,
2407 struct xrt_future *xft,
2408 struct oxr_handle_base *parent_handle,
2409 struct oxr_future_ext **out_oxr_future_ext);
2410
2411XrResult
2412oxr_future_invalidate(struct oxr_logger *log, struct oxr_future_ext *oxr_future);
2413
2414XrResult
2415oxr_future_ext_poll(struct oxr_logger *log, const struct oxr_future_ext *oxr_future, XrFuturePollResultEXT *pollResult);
2416
2417XrResult
2418oxr_future_ext_cancel(struct oxr_logger *log, struct oxr_future_ext *oxr_future);
2419
2420XrResult
2421oxr_future_ext_complete(struct oxr_logger *log,
2422 struct oxr_future_ext *oxr_future,
2423 struct xrt_future_result *out_ft_result);
2424
2425#endif
2426
2427#ifdef OXR_HAVE_EXT_user_presence
2428XrResult
2429oxr_event_push_XrEventDataUserPresenceChangedEXT(struct oxr_logger *log, struct oxr_session *sess, bool isUserPresent);
2430#endif // OXR_HAVE_EXT_user_presence
2431
2432#ifdef OXR_HAVE_ANDROID_face_tracking
2433/*!
2434 * Android specific Facial tracker.
2435 *
2436 * Parent type/handle is @ref oxr_instance
2437 *
2438 *
2439 * @obj{XrFaceTrackerANDROID}
2440 * @extends oxr_handle_base
2441 */
2442struct oxr_face_tracker_android
2443{
2444 //! Common structure for things referred to by OpenXR handles.
2445 struct oxr_handle_base handle;
2446
2447 //! Owner of this face tracker.
2448 struct oxr_session *sess;
2449
2450 //! xrt_device backing this face tracker
2451 struct xrt_device *xdev;
2452
2453 //! To track if the feature set has been incremented since creation.
2454 bool feature_incremented;
2455};
2456
2457XrResult
2458oxr_face_tracker_android_create(struct oxr_logger *log,
2459 struct oxr_session *sess,
2460 const XrFaceTrackerCreateInfoANDROID *createInfo,
2461 XrFaceTrackerANDROID *faceTracker);
2462
2463XrResult
2465 struct oxr_face_tracker_android *facial_tracker_android,
2466 const XrFaceStateGetInfoANDROID *getInfo,
2467 XrFaceStateANDROID *faceStateOutput);
2468
2469XrResult
2470oxr_get_face_calibration_state_android(struct oxr_logger *log,
2471 struct oxr_face_tracker_android *facial_tracker_android,
2472 XrBool32 *faceIsCalibratedOutput);
2473#endif // OXR_HAVE_ANDROID_face_tracking
2474
2475/*!
2476 * @}
2477 */
2478
2479
2480#ifdef __cplusplus
2481}
2482#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:308
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:1471
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:1486
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:255
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:598
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:465
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:133
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:92
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:257
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:168
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:630
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:111
#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:930
xrt_output_name
Name of a output with a baked in type.
Definition xrt_defines.h:1612
xrt_plane_detector_flags_ext
Flags used when running plane detection.
Definition xrt_plane_detector.h:46
Definition bindings.py:1
Wrapper around OS threading native functions.
Shared internal defines and enums in the state tracker.
Holds dpad state related functions.
XrResult oxr_get_face_state_android(struct oxr_logger *log, struct oxr_face_tracker_android *facial_tracker_android, const XrFaceStateGetInfoANDROID *getInfo, XrFaceStateANDROID *faceStateOutput)
Definition oxr_face_tracking_android.c: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:250
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:1720
struct oxr_session_attached_actions * attached_actions
The session attached actions this action attachment belongs to.
Definition oxr_objects.h:1728
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:1738
struct oxr_action_ref * act_ref
This action's refcounted data.
Definition oxr_objects.h:1725
struct oxr_action_set_attachment * act_set_attached
The owning action set attachment.
Definition oxr_objects.h:1722
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:1731
The set of inputs/outputs for a single sub-action path for an action.
Definition oxr_objects.h:1698
A input action pair of a xrt_input and a xrt_device, along with the required transform.
Definition oxr_objects.h:1659
A output action pair of a xrt_output_name and a xrt_device.
Definition oxr_objects.h:1678
The reference-counted data of an action.
Definition oxr_objects.h:1987
struct oxr_subaction_paths subaction_paths
Which sub action paths that this action was created with.
Definition oxr_objects.h:2000
XrActionType action_type
Type this action was created with.
Definition oxr_objects.h:1997
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:1994
The data associated with the attachment of an Action Set (oxr_action_set) to as Session (oxr_session)...
Definition oxr_objects.h:1601
struct oxr_session_action_context * sess_context
Owning session action context.
Definition oxr_objects.h:1603
struct oxr_action_attachment * act_attachments
An array of action attachments we own.
Definition oxr_objects.h:1615
struct oxr_action_set_ref * act_set_ref
Action set refcounted data.
Definition oxr_objects.h:1606
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1609
size_t action_attachment_count
Length of oxr_action_set_attachment::act_attachments.
Definition oxr_objects.h:1620
struct oxr_subaction_paths requested_subaction_paths
Which sub-action paths are requested on the latest sync.
Definition oxr_objects.h:1612
The reference-counted data of an action set.
Definition oxr_objects.h:1906
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1919
bool ever_attached
Has this action set even been attached to any session, marking it as immutable.
Definition oxr_objects.h:1916
uint32_t priority
Application supplied action set priority.
Definition oxr_objects.h:1922
A group of actions.
Definition oxr_objects.h:1944
struct oxr_instance_action_context * inst_context
Reference to the instance action context (reference-counted).
Definition oxr_objects.h:1952
struct u_hashset_item * name_item
The item in the name hashset.
Definition oxr_objects.h:1969
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition oxr_objects.h:1972
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:1958
uint32_t act_set_key
Unique key for the session hashmap.
Definition oxr_objects.h:1966
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1946
struct oxr_instance * inst
Owner of this action set.
Definition oxr_objects.h:1949
The state of a action input.
Definition oxr_objects.h:1633
bool active
Is this active (bound and providing input)?
Definition oxr_objects.h:1640
XrTime timestamp
When was this last changed.
Definition oxr_objects.h:1646
A single action.
Definition oxr_objects.h:2017
struct oxr_action_set * act_set
Owner of this action.
Definition oxr_objects.h:2022
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:2019
struct u_hashset_item * loc_item
The item in the localized hashset.
Definition oxr_objects.h:2039
uint32_t act_key
Unique key for the session hashmap.
Definition oxr_objects.h:2033
struct u_hashset_item * name_item
The item in the name hashset.
Definition oxr_objects.h:2036
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:2026
Interaction profile binding state.
Definition oxr_objects.h:1542
uint32_t * preferred_binding_path_index
store which entry in paths was suggested, for each action key
Definition oxr_objects.h:1554
const char * localized_name
Name presented to the user.
Definition oxr_objects.h:1547
Debug object created by the client program.
Definition oxr_objects.h:2050
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:2052
XrDebugUtilsMessageTypeFlagsEXT message_types
Types to submit to this messenger.
Definition oxr_objects.h:2061
PFN_xrDebugUtilsMessengerCallbackEXT user_callback
Callback function.
Definition oxr_objects.h:2064
struct oxr_instance * inst
Owner of this messenger.
Definition oxr_objects.h:2055
void *XR_MAY_ALIAS user_data
Opaque user data.
Definition oxr_objects.h:2067
XrDebugUtilsMessageSeverityFlagsEXT message_severities
Severities to submit to this messenger.
Definition oxr_objects.h:2058
dpad emulation settings from oxr_interaction_profile
Definition oxr_objects.h:1508
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:1209
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:1082
struct oxr_handle_base * parent
Pointer to this object's parent handle holder, if any.
Definition oxr_objects.h:1089
uint64_t debug
Magic (per-handle-type) value for debugging.
Definition oxr_objects.h:1084
struct oxr_handle_base * children[256]
Array of children, if any.
Definition oxr_objects.h:1094
enum oxr_handle_state state
Current handle state.
Definition oxr_objects.h:1099
oxr_handle_destroyer destroy
Destroy the object this handle refers to.
Definition oxr_objects.h:1104
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:1223
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:1290
bool parallel_views
For applications that rely on views being parallel, notably some OpenVR games with OpenComposite.
Definition oxr_objects.h:1315
struct oxr_path_store path_store
Path store for managing paths.
Definition oxr_objects.h:1250
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:1303
XrVersion major_minor
Stores only major.minor version. Simplifies comparisons for e.g. "at least OpenXR 1....
Definition oxr_objects.h:1238
bool skip_end_session
Unreal 4 has a bug calling xrEndSession; the function should just exit.
Definition oxr_objects.h:1306
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:1266
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:1312
struct oxr_extension_status extensions
Enabled extensions.
Definition oxr_objects.h:1232
struct oxr_instance::@284 openxr_version
The OpenXR version requested in the app info. It determines the instance's OpenXR version.
struct oxr_instance_path_cache path_cache
Path cache for actions, needs path_store to work.
Definition oxr_objects.h:1263
struct oxr_debug_messenger * messengers[256]
Debug messengers.
Definition oxr_objects.h:1336
bool no_usage_bit_validation_in_create_swapchain
Don't return XR_ERROR_VALIDATION_FAILURE if an application sets unsupported usage flags when calling ...
Definition oxr_objects.h:1332
bool map_stage_to_local_floor
For applications that use stage and don't offer recentering.
Definition oxr_objects.h:1318
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1225
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:1325
A single interaction profile.
Definition oxr_objects.h:1520
enum xrt_device_name xname
Used to lookup xrt_binding_profile for fallback.
Definition oxr_objects.h:1524
const char * localized_name
Name presented to the user.
Definition oxr_objects.h:1527
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:1370
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:1453
struct xrt_compositor_native * xcn
Native compositor that is wrapped by client compositors.
Definition oxr_objects.h:1382
struct oxr_session_action_context action_context
Holds all the action state that belongs on the session level.
Definition oxr_objects.h:1430
struct xrt_session * xs
The xrt_session backing this session.
Definition oxr_objects.h:1379
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:1395
uint32_t frame_timing_wait_sleep_ms
Extra sleep in wait frame.
Definition oxr_objects.h:1448
struct os_precise_sleeper sleeper
Used to implement precise extra sleeping in wait frame.
Definition oxr_objects.h:1425
struct oxr_session_attached_actions attached_actions
Per-session map of action key to action attachment (thread-safe).
Definition oxr_objects.h:1435
enum oxr_session_graphics_ext gfx_ext
What graphics type was this session created with.
Definition oxr_objects.h:1376
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:1401
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1372
bool has_lost
initial relation of head in "global" space.
Definition oxr_objects.h:1462
float ipd_meters
IPD, to be expanded to a proper 3D relation.
Definition oxr_objects.h:1440
bool frame_timing_spew
Frame timing debug output.
Definition oxr_objects.h:1445
Can be one of several reference space types, or a space that is bound to an action.
Definition oxr_objects.h:1788
struct oxr_subaction_paths subaction_paths
Which sub action path is this?
Definition oxr_objects.h:1805
enum oxr_space_type space_type
What kind of space is this?
Definition oxr_objects.h:1802
uint32_t act_key
Action key from which action this space was created from.
Definition oxr_objects.h:1799
struct xrt_pose pose
Pose that was given during creation.
Definition oxr_objects.h:1796
struct oxr_session * sess
Owner of this space.
Definition oxr_objects.h:1793
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1790
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:1831
struct oxr_session * sess
Owner of this swapchain.
Definition oxr_objects.h:1836
uint32_t face_count
The number of cubemap faces. 6 for cubemaps, 1 otherwise.
Definition oxr_objects.h:1848
struct xrt_swapchain * swapchain
Compositor swapchain.
Definition oxr_objects.h:1839
struct oxr_handle_base handle
Common structure for things referred to by OpenXR handles.
Definition oxr_objects.h:1833
uint32_t width
Swapchain size.
Definition oxr_objects.h:1842
uint32_t array_layer_count
For 1 is 2D texture, greater then 1 2D array texture.
Definition oxr_objects.h:1845
Single or multiple devices grouped together to form a system that sessions can be created from.
Definition oxr_objects.h:1135
struct xrt_system * xsys
The XRT interfaces level system.
Definition oxr_objects.h:1139
VkPhysicalDevice suggested_vulkan_physical_device
The device returned with the last xrGetVulkanGraphicsDeviceKHR or xrGetVulkanGraphicsDevice2KHR call.
Definition oxr_objects.h:1172
PFN_vkGetInstanceProcAddr vk_get_instance_proc_addr
Stores the vkGetInstanceProcAddr passed to xrCreateVulkanInstanceKHR to be used when looking up Vulka...
Definition oxr_objects.h:1178
struct xrt_system_devices * xsysd
System devices used in all session types.
Definition oxr_objects.h:1142
struct xrt_space_overseer * xso
Space overseer used in all session types.
Definition oxr_objects.h:1145
VkInstance vulkan_enable2_instance
The instance/device we create when vulkan_enable2 is used.
Definition oxr_objects.h:1169
bool gotten_requirements
Have the client application called the gfx api requirements func?
Definition oxr_objects.h:1153
struct xrt_system_compositor * xsysc
System compositor, used to create session compositors.
Definition oxr_objects.h:1148
Holds the properties that a system supports for a view configuration type.
Definition oxr_objects.h:1113
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:2291
Main compositor server interface.
Definition xrt_compositor.h:2260
Common compositor client interface/base.
Definition xrt_compositor.h:1016
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:492
The XRT representation of XrSession, this object does not have all of the functionality of a session,...
Definition xrt_session.h:277
Object that oversees and manages spaces, one created for each XR system.
Definition xrt_space.h:97
A relation with two spaces, includes velocity and acceleration.
Definition xrt_defines.h:683
A space very similar to a OpenXR XrSpace but not a full one-to-one mapping, but used to power XrSpace...
Definition xrt_space.h:32
Common swapchain interface/base.
Definition xrt_compositor.h:564
The system compositor handles composition for a system.
Definition xrt_compositor.h:2488
A collection of xrt_device, and an interface for identifying the roles they have been assigned.
Definition xrt_system.h:214
A system is a collection of devices, policies and optionally a compositor that is organised into a ch...
Definition xrt_system.h:63
Visibility mask helper, the indices and vertices are tightly packed after this struct.
Definition xrt_visibility_mask.h:26
Misc helpers for device drivers.
Hashmap for integer values header.
Hashset struct header.
A FIFO for indices.
A union of all input types.
Definition xrt_defines.h:1537
Header holding Android-specific details.
xrt_android_lifecycle_event
Distinguishes the possible Android lifecycle events from each other.
Definition xrt_android.h:43
Header declaring XRT graphics interfaces.
Auto detect OS and certain features.
xrt_perf_notify_level
Performance level.
Definition xrt_defines.h:2445
xrt_device_name
A enum that is used to name devices so that the state trackers can reason about the devices easier.
Definition xrt_defines.h:737
xrt_perf_domain
Domain type.
Definition xrt_defines.h:2418
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.