From ee649f682e737cffa3a3454f9d44c772cd2ce37d Mon Sep 17 00:00:00 2001 From: James Darpinian Date: Fri, 17 Apr 2015 10:55:47 -0700 Subject: [PATCH 1/3] Fix crash on shutdown in HMD mode. Presumably this crash is due to a bug in either the Oculus SDK or DirectX itself as changing the order of releasing these objects should not have any effect. --- src/renderer_d3d11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index fbdb710d7..29834f8cf 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -942,8 +942,8 @@ BX_PRAGMA_DIAGNOSTIC_POP(); DX_RELEASE(m_swapChain, 0); DX_RELEASE(m_deviceCtx, 0); - DX_RELEASE(m_device, 0); DX_RELEASE(m_factory, 0); + DX_RELEASE(m_device, 0); unloadRenderDoc(m_renderdocdll); From 8a689fac0d4d9405cda1748e28cda5b345dc6e04 Mon Sep 17 00:00:00 2001 From: James Darpinian Date: Fri, 17 Apr 2015 11:03:04 -0700 Subject: [PATCH 2/3] Switch Oculus distortion to high quality mode. --- src/ovr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ovr.cpp b/src/ovr.cpp index 194ba5edf..1e90bd5cc 100644 --- a/src/ovr.cpp +++ b/src/ovr.cpp @@ -117,6 +117,7 @@ namespace bgfx | ovrDistortionCap_TimeWarp | ovrDistortionCap_Overdrive | ovrDistortionCap_NoRestore + | ovrDistortionCap_HqDistortion , eyeFov , m_erd ); From b54d33cdf73ee4dc942316d4ea9f685d348a87d3 Mon Sep 17 00:00:00 2001 From: James Darpinian Date: Fri, 17 Apr 2015 11:03:41 -0700 Subject: [PATCH 3/3] Initialize Oculus pose after reset. Without this change the pose is uninitialized during the first frame which causes Oculus timewarp to warp the output in crazy ways. --- src/ovr.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ovr.cpp b/src/ovr.cpp index 1e90bd5cc..beaf20d68 100644 --- a/src/ovr.cpp +++ b/src/ovr.cpp @@ -175,6 +175,13 @@ ovrError: m_texture[1].Header.RenderViewport = rect; m_timing = ovrHmd_BeginFrame(m_hmd, 0); +#if OVR_VERSION > OVR_VERSION_042 + m_pose[0] = ovrHmd_GetHmdPosePerEye(m_hmd, ovrEye_Left); + m_pose[1] = ovrHmd_GetHmdPosePerEye(m_hmd, ovrEye_Right); +#else + m_pose[0] = ovrHmd_GetEyePose(m_hmd, ovrEye_Left); + m_pose[1] = ovrHmd_GetEyePose(m_hmd, ovrEye_Right); +#endif // OVR_VERSION > OVR_VERSION_042 } }