phr00t/FocusEngine

Vulkan support for OpenVR

Closed this issue · 8 comments

OpenVR seems to work on DirectX textures:

https://github.com/phr00t/xenko/blob/master/sources/engine/Xenko.VirtualReality/OpenVR/OpenVR.cs#L232

Vulkan should be used instead.

However, can't make much progress on this until this issue is resolved: stride3d#370

Should be done with this commit: 3853a47

However, needs proper testing.

Lots of OpenVR code in Xenko is not built due to compiler flags requiring DirectX11... work in progress

Looks like there is no Vulkan equivalent for getting a mirror texture...?

ValveSoftware/openvr#1053

This commit: b20e0e5

Allows OpenVR to build for Vulkan. However, openvr_api.dll doesn't get copied automatically to the win-vulkan/x64 library folder of a built project for some reason... also, I don't think texture.SharedHandle is functional as the Vulkan texture pointer

I have SharedHandle being set, but it looks like there is more required here:

https://github.com/ValveSoftware/openvr/wiki/Vulkan

This sets SharedHandle:

e3c9e32

...but lots of stuff needs to be done according to the wiki above

Significant progress: 3a87b36

Currently compiling & running. The OpenVR.Submit function is getting a compositor error that the app doesn't have focus, which is happening because WaitGetPoses isn't being called. This is because the VR system isn't being drawn, because it is considered disabled and not visible when checked in GameSystemsCollection.cs line 126

Why is it disabled? Not sure, but that is the next thing to fix...

Got some useful information from the vrclient__log.txt in the SteamVR logs directory. It said there was a missing Vulkan instance extension, which was added in this commit: 712ef39

Now OpenVR & Vulkan WORKS!