diff --git a/src/xrt/state_trackers/oxr/oxr_api_instance.c b/src/xrt/state_trackers/oxr/oxr_api_instance.c index e82b5b010..512ecb795 100644 --- a/src/xrt/state_trackers/oxr/oxr_api_instance.c +++ b/src/xrt/state_trackers/oxr/oxr_api_instance.c @@ -66,26 +66,29 @@ oxr_xrCreateInstance(const XrInstanceCreateInfo* createInfo, oxr_log_init(&log, "xrCreateInstance"); OXR_VERIFY_ARG_TYPE_AND_NULL(&log, createInfo, XR_TYPE_INSTANCE_CREATE_INFO); -#if XR_VERSION_MAJOR != 0 -#error "Must update this code following 1.0 release!" -#endif const uint32_t major = XR_VERSION_MAJOR(XR_CURRENT_API_VERSION); const uint32_t minor = XR_VERSION_MINOR(XR_CURRENT_API_VERSION); - /* const uint32_t patch = XR_VERSION_PATCH(XR_CURRENT_API_VERSION);*/ +#if 0 + const uint32_t patch = XR_VERSION_PATCH(XR_CURRENT_API_VERSION); +#endif + if (createInfo->applicationInfo.apiVersion < XR_MAKE_VERSION(major, minor, 0)) { return oxr_error( - &log, XR_ERROR_RUNTIME_VERSION_INCOMPATIBLE, + &log, XR_ERROR_API_VERSION_UNSUPPORTED, "(createInfo->applicationInfo.apiVersion) " "Cannot satisfy request for version less than %d.%d.%d", major, minor, 0); } - /* This is a slight fib, to let us approximately run pre-release - * things between 0.90 and 1.0 */ + + /* + * This is a slight fib, to let us approximately run things between 1.0 + * and 2.0 + */ if (createInfo->applicationInfo.apiVersion >= - XR_MAKE_VERSION(1, 0, 0)) { + XR_MAKE_VERSION(2, 0, 0)) { return oxr_error( - &log, XR_ERROR_RUNTIME_VERSION_INCOMPATIBLE, + &log, XR_ERROR_API_VERSION_UNSUPPORTED, "(createInfo->applicationInfo.apiVersion) " "Cannot satisfy request for version: too high"); } diff --git a/src/xrt/state_trackers/oxr/oxr_api_negotiate.c b/src/xrt/state_trackers/oxr/oxr_api_negotiate.c index a30591061..44bceb368 100644 --- a/src/xrt/state_trackers/oxr/oxr_api_negotiate.c +++ b/src/xrt/state_trackers/oxr/oxr_api_negotiate.c @@ -59,33 +59,23 @@ xrNegotiateLoaderRuntimeInterface(const XrNegotiateLoaderInfo* loaderInfo, // TODO: properly define what we support uint16_t supported_major = XR_VERSION_MAJOR(XR_CURRENT_API_VERSION); - uint16_t supported_minor = XR_VERSION_MINOR(XR_CURRENT_API_VERSION); - uint16_t requested_min_major = - XR_VERSION_MAJOR(loaderInfo->minInterfaceVersion); - uint16_t requested_min_minor = - XR_VERSION_MINOR(loaderInfo->minInterfaceVersion); - - uint16_t requested_max_major = - XR_VERSION_MAJOR(loaderInfo->maxInterfaceVersion); - uint16_t requested_max_minor = - XR_VERSION_MINOR(loaderInfo->maxInterfaceVersion); + uint32_t requested_min_major = loaderInfo->minInterfaceVersion; + uint32_t requested_max_major = loaderInfo->maxInterfaceVersion; if (supported_major > requested_max_major || supported_major < requested_min_major) { PRINT_NEGOTIATE( - "\tXRT - OpenXR doesn't support requested version %d.%d <= " - "%d.%d <= %d.%d", - requested_min_major, requested_min_minor, supported_major, - supported_minor, requested_max_major, requested_max_minor); + "\tXRT - OpenXR doesn't support requested version %d <= " + "%d <= %d\n", + requested_min_major, supported_major, requested_max_major); return XR_ERROR_INITIALIZATION_FAILED; } runtimeRequest->getInstanceProcAddr = oxr_xrGetInstanceProcAddr; runtimeRequest->runtimeInterfaceVersion = XR_CURRENT_LOADER_RUNTIME_VERSION; - runtimeRequest->runtimeXrVersion = - XR_MAKE_VERSION(0, XR_HEADER_VERSION, 0); + runtimeRequest->runtimeApiVersion = XR_CURRENT_API_VERSION; PRINT_NEGOTIATE("\tall ok!\n");