Monado OpenXR Runtime
Loading...
Searching...
No Matches
oxr_binding_registry Struct Reference

Complete runtime binding registry for all action contexts of an XrInstance. More...

#include <oxr/actions/oxr_binding_registry.h>

Collaboration diagram for oxr_binding_registry:

Public Member Functions

XRT_CHECK_RESULT XrResult oxr_binding_registry_create (struct oxr_logger *log, struct oxr_path_store *store, struct oxr_binding_registry **out_registry)
 Create a complete runtime registry from generated templates.
 
void oxr_binding_registry_ref (struct oxr_binding_registry *registry)
 Add a reference to a registry.
 
void oxr_binding_registry_unref (struct oxr_binding_registry *registry)
 Drop a reference to a registry and destroy it when the count reaches zero.
 
bool oxr_binding_registry_find_profile (const struct oxr_binding_registry *registry, XrPath path, const struct oxr_binding_profile **out_profile)
 Find a binding profile by interaction profile path.
 
bool oxr_binding_registry_get_for_source_path (const struct oxr_binding_registry *registry, XrPath source_path, const struct oxr_binding_point **out_binding_point)
 Resolve the generated unique source path returned by xrEnumerateBoundSourcesForAction.
 
bool oxr_binding_registry_find_rebinding_from_source_for_device (const struct oxr_binding_registry *registry, XrPath source_profile_path, enum xrt_device_name target_device_name, const struct oxr_rebinding_profile **out_rebinding)
 Find a rebinding profile from a source profile to a target device.
 

Data Fields

struct oxr_refcounted base
 
struct oxr_binding_profile * profiles
 All generated interaction profiles.
 
size_t profile_count
 
struct u_hashmap_int * profiles_by_path
 Maps interaction profile XrPath to profiles entries.
 
struct oxr_binding_point_store binding_points
 
struct oxr_subaction_store subactions
 Maps subaction paths to subaction payloads, used to singleton subactions payloads so they are shared between all the profiles.
 
struct oxr_rebinding_profile * rebindings
 All generated OpenXR-level rebinding profiles.
 
size_t rebinding_count
 

Detailed Description

Complete runtime binding registry for all action contexts of an XrInstance.

The registry owns all generated interaction profiles, all binding points, and all rebinding profiles. It deliberately includes generated data even when an interaction profile or path is not currently enabled for API suggestions. It is constant through the lifetime of the XrInstance, and is shared between all sessions and action contexts, and their actions.

Member Function Documentation

◆ oxr_binding_registry_create()

XRT_CHECK_RESULT XrResult oxr_binding_registry_create ( struct oxr_logger *  log,
struct oxr_path_store *  store,
struct oxr_binding_registry **  out_registry 
)

Create a complete runtime registry from generated templates.

The registry does not filter by extension support or OpenXR version. Suggestion-time validation rejects paths that are unavailable to the app.

References ARRAY_SIZE, oxr_refcounted::destroy, oxr_binding_registry_unref(), oxr_error(), profiles, profiles_by_path, rebindings, subactions, U_TYPED_ARRAY_CALLOC, and U_TYPED_CALLOC.

Referenced by oxr_instance_action_context::oxr_instance_action_context_create_with_registry().

◆ oxr_binding_registry_find_profile()

bool oxr_binding_registry_find_profile ( const struct oxr_binding_registry *  registry,
XrPath  path,
const struct oxr_binding_profile **  out_profile 
)

Find a binding profile by interaction profile path.

References profiles_by_path.

◆ oxr_binding_registry_find_rebinding_from_source_for_device()

bool oxr_binding_registry_find_rebinding_from_source_for_device ( const struct oxr_binding_registry *  registry,
XrPath  source_profile_path,
enum xrt_device_name  target_device_name,
const struct oxr_rebinding_profile **  out_rebinding 
)

◆ oxr_binding_registry_get_for_source_path()

bool oxr_binding_registry_get_for_source_path ( const struct oxr_binding_registry *  registry,
XrPath  source_path,
const struct oxr_binding_point **  out_binding_point 
)

Resolve the generated unique source path returned by xrEnumerateBoundSourcesForAction.

References oxr_binding_profile::registry.

◆ oxr_binding_registry_ref()

void oxr_binding_registry_ref ( struct oxr_binding_registry *  registry)

Add a reference to a registry.

References oxr_refcounted_ref().

◆ oxr_binding_registry_unref()

void oxr_binding_registry_unref ( struct oxr_binding_registry *  registry)

Drop a reference to a registry and destroy it when the count reaches zero.

References oxr_refcounted_unref().

Referenced by oxr_binding_registry_create(), and oxr_instance_action_context::oxr_instance_action_context_create_with_registry().

Field Documentation

◆ profiles

struct oxr_binding_profile* oxr_binding_registry::profiles

All generated interaction profiles.

Referenced by bindings.Bindings::__init__(), and oxr_binding_registry_create().

◆ profiles_by_path

struct u_hashmap_int* oxr_binding_registry::profiles_by_path

Maps interaction profile XrPath to profiles entries.

Referenced by oxr_binding_registry_create(), and oxr_binding_registry_find_profile().

◆ rebindings

struct oxr_rebinding_profile* oxr_binding_registry::rebindings

◆ subactions

struct oxr_subaction_store oxr_binding_registry::subactions

Maps subaction paths to subaction payloads, used to singleton subactions payloads so they are shared between all the profiles.

Referenced by oxr_binding_registry_create().


The documentation for this struct was generated from the following file: