Update OpenXR SDK to 1.1.38

Following the OpenXR Tutorial, the OpenXR SDK version which is build on is 1.0.34. I want to use later versions, at least 1.1.36, which contains the extension that I need, XR_META_environment_depth.

I have updated both lines of URL_HASH and URL in CMakeLists.txt to download without a problem the newer versions, as well as the line implementation in app/build.gradle to get the newer SDK version. The new version downloads without a problem, however the function xrCreateInstance returns an XrResult of -4 (XR_ERROR_API_VERSION_UNSUPPORTED). What is happening here? I have the new runtime downloaded.

I can skip this error, if before that function I manually set the version to be the previous working runtime like this

AI.apiVersion = XR_MAKE_VERSION(1, 0, 34);

xrCreateInstance returns XR_SUCCEEDED, however I don’t think this is the right solution, as further down the road I get strange errors related to functions specific to newer versions of the runtime, like xrCreateEnvironmentDepthSwapchainMETA not working at all.

I think the issue is that the runtime does not support OpenXR 1.1 (none of them seem to officially support it yet). From the spec, it seems that the correct solution is to use the macro XR_API_VERSION_1_0 instead, which does something similar to what you tried, except it sets the patch version to the latest one (1.0.38).

Not sure if using extensions specified in OpenXR 1.1 is allowed when using 1.0, the spec doesn’t seem to say anything about it.

1 Like