|
Monado OpenXR Runtime
|
Main object that ties everything together. More...
#include <oxr/oxr_objects.h>


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_instance * | xinst | |
| 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_state * | timekeeping | |
| 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_session * | sessions | |
| struct oxr_instance_path_cache | path_cache | |
| Path cache for actions, needs path_store to work. | ||
| struct oxr_instance_action_context * | action_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_messenger * | messengers [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_base * | parent | |
| Pointer to this object's parent handle holder, if any. | ||
| struct oxr_handle_base * | children [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. | |
Related Symbols inherited from oxr_handle_base | |
| typedef XrResult(* | oxr_handle_destroyer) (struct oxr_logger *log, struct oxr_handle_base *hb) |
| Function pointer type for a handle destruction function. | |
| XrResult | oxr_handle_allocate_and_init (struct oxr_logger *log, size_t size, uint64_t debug, oxr_handle_destroyer destroy, struct oxr_handle_base *parent, void **out) |
| Allocate some memory for use as a handle, and initialize it as a handle. | |
| #define | OXR_ALLOCATE_HANDLE(LOG, OUT, DEBUG, DESTROY, PARENT) oxr_handle_allocate_and_init(LOG, sizeof(*OUT), DEBUG, DESTROY, PARENT, (void **)&OUT) |
| Allocates memory for a handle and evaluates to an XrResult. | |
| #define | OXR_ALLOCATE_HANDLE_OR_RETURN(LOG, OUT, DEBUG, DESTROY, PARENT) |
| Allocate memory for a handle, returning in case of failure. | |
| const char * | oxr_handle_state_to_string (enum oxr_handle_state state) |
| Returns a human-readable label for a handle state. | |
Main object that ties everything together.
No parent type/handle: this is the root handle.
| 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.
| log | Logger |
| cache | Instance path cache |
| sess | Session |
| topLevelUserPath | Top-level user path (e.g. left hand) |
| interactionProfile | Output interaction profile state |
References oxr_session::act_set_attachments, oxr_error(), and OXR_FOR_EACH_VALID_SUBACTION_PATH.
| 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.
| log | Logger |
| store | Path store; paths may be created in the store. |
| cache | Instance path cache; used to get the profile template. |
| inst_context | Instance action context |
| suggestedBindings | Suggested bindings for the interaction profile |
| state | Dpad state (ownership transferred into the profile) |
References U_ZERO, and XRT_CAST_OXR_HANDLE_TO_PTR.
| 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.
References OXR_FOR_EACH_VALID_SUBACTION_PATH, path_cache, path_store, and U_ZERO.
|
inlinestatic |
Get the path for the given string if it exists, or create it if it does not.
References path_store.
|
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.
|
inlinestatic |
Only get the path for the given string if it exists.
References path_store.
| 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().
| 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
Referenced by oxr_instance_create().
| 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,
In the past it was used to work around a bug in Unreal's VulkanRHI backend.
Referenced by oxr_instance_create().
| struct oxr_extension_status oxr_instance::extensions |
Enabled extensions.
Referenced by handle_non_null(), oxr_instance_create(), oxr_swapchain_common_create(), oxr_system_fill_in(), oxr_xrCreateInstance(), oxr_xrCreateSwapchain(), and oxr_xrSuggestInteractionProfileBindings().
| 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().
| 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().
| bool oxr_instance::map_stage_to_local_floor |
For applications that use stage and don't offer recentering.
| struct oxr_debug_messenger* oxr_instance::messengers[256] |
Debug messengers.
Referenced by oxr_create_messenger().
| 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().
| 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 { ... } 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().
| bool oxr_instance::parallel_views |
For applications that rely on views being parallel, notably some OpenVR games with OpenComposite.
Referenced by oxr_instance_create().
| struct oxr_instance_path_cache oxr_instance::path_cache |
Path cache for actions, needs path_store to work.
Referenced by oxr_classify_subaction_paths(), oxr_instance_create(), oxr_xrGetCurrentInteractionProfile(), and oxr_xrSuggestInteractionProfileBindings().
| struct oxr_path_store oxr_instance::path_store |
Path store for managing paths.
Referenced by oxr_classify_subaction_paths(), oxr_instance_create(), oxr_path_get_or_create(), oxr_path_get_string(), oxr_path_only_get(), oxr_xrGetInputSourceLocalizedName(), and oxr_xrSuggestInteractionProfileBindings().
| bool oxr_instance::skip_end_session |
Unreal 4 has a bug calling xrEndSession; the function should just exit.
Referenced by oxr_instance_create().