Monado OpenXR Runtime
Loading...
Searching...
No Matches
oxr_binding_registry.h
Go to the documentation of this file.
1// Copyright 2026, NVIDIA CORPORATION.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Runtime registry built from generated OpenXR binding templates.
6 * @ingroup oxr_main
7 */
8
9#pragma once
10
11#include "xrt/xrt_defines.h"
12
13#include "oxr_extension_support.h"
15#include "oxr_binding_point.h"
17#include "oxr_refcounted.h"
18#include "oxr_subaction_store.h"
19
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/*!
26 * Complete runtime binding registry for all action contexts of an XrInstance.
27 *
28 * The registry owns all generated interaction profiles, all binding points, and
29 * all rebinding profiles. It deliberately includes generated data even when an
30 * interaction profile or path is not currently enabled for API suggestions. It
31 * is constant through the lifetime of the XrInstance, and is shared between all
32 * sessions and action contexts, and their actions.
33 */
35{
36 struct oxr_refcounted base;
37
38 //! All generated interaction profiles.
40 size_t profile_count;
41
42 //! Maps interaction profile XrPath to @ref profiles entries.
44
45 struct oxr_binding_point_store binding_points;
46
47 /*!
48 * Maps subaction paths to subaction payloads, used to singleton
49 * subactions payloads so they are shared between all the profiles.
50 */
52
53 //! All generated OpenXR-level rebinding profiles.
55 size_t rebinding_count;
56};
57
58/*!
59 * Create a complete runtime registry from generated templates.
60 *
61 * The registry does not filter by extension support or OpenXR version.
62 * Suggestion-time validation rejects paths that are unavailable to the app.
63 *
64 * @memberof oxr_binding_registry
65 */
66XRT_CHECK_RESULT XrResult
67oxr_binding_registry_create(struct oxr_logger *log,
68 struct oxr_path_store *store,
69 struct oxr_binding_registry **out_registry);
70
71/*!
72 * Add a reference to a registry.
73 *
74 * @memberof oxr_binding_registry
75 */
76void
77oxr_binding_registry_ref(struct oxr_binding_registry *registry);
78
79/*!
80 * Drop a reference to a registry and destroy it when the count reaches zero.
81 *
82 * @memberof oxr_binding_registry
83 */
84void
85oxr_binding_registry_unref(struct oxr_binding_registry *registry);
86
87/*!
88 * Find a binding profile by interaction profile path.
89 *
90 * @memberof oxr_binding_registry
91 */
92bool
93oxr_binding_registry_find_profile(const struct oxr_binding_registry *registry,
94 XrPath path,
95 const struct oxr_binding_profile **out_profile);
96
97/*!
98 * Resolve the generated unique source path returned by
99 * xrEnumerateBoundSourcesForAction.
100 *
101 * @memberof oxr_binding_registry
102 */
103bool
104oxr_binding_registry_get_for_source_path(const struct oxr_binding_registry *registry,
105 XrPath source_path,
106 const struct oxr_binding_point **out_binding_point);
107
108/*!
109 * Find a rebinding profile from a source profile to a target device.
110 *
111 * @memberof oxr_binding_registry
112 */
113bool
114oxr_binding_registry_find_rebinding_from_source_for_device(const struct oxr_binding_registry *registry,
115 XrPath source_profile_path,
116 enum xrt_device_name target_device_name,
117 const struct oxr_rebinding_profile **out_rebinding);
118
119
120#ifdef __cplusplus
121}
122#endif
Runtime binding point data cloned from generated templates.
Store of generated binding point source paths.
Forward declarations for OpenXR state tracker structs.
Reference-counted base for OpenXR state tracker objects.
Store of registry-wide OpenXR subaction path payloads.
Store mapping interaction-profile/binding-path pairs to unique source paths.
Definition oxr_binding_point_store.h:35
Runtime description of one bindable path on an interaction profile.
Definition oxr_binding_point.h:103
Runtime interaction profile binding data cloned from generated templates.
Definition oxr_binding_profile.h:26
Complete runtime binding registry for all action contexts of an XrInstance.
Definition oxr_binding_registry.h:35
struct u_hashmap_int * profiles_by_path
Maps interaction profile XrPath to profiles entries.
Definition oxr_binding_registry.h:43
struct oxr_subaction_store subactions
Maps subaction paths to subaction payloads, used to singleton subactions payloads so they are shared ...
Definition oxr_binding_registry.h:51
struct oxr_binding_profile * profiles
All generated interaction profiles.
Definition oxr_binding_registry.h:39
struct oxr_rebinding_profile * rebindings
All generated OpenXR-level rebinding profiles.
Definition oxr_binding_registry.h:54
Logger struct that lives on the stack, one for each call client call.
Definition oxr_logger.h:44
Path store structure for managing path storage and lookup.
Definition oxr_path_store.h:31
Maps binding paths from one interaction profile onto another.
Definition oxr_rebinding_profile.h:41
XrPath source_profile_path
Source interaction profile path.
Definition oxr_rebinding_profile.h:45
Definition oxr_refcounted.h:21
Registry-wide store of subaction payloads keyed by XrPath.
Definition oxr_subaction_store.h:52
A simple uint64_t key to a void pointer hashmap.
Definition u_hashmap.cpp:24
Common defines and enums for XRT.
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:758