Commit b1471eca authored by Klaus Weidner's avatar Klaus Weidner Committed by Commit Bot

Avoid DCHECK failure on WebXR immersive session transition

The first frame of an immersive session may not yet have frame data
including the expected frame_id and output buffer mailbox holder,
don't treat that as an error. See also https://crbug.com/855722

BUG=868028

Cq-Include-Trybots: luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Icecd3ea8035ea783a625b11082e736d9609a15f8
Reviewed-on: https://chromium-review.googlesource.com/1153829Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578851}
parent 2721137b
...@@ -383,10 +383,15 @@ void XRFrameProvider::ProcessScheduledFrame( ...@@ -383,10 +383,15 @@ void XRFrameProvider::ProcessScheduledFrame(
// If there's an immersive session active only process its frame. // If there's an immersive session active only process its frame.
std::unique_ptr<TransformationMatrix> pose_matrix = std::unique_ptr<TransformationMatrix> pose_matrix =
getPoseMatrix(frame_pose_); getPoseMatrix(frame_pose_);
#if DCHECK_IS_ON()
// Sanity check: if drawing into a shared buffer, the optional mailbox // Sanity check: if drawing into a shared buffer, the optional mailbox
// holder must be present. // holder must be present. Exception is the first immersive frame after a
DCHECK(!frame_transport_->DrawingIntoSharedBuffer() || // transition where the frame ID wasn't set yet. In that case, drawing can
buffer_mailbox_holder_); // proceed, but the result will be discarded in SubmitWebGLLayer().
if (frame_transport_->DrawingIntoSharedBuffer() && frame_id_ >= 0) {
DCHECK(buffer_mailbox_holder_);
}
#endif
immersive_session_->OnFrame(high_res_now_ms, std::move(pose_matrix), immersive_session_->OnFrame(high_res_now_ms, std::move(pose_matrix),
buffer_mailbox_holder_, base::nullopt, buffer_mailbox_holder_, base::nullopt,
base::nullopt); base::nullopt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment