-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Chris Birkhold edited this page Aug 29, 2018
·
4 revisions
OpenVRMetal is a collection of utility classes to make it easier to work with OpenVR + Metal on macOS. At of August 2018 Vive/SteamVR is the only officially supported combination of HMD/runtime supported on macOS.
The Metal specific part of OpenVR is quite small:
-
IVRCompositor::Submit accepts Texture_t descriptors of type:
- TextureType_IOSurface (macOS 11.13)
- TextureType_Metal (macOS 10.14+)
- IVRSystem::GetOutputDevice returns the Metal device representing the GPU the HMD is connected to.
Though however small the API surfaces may be there is a few details to be aware of:
- TextureType_IOSurface
- The kIOSurfaceIsGlobal property must be set to true/yes on creation of the IOSurface. While kIOSurfaceIsGlobal was deprecated in favor of using IOSurfaceCreateMachPort or IOSurfaceCreateXPCObject, as of August 2018 SteamVR still uses shared memory to submit IOSurface-backed textures to the compositor so this property must be set for now.
- The same two IOSurface backed Metal texture (one for each eye) must be used for all frames submitted to the compositor.
- ...
- TextureType_Metal
- ...
There are a few generic OpenVR types that need to be converted for use with the Metal framework:
- Math types (vectors, matrices, ...)
- Hidden area meshes