Remove commitEye() and fix extra frame of latency in OpenGL as well

This commit is contained in:
Krzysztof Kondrak 2016-04-04 20:25:52 +02:00 committed by Branimir Karadžić
parent 0b73864140
commit 0624a5350e
3 changed files with 6 additions and 24 deletions

View File

@ -13,7 +13,6 @@ namespace bgfx
: m_hmd(NULL)
, m_isenabled(false)
, m_mirror(NULL)
, m_hmdFrameReady(-1)
, m_frameIndex(0)
, m_sensorSampleTime(0)
{
@ -125,14 +124,6 @@ namespace bgfx
}
}
void OVR::commitEye(uint8_t _eye)
{
if (m_isenabled)
{
m_hmdFrameReady = ovr_CommitTextureSwapChain(m_hmd, m_eyeBuffers[_eye]->m_swapTextureChain);
}
}
bool OVR::swap(HMD& _hmd, bool originBottomLeft)
{
_hmd.flags = BGFX_HMD_NONE;
@ -144,16 +135,15 @@ namespace bgfx
_hmd.deviceHeight = m_hmdDesc.Resolution.h;
}
if (!m_isenabled)
{
return false;
}
// 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;
ovr_CommitTextureSwapChain(m_hmd, m_eyeBuffers[eye]->m_swapTextureChain);
}
_hmd.flags |= BGFX_HMD_RENDERING;

View File

@ -72,7 +72,6 @@ namespace bgfx
void renderEyeStart(uint8_t _eye);
bool postReset();
void preReset();
void commitEye(uint8_t _eye);
bool swap(HMD& _hmd, bool originBottomLeft);
void recenter();
void getEyePose(HMD& _hmd);
@ -84,7 +83,6 @@ namespace bgfx
ovrPosef m_pose[2];
ovrVector3f m_hmdToEyeOffset[2];
ovrSizei m_hmdSize;
ovrResult m_hmdFrameReady;
OVRBufferI *m_eyeBuffers[2];
OVRMirrorI *m_mirror;
long long m_frameIndex;
@ -139,10 +137,6 @@ namespace bgfx
_viewport->m_height = 0;
}
void commitEye(uint8_t /*_eye*/)
{
}
void renderEyeStart(uint8_t /*_eye*/)
{
}

View File

@ -5658,8 +5658,6 @@ namespace bgfx { namespace gl
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