Skip to content

Commit

Permalink
Add quirk to complete discarded frames.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbucchia committed Jul 1, 2023
1 parent 39a7a7e commit ee35168
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pimax-openxr/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,8 @@ namespace pimax_openxr {
layer.Header.Flags |= pvrLayerFlag_HeadLocked;
}
layer.Quad.QuadSize.x = 0.5f;
layer.Quad.QuadSize.y = layer.Quad.QuadSize.x * ((float)m_overlayExtent.height / m_overlayExtent.width);
layer.Quad.QuadSize.y =
layer.Quad.QuadSize.x * ((float)m_overlayExtent.height / m_overlayExtent.width);
}
}

Expand Down Expand Up @@ -1030,7 +1031,7 @@ namespace pimax_openxr {
TraceLoggingWriteStop(
beginFrame, "PVR_BeginFrame", TLArg(xr::ToString(result).c_str(), "Result"));
}
{
if (m_completeDiscardedFramesQuirk) {
pvrLayer_Union dummyLayer{};
dummyLayer.Header.Type = pvrLayerType_Disabled;
pvrLayerHeader* layers[1] = {(pvrLayerHeader*)&dummyLayer};
Expand Down
2 changes: 2 additions & 0 deletions pimax-openxr/instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ namespace pimax_openxr {
// Note: this is not compatible with async_submission=1!
m_useApplicationDeviceForSubmission = getSetting("quirk_use_application_device_for_submission").value_or(false);

m_completeDiscardedFramesQuirk = getSetting("quirk_complete_discarded_frames").value_or(false);

// Initialize PVR.

// Detour hack: we always ensure compatibility with Windows 10 in order to make pvr_waitToBeginFrame()
Expand Down
1 change: 1 addition & 0 deletions pimax-openxr/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ namespace pimax_openxr {
std::string m_applicationName;
bool m_needWorldLockedQuadLayerQuirk{false};
bool m_disableFramePipeliningQuirk{false};
bool m_completeDiscardedFramesQuirk{false};
bool m_alwaysUseFrameIdZero{false};
bool m_useApplicationDeviceForSubmission{true};
EyeTracking m_eyeTrackingType{EyeTracking::None};
Expand Down

0 comments on commit ee35168

Please sign in to comment.