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

Object that client program interact with. More...

#include <oxr/oxr_objects.h>

Inheritance diagram for oxr_session:
Collaboration diagram for oxr_session:

Public Member Functions

XrResult oxr_action_get_input_source_localized_name (struct oxr_logger *log, const struct oxr_path_store *store, struct oxr_session *sess, const XrInputSourceLocalizedNameGetInfo *getInfo, uint32_t bufferCapacityInput, uint32_t *bufferCountOutput, char *buffer)
 Get input source localized name.
 
XrResult oxr_action_get_boolean (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths, XrActionStateBoolean *data)
 
XrResult oxr_action_get_vector1f (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths, XrActionStateFloat *data)
 
XrResult oxr_action_get_vector2f (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths, XrActionStateVector2f *data)
 
XrResult oxr_action_get_pose (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths, XrActionStatePose *data)
 
XrResult oxr_action_get_pose_input (struct oxr_session *sess, uint32_t act_key, const struct oxr_subaction_paths *subaction_paths_ptr, struct oxr_action_input **out_input)
 Find the pose input for the set of subaction_paths.
 
XrResult oxr_session_attach_action_sets (struct oxr_logger *log, struct oxr_session *sess, const XrSessionActionSetsAttachInfo *bindInfo)
 
XrResult oxr_action_sync_data (struct oxr_logger *log, struct oxr_session *sess, uint32_t countActionSets, const XrActiveActionSet *actionSets, const XrActiveActionSetPrioritiesEXT *activePriorities)
 
XrResult oxr_action_enumerate_bound_sources (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, uint32_t sourceCapacityInput, uint32_t *sourceCountOutput, XrPath *sources)
 
XrResult oxr_action_apply_haptic_feedback (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths, const XrHapticBaseHeader *hapticEvent)
 
XrResult oxr_action_stop_haptic_feedback (struct oxr_logger *log, struct oxr_session *sess, uint32_t act_key, struct oxr_subaction_paths subaction_paths)
 
- Public Member Functions inherited from oxr_handle_base
XrResult oxr_handle_destroy (struct oxr_logger *log, struct oxr_handle_base *hb)
 Destroy the handle's object, as well as all child handles recursively.
 

Data Fields

struct oxr_handle_base handle
 Common structure for things referred to by OpenXR handles.
 
struct oxr_systemsys
 
enum oxr_session_graphics_ext gfx_ext
 What graphics type was this session created with.
 
struct xrt_sessionxs
 The xrt_session backing this session.
 
struct xrt_compositor_nativexcn
 Native compositor that is wrapped by client compositors.
 
struct xrt_compositorcompositor
 
struct oxr_sessionnext
 
XrSessionState state
 
XrViewConfigurationType current_view_config_type
 This is set in xrBeginSession and is the primaryViewConfiguration argument, this is then used in xrEndFrame to know which view configuration the application is submitting it's frame in.
 
bool has_ended_once
 There is a extra state between xrBeginSession has been called and the first xrEndFrame has been called.
 
bool compositor_visible
 
bool compositor_focused
 
int active_wait_frames
 
struct os_mutex active_wait_frames_lock
 
bool frame_started
 
bool exiting
 
struct { 
 
   int64_t   waited 
 
