From 3a68f48cd70b2b37807ee69f23619e231889e8c8 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Mon, 14 Nov 2016 16:30:18 -0800 Subject: [PATCH 1/2] disable threaded reprojection when running oculus in OpenVR --- plugins/openvr/src/OpenVrDisplayPlugin.cpp | 6 +++++- plugins/openvr/src/OpenVrHelpers.cpp | 6 ++++++ plugins/openvr/src/OpenVrHelpers.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/openvr/src/OpenVrDisplayPlugin.cpp b/plugins/openvr/src/OpenVrDisplayPlugin.cpp index eb0e58eb4a..bfa61f3b36 100644 --- a/plugins/openvr/src/OpenVrDisplayPlugin.cpp +++ b/plugins/openvr/src/OpenVrDisplayPlugin.cpp @@ -401,9 +401,13 @@ bool OpenVrDisplayPlugin::internalActivate() { memset(&timing, 0, sizeof(timing)); timing.m_nSize = sizeof(vr::Compositor_FrameTiming); vr::VRCompositor()->GetFrameTiming(&timing); - _asyncReprojectionActive = timing.m_nReprojectionFlags & VRCompositor_ReprojectionAsync; + auto usingOpenVRForOculus = oculusViaOpenVR(); + _asyncReprojectionActive = (timing.m_nReprojectionFlags & VRCompositor_ReprojectionAsync) || usingOpenVRForOculus; _threadedSubmit = !_asyncReprojectionActive; + if (usingOpenVRForOculus) { + qDebug() << "Oculus active via OpenVR: " << usingOpenVRForOculus; + } qDebug() << "OpenVR Async Reprojection active: " << _asyncReprojectionActive; qDebug() << "OpenVR Threaded submit enabled: " << _threadedSubmit; diff --git a/plugins/openvr/src/OpenVrHelpers.cpp b/plugins/openvr/src/OpenVrHelpers.cpp index 0c3a2faed6..56a5dd3f5b 100644 --- a/plugins/openvr/src/OpenVrHelpers.cpp +++ b/plugins/openvr/src/OpenVrHelpers.cpp @@ -60,6 +60,12 @@ bool isOculusPresent() { return result; } +bool oculusViaOpenVR() { + static const QString DEBUG_FLAG("HIFI_DEBUG_OPENVR"); + static bool enableDebugOpenVR = QProcessEnvironment::systemEnvironment().contains(DEBUG_FLAG); + return enableDebugOpenVR && isOculusPresent() && vr::VR_IsHmdPresent(); +} + bool openVrSupported() { static const QString DEBUG_FLAG("HIFI_DEBUG_OPENVR"); static bool enableDebugOpenVR = QProcessEnvironment::systemEnvironment().contains(DEBUG_FLAG); diff --git a/plugins/openvr/src/OpenVrHelpers.h b/plugins/openvr/src/OpenVrHelpers.h index be79dd1155..f00cd9e117 100644 --- a/plugins/openvr/src/OpenVrHelpers.h +++ b/plugins/openvr/src/OpenVrHelpers.h @@ -15,6 +15,7 @@ #include #include +bool oculusViaOpenVR(); // is the user using Oculus via OpenVR bool openVrSupported(); vr::IVRSystem* acquireOpenVrSystem(); From 5dd33c8dce2a7368f02e56611aeb3cad2ecef57a Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Mon, 14 Nov 2016 20:58:09 -0800 Subject: [PATCH 2/2] fix for mac min openGL version --- libraries/gl/src/gl/OpenGLVersionChecker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/gl/src/gl/OpenGLVersionChecker.cpp b/libraries/gl/src/gl/OpenGLVersionChecker.cpp index 428bf86c6f..f24a9bb932 100644 --- a/libraries/gl/src/gl/OpenGLVersionChecker.cpp +++ b/libraries/gl/src/gl/OpenGLVersionChecker.cpp @@ -50,7 +50,8 @@ QJsonObject OpenGLVersionChecker::checkVersion(bool& valid, bool& override) { valid = true; override = false; - QGLWidget* glWidget = new QGLWidget(); + QGLWidget* glWidget = new QGLWidget(getDefaultGLFormat()); + valid = glWidget->isValid(); // Inform user if no OpenGL support if (!valid) {