mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 20:56:52 +02:00
Use OpenVR to determine if async reprojection is enabled
This commit is contained in:
parent
1c89fa2291
commit
f4f1b04cf0
2 changed files with 12 additions and 3 deletions
4
cmake/externals/openvr/CMakeLists.txt
vendored
4
cmake/externals/openvr/CMakeLists.txt
vendored
|
@ -7,8 +7,8 @@ string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
|
||||||
|
|
||||||
ExternalProject_Add(
|
ExternalProject_Add(
|
||||||
${EXTERNAL_NAME}
|
${EXTERNAL_NAME}
|
||||||
URL https://github.com/ValveSoftware/openvr/archive/v1.0.2.zip
|
URL https://github.com/ValveSoftware/openvr/archive/v1.0.3.zip
|
||||||
URL_MD5 0d1cf5f579cf092e33f34759967b7046
|
URL_MD5 b484b12901917cc739e40389583c8b0d
|
||||||
CONFIGURE_COMMAND ""
|
CONFIGURE_COMMAND ""
|
||||||
BUILD_COMMAND ""
|
BUILD_COMMAND ""
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
|
|
|
@ -373,6 +373,9 @@ void OpenVrDisplayPlugin::init() {
|
||||||
emit deviceConnected(getName());
|
emit deviceConnected(getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME remove once OpenVR header is updated
|
||||||
|
#define VRCompositor_ReprojectionAsync 0x04
|
||||||
|
|
||||||
bool OpenVrDisplayPlugin::internalActivate() {
|
bool OpenVrDisplayPlugin::internalActivate() {
|
||||||
if (!_system) {
|
if (!_system) {
|
||||||
_system = acquireOpenVrSystem();
|
_system = acquireOpenVrSystem();
|
||||||
|
@ -391,7 +394,13 @@ bool OpenVrDisplayPlugin::internalActivate() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_threadedSubmit = _container->isOptionChecked(OpenVrThreadedSubmit);
|
vr::Compositor_FrameTiming timing;
|
||||||
|
memset(&timing, 0, sizeof(timing));
|
||||||
|
timing.m_nSize = sizeof(vr::Compositor_FrameTiming);
|
||||||
|
vr::VRCompositor()->GetFrameTiming(&timing);
|
||||||
|
bool asyncReprojectionActive = timing.m_nReprojectionFlags & VRCompositor_ReprojectionAsync;
|
||||||
|
|
||||||
|
_threadedSubmit = !asyncReprojectionActive;
|
||||||
qDebug() << "OpenVR Threaded submit enabled: " << _threadedSubmit;
|
qDebug() << "OpenVR Threaded submit enabled: " << _threadedSubmit;
|
||||||
|
|
||||||
_openVrDisplayActive = true;
|
_openVrDisplayActive = true;
|
||||||
|
|
Loading…
Reference in a new issue