Fixes extra frame of latency with oculus

* fix oculus latency w/ ordering of eye commits
This commit is contained in:
PyryM 2016-04-04 11:27:46 -04:00 committed by Branimir Karadžić
parent e3b71511ac
commit 0b73864140
3 changed files with 18 additions and 2 deletions

View File

@ -56,6 +56,17 @@ function bgfxProject(_name, _kind, _defines)
includedirs {
"$(OVR_DIR)/LibOVR/Include",
}
configuration { "x32" }
libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Windows/Win32/Release", _ACTION) }
configuration { "x64" }
libdirs { path.join("$(OVR_DIR)/LibOVR/Lib/Windows/x64/Release", _ACTION) }
configuration { "x32 or x64" }
links { "libovr" }
configuration {}
end
configuration { "Debug" }

View File

@ -144,6 +144,13 @@ namespace bgfx
_hmd.deviceHeight = m_hmdDesc.Resolution.h;
}
// commit eyes to HMD
for (int eye = 0; eye < 2; eye++)
{
commitEye(eye);
}
// check that eyes committed successfully
if (!m_isenabled || !OVR_SUCCESS(m_hmdFrameReady))
{
return false;

View File

@ -5077,8 +5077,6 @@ BX_PRAGMA_DIAGNOSTIC_POP();
if (m_ovr.isEnabled() )
{
m_ovr.getViewport(eye, &viewState.m_rect);
// commit previous eye to HMD and start rendering new frame
m_ovr.commitEye(eye);
m_ovr.renderEyeStart(eye);
}
else