mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-29 18:08:29 +00:00
st/oxr: Record OpenXR major.minor version on oxr_instance
This is needed to differentiate e.g. OpenXR 1.1 functionality from OpenXR 1.0. Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2194>
This commit is contained in:
parent
5ffe3c89a4
commit
b47eaaa266
|
@ -201,7 +201,7 @@ oxr_xrCreateInstance(const XrInstanceCreateInfo *createInfo, XrInstance *out_ins
|
|||
#endif
|
||||
struct oxr_instance *inst = NULL;
|
||||
|
||||
ret = oxr_instance_create(&log, createInfo, &extensions, &inst);
|
||||
ret = oxr_instance_create(&log, createInfo, app_major_minor, &extensions, &inst);
|
||||
if (ret != XR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -193,6 +193,7 @@ apply_quirks(struct oxr_logger *log, struct oxr_instance *inst)
|
|||
XrResult
|
||||
oxr_instance_create(struct oxr_logger *log,
|
||||
const XrInstanceCreateInfo *createInfo,
|
||||
XrVersion major_minor,
|
||||
const struct oxr_extension_status *extensions,
|
||||
struct oxr_instance **out_instance)
|
||||
{
|
||||
|
@ -205,6 +206,7 @@ oxr_instance_create(struct oxr_logger *log,
|
|||
OXR_ALLOCATE_HANDLE_OR_RETURN(log, inst, OXR_XR_DEBUG_INSTANCE, oxr_instance_destroy, NULL);
|
||||
|
||||
inst->extensions = *extensions; // Sets the enabled extensions.
|
||||
inst->openxr_version.major_minor = major_minor;
|
||||
inst->lifecycle_verbose = debug_get_bool_option_lifecycle_verbose();
|
||||
inst->debug_spaces = debug_get_bool_option_debug_spaces();
|
||||
inst->debug_views = debug_get_bool_option_debug_views();
|
||||
|
|
|
@ -226,6 +226,7 @@ oxr_instance_to_openxr(struct oxr_instance *inst)
|
|||
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);
|
||||
|
||||
|
@ -1604,6 +1605,13 @@ struct oxr_instance
|
|||
//! Enabled extensions
|
||||
struct oxr_extension_status extensions;
|
||||
|
||||
//! The OpenXR version requested in the app info. It determines the instance's OpenXR version.
|
||||
struct
|
||||
{
|
||||
//! Stores only major.minor version. Simplifies comparisons for e.g. "at least OpenXR 1.1".
|
||||
XrVersion major_minor;
|
||||
} openxr_version;
|
||||
|
||||
// Hardcoded single system.
|
||||
struct oxr_system system;
|
||||
|
||||
|
|
Loading…
Reference in a new issue