Workaround openvr crash by calling Submit before VR_Shutdown

This commit is contained in:
Anthony J. Thibault 2016-10-07 11:41:58 -07:00
parent 3158439cba
commit 17d00ee3f9

View file

@ -103,6 +103,15 @@ void releaseOpenVrSystem() {
#if DEV_BUILD
qCDebug(displayplugins) << "OpenVR: zero refcount, deallocate VR system";
#endif
// HACK: workaround openvr crash, call submit right before VR_Shutdown.
const GLuint NON_ZERO_GL_TEXTURE_HANDLE = 1;
vr::Texture_t vrTexture{ (void*)NON_ZERO_GL_TEXTURE_HANDLE, vr::API_OpenGL, vr::ColorSpace_Auto };
static vr::VRTextureBounds_t OPENVR_TEXTURE_BOUNDS_LEFT{ 0, 0, 0.5f, 1 };
static vr::VRTextureBounds_t OPENVR_TEXTURE_BOUNDS_RIGHT{ 0.5f, 0, 1, 1 };
vr::VRCompositor()->Submit(vr::Eye_Left, &vrTexture, &OPENVR_TEXTURE_BOUNDS_LEFT);
vr::VRCompositor()->Submit(vr::Eye_Right, &vrTexture, &OPENVR_TEXTURE_BOUNDS_RIGHT);
vr::VR_Shutdown();
_openVrQuitRequested = false;
activeHmd = nullptr;