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

This holds all of the action state that belongs on the session level. More...

#include <oxr/actions/oxr_session_action_context.h>

Collaboration diagram for oxr_session_action_context:

Public Member Functions

XRT_CHECK_RESULT XrResult oxr_session_action_context_init (struct oxr_session_action_context *action_context, struct xrt_system_devices *xsysd, struct xrt_space_overseer *xso)
 Initialize the action context for a session.
 
XRT_NONNULL_ALL void oxr_session_action_context_fini (struct oxr_session_action_context *action_context)
 Finalize and cleanup the action context for a session.
 
XRT_NONNULL_ALL bool oxr_session_action_context_has_attached_act_sets (const struct oxr_session_action_context *action_context)
 Check if action sets have been attached to the action context.
 
XRT_NONNULL_ALL bool oxr_session_action_context_find_set (struct oxr_session_action_context *action_context, uint32_t act_set_key, struct oxr_action_set_attachment **out_act_set_attached)
 Helper to find action set attachment.
 

Data Fields

struct u_hashmap_int * act_sets_attachments_by_key
 A map of action set key to action set attachments.
 
struct oxr_action_set_attachment * act_set_attachments
 An array of action set attachments that this session owns.
 
size_t action_set_attachment_count
 Length of oxr_session_action_context::act_set_attachments.
 
struct oxr_suggested_profile_array profiles_on_attachment
 Clone of suggested binding profiles at action set/session attachment, this is mandated by the OpenXR specification.
 
struct oxr_binding_registry * binding_registry
 Binding registry used to resolve this session action context.
 
uint64_t dynamic_roles_generation_id
 Cache of the last known system roles generation_id.
 
struct os_mutex sync_actions_mutex
 Protects access to dynamic_roles_generation_id during sync actions.
 
struct oxr_priority_group_cache priority_group_cache
 
struct oxr_io_cache io_cache
 
XrPath left
 
XrPath right
 
XrPath head
 
XrPath gamepad
 
XrPath eyes
 

Detailed Description

This holds all of the action state that belongs on the session level.

Future extensions might enable multiple action contexts per session.

Member Function Documentation

◆ oxr_session_action_context_find_set()

XRT_NONNULL_ALL bool oxr_session_action_context_find_set ( struct oxr_session_action_context *  action_context,
uint32_t  act_set_key,
struct oxr_action_set_attachment **  out_act_set_attached 
)

Helper to find action set attachment.

Returns
true if the action set was found, false otherwise

References act_sets_attachments_by_key.

◆ oxr_session_action_context_fini()

XRT_NONNULL_ALL void oxr_session_action_context_fini ( struct oxr_session_action_context *  action_context)

Finalize and cleanup the action context for a session.

Safe to call after a failed oxr_session_action_context_init; only resources that init successfully created are torn down.

References act_set_attachments, act_sets_attachments_by_key, action_set_attachment_count, binding_registry, profiles_on_attachment, sync_actions_mutex, and u_hashmap_int_empty().

◆ oxr_session_action_context_has_attached_act_sets()

XRT_NONNULL_ALL bool oxr_session_action_context_has_attached_act_sets ( const struct oxr_session_action_context *  action_context)

Check if action sets have been attached to the action context.

Returns
true if action sets are attached, false otherwise

References act_set_attachments.

Referenced by oxr_xrAttachSessionActionSets().

◆ oxr_session_action_context_init()

XRT_CHECK_RESULT XrResult oxr_session_action_context_init ( struct oxr_session_action_context *  action_context,
struct xrt_system_devices *  xsysd,
struct xrt_space_overseer *  xso 
)

Field Documentation

◆ act_set_attachments

struct oxr_action_set_attachment* oxr_session_action_context::act_set_attachments

An array of action set attachments that this session owns.

If non-null, this means action sets have been attached to this session.

Referenced by oxr_action_sync_data_with_context(), oxr_session_action_context_fini(), oxr_session_action_context_has_attached_act_sets(), oxr_session_action_context_init(), oxr_session::oxr_session_attach_action_sets(), and session_clear_action_bindings().

◆ act_sets_attachments_by_key

struct u_hashmap_int* oxr_session_action_context::act_sets_attachments_by_key

A map of action set key to action set attachments.

If non-null, this means action sets have been attached to this session, since this map points to elements of oxr_session_action_context::act_set_attachments

Referenced by oxr_action_set_attachment::oxr_action_set_attachment_teardown(), oxr_session_action_context_find_set(), oxr_session_action_context_fini(), and oxr_session_action_context_init().

◆ action_set_attachment_count

◆ binding_registry

struct oxr_binding_registry* oxr_session_action_context::binding_registry

◆ dynamic_roles_generation_id

uint64_t oxr_session_action_context::dynamic_roles_generation_id

Cache of the last known system roles generation_id.

Referenced by oxr_action_sync_data_with_context().

◆ profiles_on_attachment

struct oxr_suggested_profile_array oxr_session_action_context::profiles_on_attachment

Clone of suggested binding profiles at action set/session attachment, this is mandated by the OpenXR specification.

It says that the suggested binding profiles should be snapshotted when action sets are attached to the session.

oxr_session_attach_action_sets

Referenced by oxr_session_action_context_fini(), and oxr_session::oxr_session_attach_action_sets().

◆ sync_actions_mutex

struct os_mutex oxr_session_action_context::sync_actions_mutex

Protects access to dynamic_roles_generation_id during sync actions.

Referenced by oxr_action_sync_data_with_context(), oxr_session_action_context_fini(), and oxr_session_action_context_init().


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