mirror of
https://github.com/overte-org/overte.git
synced 2025-06-15 11:26:28 +02:00
disable threaded reprojection when running oculus in OpenVR
This commit is contained in:
parent
786d09795b
commit
3a68f48cd7
3 changed files with 12 additions and 1 deletions
|
@ -401,9 +401,13 @@ bool OpenVrDisplayPlugin::internalActivate() {
|
||||||
memset(&timing, 0, sizeof(timing));
|
memset(&timing, 0, sizeof(timing));
|
||||||
timing.m_nSize = sizeof(vr::Compositor_FrameTiming);
|
timing.m_nSize = sizeof(vr::Compositor_FrameTiming);
|
||||||
vr::VRCompositor()->GetFrameTiming(&timing);
|
vr::VRCompositor()->GetFrameTiming(&timing);
|
||||||
_asyncReprojectionActive = timing.m_nReprojectionFlags & VRCompositor_ReprojectionAsync;
|
auto usingOpenVRForOculus = oculusViaOpenVR();
|
||||||
|
_asyncReprojectionActive = (timing.m_nReprojectionFlags & VRCompositor_ReprojectionAsync) || usingOpenVRForOculus;
|
||||||
|
|
||||||
_threadedSubmit = !_asyncReprojectionActive;
|
_threadedSubmit = !_asyncReprojectionActive;
|
||||||
|
if (usingOpenVRForOculus) {
|
||||||
|
qDebug() << "Oculus active via OpenVR: " << usingOpenVRForOculus;
|
||||||
|
}
|
||||||
qDebug() << "OpenVR Async Reprojection active: " << _asyncReprojectionActive;
|
qDebug() << "OpenVR Async Reprojection active: " << _asyncReprojectionActive;
|
||||||
qDebug() << "OpenVR Threaded submit enabled: " << _threadedSubmit;
|
qDebug() << "OpenVR Threaded submit enabled: " << _threadedSubmit;
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,12 @@ bool isOculusPresent() {
|
||||||
return result;
|
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() {
|
bool openVrSupported() {
|
||||||
static const QString DEBUG_FLAG("HIFI_DEBUG_OPENVR");
|
static const QString DEBUG_FLAG("HIFI_DEBUG_OPENVR");
|
||||||
static bool enableDebugOpenVR = QProcessEnvironment::systemEnvironment().contains(DEBUG_FLAG);
|
static bool enableDebugOpenVR = QProcessEnvironment::systemEnvironment().contains(DEBUG_FLAG);
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include <controllers/Forward.h>
|
#include <controllers/Forward.h>
|
||||||
#include <plugins/Forward.h>
|
#include <plugins/Forward.h>
|
||||||
|
|
||||||
|
bool oculusViaOpenVR(); // is the user using Oculus via OpenVR
|
||||||
bool openVrSupported();
|
bool openVrSupported();
|
||||||
|
|
||||||
vr::IVRSystem* acquireOpenVrSystem();
|
vr::IVRSystem* acquireOpenVrSystem();
|
||||||
|
|
Loading…
Reference in a new issue