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:
Christoph Haag 2024-02-29 20:58:09 +01:00 committed by Marge Bot
parent 5ffe3c89a4
commit b47eaaa266
3 changed files with 11 additions and 1 deletions

View file

@ -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;
}

View file

@ -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();

View file

@ -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;