Bug 1384865 - Using game pose of OpenVR VRDisplay instead of render pose; r=kip
authorDaosheng Mu <daoshengmu@gmail.com>
Thu, 27 Jul 2017 17:20:58 +0800
changeset 422638 113b17f0f95d002c73be1ae29356d157afc1772d
parent 422637 4e072fd859ee7db42ebf5a26cf93c35d2697c6f9
child 422639 047029e0a1d4b5a5dcad3c70d31a25f8352d38ab
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskip
bugs1384865
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1384865 - Using game pose of OpenVR VRDisplay instead of render pose; r=kip MozReview-Commit-ID: FXnPBdyVLdE
gfx/vr/gfxVROpenVR.cpp
--- a/gfx/vr/gfxVROpenVR.cpp
+++ b/gfx/vr/gfxVROpenVR.cpp
@@ -200,19 +200,20 @@ VRDisplayOpenVR::PollEvents()
   }
 }
 
 VRHMDSensorState
 VRDisplayOpenVR::GetSensorState()
 {
   PollEvents();
 
-  ::vr::TrackedDevicePose_t poses[::vr::k_unMaxTrackedDeviceCount];
-  // Note: We *must* call WaitGetPoses in order for any rendering to happen at all
-  mVRCompositor->WaitGetPoses(poses, ::vr::k_unMaxTrackedDeviceCount, nullptr, 0);
+  const uint32_t posesSize = ::vr::k_unTrackedDeviceIndex_Hmd + 1;
+  ::vr::TrackedDevicePose_t poses[posesSize];
+  // Note: We *must* call WaitGetPoses in order for any rendering to happen at all.
+  mVRCompositor->WaitGetPoses(nullptr, 0, poses, posesSize);
 
   VRHMDSensorState result;
 
   ::vr::Compositor_FrameTiming timing;
   timing.m_nSize = sizeof(::vr::Compositor_FrameTiming);
   if (mVRCompositor->GetFrameTiming(&timing)) {
     result.timestamp = timing.m_flSystemTimeInSeconds;
   } else {