Is this for an OpenXR API layer, or an Unreal plugin? How and when are you calling the function? If you are hooking it in an API layer, maybe it’s getting called before the engine defines any views.
I get it via OpenXR API layer. Further calls also don’t provide XrView* views. I believe the engine should make the call itself and pass it down the chain.
I did a quick test with manually calling xrLocateViews from the xrEndFrame hook in my API layer, and it receives both views. I didn’t try hooking the call directly though.
Is the engine rendering the application in VR when you are checking the output?
Yes, I got it in xrEndFrame, but in a different way (XrCompositionLayerProjection). I just thought that there is a solution for getting it when intercepting xrLocateViews. Thank you!
Hmm, looking at the UE code, maybe the NULL is because it’s using the two-call idiom to get the array size first. Other applications probably assume the number of views.