Skip to content

Commit

Permalink
Work around a bug in Oculus OpenXR runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Detegr committed Jan 7, 2024
1 parent abcb0cf commit 9df6a02
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions OpenXR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ void OpenXR::SubmitFramesToHMD(IDirect3DDevice9* dev)
.type = XR_TYPE_FRAME_END_INFO,
.displayTime = frameState.predictedDisplayTime,
.environmentBlendMode = XR_ENVIRONMENT_BLEND_MODE_OPAQUE,
.layerCount = frameState.shouldRender ? static_cast<uint32_t>(1) : static_cast<uint32_t>(0),
.layers = frameState.shouldRender ? layers : nullptr,
.layerCount = 1,
.layers = layers,
};

if (auto res = xrEndFrame(session, &frameEndInfo); res != XR_SUCCESS) {
Expand Down Expand Up @@ -528,7 +528,8 @@ bool OpenXR::UpdateVRPoses(Quaternion* carQuat, Config::HorizonLock lockSetting)
}

if (frameState.shouldRender == XR_FALSE) {
Dbg("Skipping layer rendering");
// Oculus runtime has a bug where shouldRender is always false... o_o
// So we do nothing about it.
}

if (resetViewRequested) {
Expand Down

0 comments on commit 9df6a02

Please sign in to comment.