Skip to content

Commit

Permalink
fix: low fps in titlelevel (title screen) when retrieving poses for r…
Browse files Browse the repository at this point in the history
…endering

(cherry picked from commit 632177b)
(cherry picked from commit b6a6a9e)
  • Loading branch information
emawind84 committed Jun 14, 2024
1 parent f0201a5 commit 2e964a2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/rendering/gl/stereo3d/gl_openvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2201,6 +2201,8 @@ namespace s3d
QzDoom_setUseScreenLayer(true);
}

static TrackedDevicePose_t poses[k_unMaxTrackedDeviceCount];

if (gamestate != GS_TITLELEVEL) {
// TODO: Draw a more interesting background behind the 2D screen
const int eyeCount = mEyeCount;
Expand All @@ -2216,14 +2218,13 @@ namespace s3d
GLRenderer->mBuffers->NextEye(eyeCount);
}
GLRenderer->mBuffers->BlitToEyeTexture(GLRenderer->mBuffers->CurrentEye(), false);

vrCompositor->WaitGetPoses(
poses, k_unMaxTrackedDeviceCount, // current pose
nullptr, 0 // future pose?
);
}

static TrackedDevicePose_t poses[k_unMaxTrackedDeviceCount];
vrCompositor->WaitGetPoses(
poses, k_unMaxTrackedDeviceCount, // current pose
nullptr, 0 // future pose?
);

TrackedDevicePose_t& hmdPose0 = poses[k_unTrackedDeviceIndex_Hmd];

if (hmdPose0.bPoseIsValid) {
Expand Down

0 comments on commit 2e964a2

Please sign in to comment.