Closed Bug 1899427 Opened 4 months ago Closed 4 months ago

[wpt-sync] Sync PR 46520 - Refactor Xr Depth Data to be per view

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox128 fixed)

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 46520 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/46520
Details from upstream follow.

Alexander Cooper <alcooper@chromium.org> wrote:

Refactor Xr Depth Data to be per view

The WebXR Spec requires that a view be passed in to receive depth data.
The current implementation simply sends depth data alongside with the
rest of the frame data and process it independently in the blink
XrSession. This is fine because the current only platform that supports
depth sensing is ARCore, which only has one View. However, in order to
implement Depth Sensing for OpenXR (which has multiple views), this
needed to be changed to allow sending up data per-view. This required
refactoring the XrDepthManager to be owned by an XrViewData (since the
actual XRView objects are created per-frame and largely wrap this data).
Since XRViewData's can theoretically (though likely not usually done
in practice), be recreated mid session if e.g. the count/order of views
changes, this now requires storing the depth_config in XrSession to
allow for this re-creation. Rather than simply storing the depth config,
this change opts to store the entire device_config and thus remove a
few other unnecessary member variables.

As part of this update to update Depth as part of the XRViews, a few
other refactors were made, as well as some tangientially related
cleanups. A few of these arose because it seemed like it was necessary
to switch XrFrameData to be passed by value rather than const& to steal
the Views and subsequent DepthData off of it. While that turns out to
not have been necessary (because const& to a pointer doesn't prevent
stealing data from the underlying struct...), many of these changes
are left in as it improves both the overall readability and intent
behind the const& and later usage. These other changes are, in general:

  • UpdateViews now handles the deferred update logic that happened
    several lines later in views(). This is more consistent with what
    a reader would likely expect from the calls.
  • The UpdateViews refactor removes the need to keep the pending_views_
    variable. It is removed, and it's usages updated as appropriate.
  • XrDepthManager is no longer exposed to XrSession, so the DepthData and
    DepthFormat strings (that the page receives off of XrSession) now live
    in XrSession.
  • The Mojom XrDepthDataUpdated::time_delta member was unused outside of
    the device process, and thus is now removed from the interface.
  • XrFrameProvider manually updated some additional state after calling
    UpdatePresentationFrameState. This state was updated regardless of
    session type, and as such was moved inside of
    UpdatePresentationFrameState, to facilitate std::move'ing the
    FrameData to that method. The comments around UpdateFrameState were
    also outdated/indirect and updated/clarified.
    Note that the ordering of some of these additional updates is
    different after this CL.
  • XrFrameProvider stored a few variables whose storage seemed to
    now be unnecessary, these variables were removed and their usage
    was ported to closer to where they were needed.
  • Because XrFrameProvider no longer needed to split off the VRPosePtr,
    from the FrameData, it was removed as a separate argument to the
    UpdatePresentationFrameState.

Bug: 342213635
Change-Id: I2fd8f3d609e955c84aff2e21b147443aeb987c02
Reviewed-on: https://chromium-review.googlesource.com/5565198
WPT-Export-Revision: 5d2f29435f15c9a7a9adc193c4d04e59ebf71266

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1dccf7f930fb [wpt PR 46520] - Refactor Xr Depth Data to be per view, a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.