Use OpenVR to determine if async reprojection is enabled

This commit is contained in:
Brad Davis 2016-10-26 16:02:06 -07:00
parent 1c89fa2291
commit f4f1b04cf0
2 changed files with 12 additions and 3 deletions

View file

@ -7,8 +7,8 @@ string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
ExternalProject_Add(
${EXTERNAL_NAME}
URL https://github.com/ValveSoftware/openvr/archive/v1.0.2.zip
URL_MD5 0d1cf5f579cf092e33f34759967b7046
URL https://github.com/ValveSoftware/openvr/archive/v1.0.3.zip
URL_MD5 b484b12901917cc739e40389583c8b0d
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""

View file

@ -373,6 +373,9 @@ void OpenVrDisplayPlugin::init() {
emit deviceConnected(getName());
}
// FIXME remove once OpenVR header is updated
#define VRCompositor_ReprojectionAsync 0x04
bool OpenVrDisplayPlugin::internalActivate() {
if (!_system) {
_system = acquireOpenVrSystem();
@ -391,7 +394,13 @@ bool OpenVrDisplayPlugin::internalActivate() {
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;
_openVrDisplayActive = true;