Skip to content

Commit

Permalink
Cherry-pick 31c43b7. rdar://125620290
Browse files Browse the repository at this point in the history
    [WebXR] Depth values are not correct
    https://bugs.webkit.org/show_bug.cgi?id=272119
    <radar://125620290>

    Reviewed by Dan Glastonbury.

    Compositor expects reverse-Z but WebXR writes forward Z values, so
    just zero them for now so the reprojection doesn't cause jittering.

    * Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp:
    (WebCore::WebXROpaqueFramebuffer::blitSharedToLayered):

    Canonical link: https://commits.webkit.org/277040@main

Canonical link: https://commits.webkit.org/276863.10@safari-7619.1.8-branch
  • Loading branch information
mwyrzykowski authored and Dan Robson committed Apr 4, 2024
1 parent 03ed5be commit 654a8ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ void WebXROpaqueFramebuffer::blitSharedToLayered(GraphicsContextGL& gl)

gl.blitFramebuffer(horizontalOffset, verticalOffset, horizontalOffset + adjustedWidth, verticalOffset + adjustedHeight, 0, 0, adjustedWidth, adjustedHeight, buffers, GL::NEAREST);

// FIXME: https://bugs.webkit.org/show_bug.cgi?id=272104 - [WebXR] Compositor expects reverse-Z values
gl.clearDepth(FLT_MIN);
gl.clear(GL::DEPTH_BUFFER_BIT | GL::STENCIL_BUFFER_BIT);

phyiscalSize = m_rightPhysicalSize;
viewport = m_rightViewport;
}
Expand Down

0 comments on commit 654a8ac

Please sign in to comment.