Bladeren bron

Fixes extra frame of latency with oculus


* fix oculus latency w/ ordering of eye commits
PyryM 9 jaren geleden
bovenliggende
commit
0b73864140
3 gewijzigde bestanden met toevoegingen van 18 en 2 verwijderingen
  1. 11 0
      scripts/bgfx.lua
  2. 7 0
      src/hmd_ovr.cpp
  3. 0 2
      src/renderer_d3d11.cpp

+ 11 - 0
scripts/bgfx.lua

@@ -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" }

+ 7 - 0
src/hmd_ovr.cpp

@@ -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;

+ 0 - 2
src/renderer_d3d11.cpp

@@ -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