Turns out there is a very simple solution for this problem!
Fix: Add
createInfo.applicationInfo.apiVersion =
XR_MAKE_VERSION(XR_VERSION_MAJOR(XR_CURRENT_API_VERSION),
0, XR_VERSION_PATCH(XR_CURRENT_API_VERSION));
before the calls to xrCreateInstance
in vtkOpenXRManager.cxx
(Rendering/OpenXR
).
How did I find out: I looked into the hello_xr example from the OpenXR SDK for changes between 1.0(.34) and 1.1(.36) and the only thing I could find was that the version in the info
struct passed to xrCreateInstance
is set differently, now it is explicitly setting the minor part of the api version to 0.
Not sure what other changes would come with switching to 1.1, but for now, replicating this change is the easiest to make VTK compatible with the OpenXR SDK >= 1.1.36. Applying the fix as described above to VTK leads to applications running again without crash; I still see an error in the output:
2024-07-16 15:11:35.190 ( 2.077s) [63BA4D4551CFE43C] vtkOpenXRManager.cxx:547 ERR| (nullptr): Failed to wait frame. [XR_ERROR_SESSION_NOT_RUNNING].
but I don’t think this affects the functionality.
I have submitted a merge request, so this should hopefully also be fixed in future VTK releases.