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

Snapshot of the cache layout. More...

#include <xrt/xrt_io_cache.h>

Collaboration diagram for xrt_io_cache_info:

Public Member Functions

 XRT_ALIGNAS (8) uint32_t device_count
 Number of entries in devices that are valid.
 

Data Fields

uint64_t generation_id
 Monotonically increasing layout generation; changes when devices, their input/output counts, or the role assignment below change.
 
struct xrt_io_cache_device devices [XRT_SYSTEM_MAX_DEVICES]
 Per-device layout entries.
 
uint32_t input_count
 Total number of inputs across all devices.
 
uint32_t output_count
 Total number of outputs across all devices.
 
int32_t head
 Index into devices for the user's head device, or -1 if none.
 
int32_t eyes
 Index into devices for the user's eye tracker, or -1 if none.
 
int32_t left
 Index into devices for the user's left controller, or -1 if none.
 
int32_t right
 Index into devices for the user's right controller, or -1 if none.
 
int32_t gamepad
 Index into devices for the user's gamepad, or -1 if none.
 

Detailed Description

Snapshot of the cache layout.

Returned by xrt_io_cache::get_info.

generation_id must be passed to xrt_io_cache::read together with input_count and output_count. If the generation no longer matches the live cache layout, xrt_io_cache::read sets out_stale to true and returns XRT_SUCCESS without writing the arrays.

The head, eyes, left, right and gamepad fields describe the current role assignment as indices into devices (mirroring how xrt_system_roles indexes into xrt_system_devices::static_xdevs). They let a consumer resolve interaction profiles for the top-level user paths without touching any xrt_device. The controller roles (left, right, gamepad) are dynamic; the head and eyes roles are static but duplicated here for convenience so that a consumer can resolve every top-level path purely from the cache. A change to a dynamic role assignment also bumps generation_id.

Member Function Documentation

◆ XRT_ALIGNAS()

xrt_io_cache_info::XRT_ALIGNAS ( 8  )

Number of entries in devices that are valid.

Field Documentation

◆ devices

struct xrt_io_cache_device xrt_io_cache_info::devices[XRT_SYSTEM_MAX_DEVICES]

Per-device layout entries.

Referenced by binding_device_from_cache(), and oxr_io_cache::oxr_io_cache_find_device().

◆ eyes

int32_t xrt_io_cache_info::eyes

Index into devices for the user's eye tracker, or -1 if none.

◆ gamepad

int32_t xrt_io_cache_info::gamepad

Index into devices for the user's gamepad, or -1 if none.

◆ generation_id

uint64_t xrt_io_cache_info::generation_id

Monotonically increasing layout generation; changes when devices, their input/output counts, or the role assignment below change.

Referenced by oxr_io_cache::oxr_io_cache_sync().

◆ head

int32_t xrt_io_cache_info::head

Index into devices for the user's head device, or -1 if none.

◆ input_count

uint32_t xrt_io_cache_info::input_count

Total number of inputs across all devices.

Referenced by oxr_io_cache::oxr_io_cache_recreate(), and oxr_io_cache::oxr_io_cache_sync().

◆ left

int32_t xrt_io_cache_info::left

Index into devices for the user's left controller, or -1 if none.

◆ output_count

uint32_t xrt_io_cache_info::output_count

Total number of outputs across all devices.

Referenced by oxr_io_cache::oxr_io_cache_recreate(), and oxr_io_cache::oxr_io_cache_sync().

◆ right

int32_t xrt_io_cache_info::right

Index into devices for the user's right controller, or -1 if none.


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