   int64_t   begun 
 
frame_id 
 
struct oxr_frame_sync frame_sync
 
struct os_precise_sleeper sleeper
 Used to implement precise extra sleeping in wait frame.
 
struct oxr_action_set_attachmentact_set_attachments
 An array of action set attachments that this session owns.
 
size_t action_set_attachment_count
 Length of oxr_session::act_set_attachments.
 
struct u_hashmap_intact_sets_attachments_by_key
 A map of action set key to action set attachments.
 
struct u_hashmap_intact_attachments_by_key
 A map of action key to action attachment.
 
struct oxr_interaction_profile_array profiles_on_attachment
 Clone of all suggested binding profiles at the point of action set/session attachment.
 
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.
 
float ipd_meters
 IPD, to be expanded to a proper 3D relation.
 
bool frame_timing_spew
 Frame timing debug output.
 
uint32_t frame_timing_wait_sleep_ms
 Extra sleep in wait frame.
 
XrResult(* create_swapchain )(struct oxr_logger *, struct oxr_session *sess, const XrSwapchainCreateInfo *, struct oxr_swapchain **)
 To pipe swapchain creation to right code.
 
bool has_lost
 initial relation of head in "global" space.
 
XrPath left
 
XrPath right
 
XrPath head
 
XrPath gamepad
 
XrPath eyes
 
- Data Fields inherited from oxr_handle_base
uint64_t debug
 Magic (per-handle-type) value for debugging.
 
struct oxr_handle_baseparent
 Pointer to this object's parent handle holder, if any.
 
struct oxr_handle_basechildren [256]
 Array of children, if any.
 
enum oxr_handle_state state
 Current handle state.
 
oxr_handle_destroyer destroy
 Destroy the object this handle refers to.
 

oxr_session.c

static XrSession oxr_session_to_openxr (struct oxr_session *sess)
 To go back to a OpenXR object.
 
static XrResult oxr_session_success_result (struct oxr_session *session)
 Returns XR_SUCCESS or XR_SESSION_LOSS_PENDING as appropriate.
 
static XrResult oxr_session_success_focused_result (struct oxr_session *session)
 Returns XR_SUCCESS, XR_SESSION_LOSS_PENDING, or XR_SESSION_NOT_FOCUSED, as appropriate.
 

Additional Inherited Members

- Protected Member Functions inherited from oxr_handle_base
XrResult oxr_handle_init (struct oxr_logger *log, struct oxr_handle_base *hb, uint64_t debug, oxr_handle_destroyer destroy, struct oxr_handle_base *parent)
 Initialize a handle holder, and if a parent is specified, update its child list to include this handle.
 

Detailed Description

Object that client program interact with.

Parent type/handle is oxr_instance

OpenXR Object:
XrSession

Member Function Documentation

◆ oxr_action_get_input_source_localized_name()

XrResult oxr_action_get_input_source_localized_name ( struct oxr_logger log,
const struct oxr_path_store store,
struct oxr_session sess,
const XrInputSourceLocalizedNameGetInfo *  getInfo,
uint32_t  bufferCapacityInput,
uint32_t *  bufferCountOutput,
char *  buffer 
)

Get input source localized name.

Parameters
logLogger
path_storeNeeded to look up path strings.
sessSession.
getInfoInput source localized name get info
bufferCapacityInputBuffer capacity
bufferCountOutputBuffer count output
bufferBuffer
Returns
XR_SUCCESS on success

References oxr_interaction_profile::localized_name, oxr_error(), and profiles_on_attachment.

◆ oxr_action_get_pose_input()

XrResult oxr_action_get_pose_input ( struct oxr_session sess,
uint32_t  act_key,
const struct oxr_subaction_paths subaction_paths_ptr,
struct oxr_action_input **  out_input 
)

◆ oxr_session_attach_action_sets()

Field Documentation

◆ act_attachments_by_key

struct u_hashmap_int* oxr_session::act_attachments_by_key

A map of action key to action attachment.

The action attachments are actually owned by the action set attachments, but we own the action set attachments, so this is OK.

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

Referenced by oxr_action_attachment::oxr_action_attachment_init(), and oxr_action_attachment::oxr_action_attachment_teardown().

◆ act_set_attachments

struct oxr_action_set_attachment* oxr_session::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_instance::oxr_action_get_current_interaction_profile(), oxr_action_sync_data(), oxr_session_attach_action_sets(), oxr_xrAttachSessionActionSets(), oxr_xrEnumerateBoundSourcesForAction(), and oxr_xrGetInputSourceLocalizedName().

◆ act_sets_attachments_by_key

struct u_hashmap_int* oxr_session::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::act_set_attachments

Referenced by oxr_action_set_attachment::oxr_action_set_attachment_teardown().

◆ action_set_attachment_count

size_t oxr_session::action_set_attachment_count

◆ create_swapchain

XrResult(* oxr_session::create_swapchain) (struct oxr_logger *, struct oxr_session *sess, const XrSwapchainCreateInfo *, struct oxr_swapchain **)

To pipe swapchain creation to right code.

Referenced by oxr_xrCreateSwapchain().

◆ current_view_config_type

XrViewConfigurationType oxr_session::current_view_config_type

This is set in xrBeginSession and is the primaryViewConfiguration argument, this is then used in xrEndFrame to know which view configuration the application is submitting it's frame in.

Referenced by oxr_xrLocateViews(), and verify_projection_layer().

◆ dynamic_roles_generation_id

uint64_t oxr_session::dynamic_roles_generation_id

Cache of the last known system roles generation_id.

Referenced by oxr_action_sync_data().

◆ frame_timing_spew

bool oxr_session::frame_timing_spew

Frame timing debug output.

Referenced by oxr_session_frame_end(), and oxr_session_frame_wait().

◆ frame_timing_wait_sleep_ms

uint32_t oxr_session::frame_timing_wait_sleep_ms

Extra sleep in wait frame.

Referenced by oxr_session_frame_wait().

◆ gfx_ext

enum oxr_session_graphics_ext oxr_session::gfx_ext

What graphics type was this session created with.

Referenced by oxr_xrCreateSwapchain().

◆ handle

struct oxr_handle_base oxr_session::handle

Common structure for things referred to by OpenXR handles.

Referenced by oxr_space_xdev_pose_create(), oxr_swapchain_common_create(), and oxr_xrDestroySession().

◆ has_ended_once

bool oxr_session::has_ended_once

There is a extra state between xrBeginSession has been called and the first xrEndFrame has been called.

These are to track this.

Referenced by oxr_session_request_exit().

◆ has_lost

bool oxr_session::has_lost

initial relation of head in "global" space.

Used as reference for local space.

◆ ipd_meters

float oxr_session::ipd_meters

IPD, to be expanded to a proper 3D relation.

◆ profiles_on_attachment

struct oxr_interaction_profile_array oxr_session::profiles_on_attachment

Clone of all suggested binding profiles at the point of action set/session attachment.

oxr_session_attach_action_sets

Referenced by oxr_action_get_input_source_localized_name(), and oxr_session_attach_action_sets().

◆ sleeper

struct os_precise_sleeper oxr_session::sleeper

Used to implement precise extra sleeping in wait frame.

Referenced by oxr_session_frame_wait().

◆ sync_actions_mutex

struct os_mutex oxr_session::sync_actions_mutex

Protects access to dynamic_roles_generation_id during sync actions.

Referenced by oxr_action_sync_data().

◆ xcn

struct xrt_compositor_native* oxr_session::xcn

Native compositor that is wrapped by client compositors.

◆ xs

struct xrt_session* oxr_session::xs

The xrt_session backing this session.


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