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

Main object that ties everything together. More...

#include <oxr/oxr_objects.h>

Inheritance diagram for oxr_instance:
Collaboration diagram for oxr_instance:

Public Member Functions

XrResult oxr_action_suggest_interaction_profile_bindings (struct oxr_logger *log, struct oxr_path_store *store, const struct oxr_instance_path_cache *cache, struct oxr_instance_action_context *inst_context, const XrInteractionProfileSuggestedBinding *suggestedBindings, struct oxr_dpad_state *state)
 Suggest bindings for an interaction profile.
 
XrResult oxr_action_get_current_interaction_profile (struct oxr_logger *log, const struct oxr_instance_path_cache *cache, struct oxr_session *sess, XrPath topLevelUserPath, XrInteractionProfileState *interactionProfile)
 Get the currently active interaction profile for a top-level user path on the session (e.g.
 
XrResult oxr_action_set_create (struct oxr_logger *log, struct oxr_instance *inst, struct oxr_instance_action_context *inst_context, const XrActionSetCreateInfo *createInfo, struct oxr_action_set **out_act_set)
 
bool oxr_classify_subaction_paths (struct oxr_logger *log, const struct oxr_instance *inst, uint32_t subaction_path_count, const XrPath *subaction_paths, struct oxr_subaction_paths *subaction_paths_out)
 Helper function to classify 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.
 

Static Public Member Functions

static bool oxr_path_is_valid (struct oxr_logger *log, struct oxr_instance *inst, XrPath path)
 
static XrResult oxr_path_get_or_create (struct oxr_logger *log, struct oxr_instance *inst, const char *str, size_t length, XrPath *out_path)
 Get the path for the given string if it exists, or create it if it does not.
 
static void oxr_path_only_get (struct oxr_logger *log, struct oxr_instance *inst, const char *str, size_t length, XrPath *out_path)
 Only get the path for the given string if it exists.
 
static XrResult oxr_path_get_string (struct oxr_logger *log, const struct oxr_instance *inst, XrPath path, const char **out_str, size_t *out_length)
 Get a pointer and length of the internal string.
 

Data Fields

struct oxr_handle_base handle
 Common structure for things referred to by OpenXR handles.
 
struct u_debug_gui * debug_ui
 
struct xrt_instancexinst
 
struct oxr_extension_status extensions
 Enabled extensions.
 
struct { 
 
   XrVersion   major_minor 
 Stores only major.minor version. Simplifies comparisons for e.g. "at least OpenXR 1.1". More...
 
openxr_version 
 The OpenXR version requested in the app info. It determines the instance's OpenXR version.
 
struct os_mutex system_init_lock
 
struct oxr_system system
 
struct time_statetimekeeping
 
struct oxr_path_store path_store
 Path store for managing paths.
 
struct { 
 
   struct os_mutex   mutex 
 
   struct oxr_event *   last 
 
   struct oxr_event *   next 
 
event 
 
struct oxr_sessionsessions
 
struct oxr_instance_path_cache path_cache
 Path cache for actions, needs path_store to work.
 
struct oxr_instance_action_contextaction_context
 The default action context (reference-counted). Owned by instance; action sets also hold references.
 
struct { 
 
   struct { 
 
      struct { 
 
         uint32_t   major 
 
         uint32_t   minor 
 
         uint32_t   patch 
 
         const char *   name 
 
      }   engine 
 
   }   detected 
 
appinfo 
 
struct { 
 
   bool   disable_vulkan_format_depth 
 Some applications can't handle depth formats, or they trigger a bug in a specific version of the application or engine. More...
 
   bool   disable_vulkan_format_depth_stencil 
 Some applications can't handle depth stencil formats, or they trigger a bug in a specific version of the application or engine. More...
 
   bool   skip_end_session 
 Unreal 4 has a bug calling xrEndSession; the function should just exit. More...
 
   bool   no_validation_error_in_create_ref_space 
 Return XR_ERROR_REFERENCE_SPACE_UNSUPPORTED instead of XR_ERROR_VALIDATION_FAILURE in xrCreateReferenceSpace. More...
 
   bool   parallel_views 
 For applications that rely on views being parallel, notably some OpenVR games with OpenComposite. More...
 
   bool   map_stage_to_local_floor 
 For applications that use stage and don't offer recentering. More...
 
   bool   no_texture_source_alpha 
 Beat Saber submits its projection layer with XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT set. More...
 
quirks 
 
struct oxr_debug_messengermessengers [256]
 Debug messengers.
 
bool lifecycle_verbose
 
bool debug_views
 
bool debug_spaces
 
bool debug_bindings
 
- 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_instance.c

XrResult oxr_instance_init_system_locked (struct oxr_logger *log, struct oxr_instance *inst)
 Must be called with oxr_instance::system_init_lock held.
 
XrResult oxr_instance_get_properties (struct oxr_logger *log, struct oxr_instance *inst, XrInstanceProperties *instanceProperties)
 
XrResult oxr_instance_convert_time_to_timespec (struct oxr_logger *log, struct oxr_instance *inst, XrTime time, struct timespec *timespecTime)
 
XrResult oxr_instance_convert_timespec_to_time (struct oxr_logger *log, struct oxr_instance *inst, const struct timespec *timespecTime, XrTime *time)
 
static XrInstance oxr_instance_to_openxr (struct oxr_instance *inst)
 To go back to a OpenXR object.
 
XrResult oxr_instance_create (struct oxr_logger *log, const XrInstanceCreateInfo *createInfo, XrVersion major_minor, const struct oxr_extension_status *extensions, struct oxr_instance **out_inst)
 Creates a instance, does minimal validation of createInfo.
 

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

Main object that ties everything together.

No parent type/handle: this is the root handle.

OpenXR Object:
XrInstance

Member Function Documentation

◆ oxr_action_get_current_interaction_profile()

XrResult oxr_action_get_current_interaction_profile ( struct oxr_logger log,
const struct oxr_instance_path_cache cache,
struct oxr_session sess,
XrPath  topLevelUserPath,
XrInteractionProfileState *  interactionProfile 
)

Get the currently active interaction profile for a top-level user path on the session (e.g.

/user/hand/left). Requires action sets to be attached.

Parameters
logLogger
cacheInstance path cache
sessSession
topLevelUserPathTop-level user path (e.g. left hand)
interactionProfileOutput interaction profile state
Returns
XR_SUCCESS on success

References oxr_session::act_set_attachments, oxr_error(), and OXR_FOR_EACH_VALID_SUBACTION_PATH.

◆ oxr_action_suggest_interaction_profile_bindings()

XrResult oxr_action_suggest_interaction_profile_bindings ( struct oxr_logger log,
struct oxr_path_store store,
const struct oxr_instance_path_cache cache,
struct oxr_instance_action_context inst_context,
const XrInteractionProfileSuggestedBinding *  suggestedBindings,
struct oxr_dpad_state state 
)

Suggest bindings for an interaction profile.

Finds or creates the profile for the given path, resets its binding keys, applies the suggested action–path bindings and takes ownership of the given dpad state.

Parameters
logLogger
storePath store; paths may be created in the store.
cacheInstance path cache; used to get the profile template.
inst_contextInstance action context
suggestedBindingsSuggested bindings for the interaction profile
stateDpad state (ownership transferred into the profile)
Returns
XR_SUCCESS on success

References U_ZERO, and XRT_CAST_OXR_HANDLE_TO_PTR.

◆ oxr_classify_subaction_paths()

bool oxr_classify_subaction_paths ( struct oxr_logger log,
const struct oxr_instance inst,
uint32_t  subaction_path_count,
const XrPath *  subaction_paths,
struct oxr_subaction_paths subaction_paths_out 
)

Helper function to classify subaction_paths.

Sets all members of subaction_paths ( oxr_subaction_paths ) as appropriate based on the subaction paths found in the list.

If no paths are provided, subaction_paths->any will be true.

Returns
false if an invalid subaction path is provided.
See also
oxr_subaction_paths

References OXR_FOR_EACH_VALID_SUBACTION_PATH, path_cache, path_store, and U_ZERO.

◆ oxr_path_get_or_create()

static XrResult oxr_path_get_or_create ( struct oxr_logger log,
struct oxr_instance inst,
const char *  str,
size_t  length,
XrPath *  out_path 
)
inlinestatic

Get the path for the given string if it exists, or create it if it does not.

References path_store.

◆ oxr_path_get_string()

static XrResult oxr_path_get_string ( struct oxr_logger log,
const struct oxr_instance inst,
XrPath  path,
const char **  out_str,
size_t out_length 
)
inlinestatic

Get a pointer and length of the internal string.

The pointer has the same life time as the instance. The length is the number of valid characters, not including the null termination character (but an extra null byte is always reserved at the end so can strings can be given to functions expecting null terminated strings).

References path_store.

◆ oxr_path_only_get()

static void oxr_path_only_get ( struct oxr_logger log,
struct oxr_instance inst,
const char *  str,
size_t  length,
XrPath *  out_path 
)
inlinestatic

Only get the path for the given string if it exists.

References path_store.

Field Documentation

◆ action_context

struct oxr_instance_action_context* oxr_instance::action_context

The default action context (reference-counted). Owned by instance; action sets also hold references.

Referenced by oxr_instance_create(), oxr_session::oxr_session_attach_action_sets(), oxr_xrCreateActionSet(), and oxr_xrSuggestInteractionProfileBindings().

◆ disable_vulkan_format_depth

bool oxr_instance::disable_vulkan_format_depth

Some applications can't handle depth formats, or they trigger a bug in a specific version of the application or engine.

This flag only disables depth formats

See also
disable_vulkan_format_depth_stencil for depth-stencil formats.

Referenced by oxr_instance_create().

◆ disable_vulkan_format_depth_stencil

bool oxr_instance::disable_vulkan_format_depth_stencil

Some applications can't handle depth stencil formats, or they trigger a bug in a specific version of the application or engine.

This flag only disables depth-stencil formats,

See also
disable_vulkan_format_depth flag for depth only formats.

In the past it was used to work around a bug in Unreal's VulkanRHI backend.

Referenced by oxr_instance_create().

◆ extensions

◆ handle

struct oxr_handle_base oxr_instance::handle

Common structure for things referred to by OpenXR handles.

Referenced by oxr_create_messenger(), oxr_instance_create(), and oxr_xrDestroyInstance().

◆ major_minor

XrVersion oxr_instance::major_minor

Stores only major.minor version. Simplifies comparisons for e.g. "at least OpenXR 1.1".

Referenced by oxr_instance_create(), and oxr_xrSuggestInteractionProfileBindings().

◆ map_stage_to_local_floor

bool oxr_instance::map_stage_to_local_floor

For applications that use stage and don't offer recentering.

◆ messengers

struct oxr_debug_messenger* oxr_instance::messengers[256]

Debug messengers.

Referenced by oxr_create_messenger().

◆ no_texture_source_alpha

bool oxr_instance::no_texture_source_alpha

Beat Saber submits its projection layer with XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT set.

This breaks rendering because the game uses the alpha texture to store data for the bloom shader, causing most of the game to render as black, only showing glowing parts of the image.

Referenced by oxr_instance_create().

◆ no_validation_error_in_create_ref_space

bool oxr_instance::no_validation_error_in_create_ref_space

Return XR_ERROR_REFERENCE_SPACE_UNSUPPORTED instead of XR_ERROR_VALIDATION_FAILURE in xrCreateReferenceSpace.

Referenced by oxr_instance_create(), and oxr_xrCreateReferenceSpace().

◆ [struct]

struct { ... } oxr_instance::openxr_version

The OpenXR version requested in the app info. It determines the instance's OpenXR version.

Referenced by oxr_instance_create(), and oxr_xrSuggestInteractionProfileBindings().

◆ parallel_views

bool oxr_instance::parallel_views

For applications that rely on views being parallel, notably some OpenVR games with OpenComposite.

Referenced by oxr_instance_create().

◆ path_cache

struct oxr_instance_path_cache oxr_instance::path_cache

◆ path_store

◆ skip_end_session

bool oxr_instance::skip_end_session

Unreal 4 has a bug calling xrEndSession; the function should just exit.

Referenced by oxr_instance_create().


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