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

Per-session cache of priority group states. More...

#include <oxr/actions/oxr_priority_group_cache.h>

Collaboration diagram for oxr_priority_group_cache:

Public Member Functions

XRT_CHECK_RESULT XrResult oxr_priority_group_cache_init (struct oxr_priority_group_cache *cache)
 Initialize a priority group cache.
 
void oxr_priority_group_cache_fini (struct oxr_priority_group_cache *cache)
 Finalize a priority group cache.
 
void oxr_priority_group_cache_clear (struct oxr_priority_group_cache *cache)
 Clear a priority group cache.
 
void oxr_priority_group_cache_zero_priorities (struct oxr_priority_group_cache *cache)
 Reset accumulated action-set priorities for every priority group.
 
XRT_CHECK_RESULT XrResult oxr_priority_group_cache_get_or_create (struct oxr_priority_group_cache *cache, XrPath path, struct oxr_priority_group_state **out_state)
 Look up or allocate shared priority state for a binding priority group path.
 

Data Fields

struct u_hashmap_int * states_by_path
 

Detailed Description

Per-session cache of priority group states.

Implements the OpenXR action-set priority rules described for XrActionSetCreateInfo::priority: when several active action sets bind actions to the same input source, higher priority wins and lower-priority bindings are suppressed (treated as inactive, with no feedback). Priority groups here are the runtime's notion of that shared input source, filled while resolving suggested bindings and re-evaluated each action sync.

States are allocated individually so pointers stored on action inputs remain stable until the cache is cleared (for example when interaction profiles change and bindings are rebuilt).

Member Function Documentation

◆ oxr_priority_group_cache_clear()

void oxr_priority_group_cache_clear ( struct oxr_priority_group_cache *  cache)

Clear a priority group cache.

References u_hashmap_int_clear_and_call_for_each().

◆ oxr_priority_group_cache_fini()

void oxr_priority_group_cache_fini ( struct oxr_priority_group_cache *  cache)

Finalize a priority group cache.

◆ oxr_priority_group_cache_get_or_create()

XRT_CHECK_RESULT XrResult oxr_priority_group_cache_get_or_create ( struct oxr_priority_group_cache *  cache,
XrPath  path,
struct oxr_priority_group_state **  out_state 
)

Look up or allocate shared priority state for a binding priority group path.

Used while resolving suggested bindings: inputs that share a priority group (typically the same physical control) all reference one accumulator so later action sync can suppress lower-priority action sets on that surface.

References U_TYPED_CALLOC.

◆ oxr_priority_group_cache_init()

XRT_CHECK_RESULT XrResult oxr_priority_group_cache_init ( struct oxr_priority_group_cache *  cache)

Initialize a priority group cache.

References U_ZERO.

◆ oxr_priority_group_cache_zero_priorities()

void oxr_priority_group_cache_zero_priorities ( struct oxr_priority_group_cache *  cache)

Reset accumulated action-set priorities for every priority group.

Called when syncing actions so the runtime can recompute, from the currently active action sets, which priority wins on each shared control surface. The group entries themselves stay alive so resolved inputs keep stable pointers.

References u_hashmap_int_for_each().


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