mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-13 22:27:13 +02:00
Workaround openvr crash by calling Submit before VR_Shutdown
This commit is contained in:
parent
3158439cba
commit
17d00ee3f9
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue