New issue
Advanced search Search tips

Issue 704364 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug
Proj-XR



Sign in to add a comment

WebVR: Image quality and performance regression in M58 beta

Project Member Reported by klausw@chromium.org, Mar 23 2017

Issue description

Going from stable 56.0.2924.87 to beta 58.0.3029.34 makes image quality noticeably worse, it looks a lot more chunky than expected. See attachments.

Performance also seems noticeably worse, note that this is using the updated frame counter as per https://github.com/toji/webvr.info/pull/49 assuming the repeated reloading refreshed it properly.

I've also included the "3029-highp" screenshot for which I patched in r456012 from  issue 700031  "CopyTexImage2D artifacts on >=1024 pixel size". That doesn't seem to make any difference, so I assume it's not the issue we're seeing here.

According to Chrome Inspector, the canvas size is the same, and this matches the expected recommended renderWidth/Height:

<canvas id="webgl-canvas" width="2560" height="1440"></canvas>
 
screen-2924-stable.png
2.2 MB View Download
screen-3029-beta.png
2.2 MB View Download
screen-3029-highp.png
2.2 MB View Download

Comment 1 by klausw@chromium.org, Mar 23 2017

I suspect this was the VrShellGl refactor r438256 aka http://crrev.com/2562733002. That commented out the resizing code which reduced the GVR renderbuffer size to the screen size, in WebVR mode, so it's now doing internal rendering at 3606x2268 instead of 2560x1440 on a Pixel XL, including the expensive pixel readback:

+  // TODO(klausw): Fix this. Resizing buffers here leads to webVR mode showing
+  // nothing but a black screen.
+//  if (vr_shell_->GetUiInterface()->GetMode() == UiInterface::Mode::WEB_VR) {
+//    // If needed, resize the primary buffer for use with WebVR.
+//    if (render_size_primary_ != render_size_primary_webvr_) {
+//      if (!render_size_primary_webvr_.width) {
+//        VLOG(2) << "WebVR rendering size not known yet, dropping frame";
+//        return;
+//      }
+//      render_size_primary_ = render_size_primary_webvr_;
+//      swap_chain_->ResizeBuffer(kFramePrimaryBuffer, render_size_primary_);
+//    }
+//  } else {
+//    if (render_size_primary_ != render_size_primary_vrshell_) {
+//      render_size_primary_ = render_size_primary_vrshell_;
+//      swap_chain_->ResizeBuffer(kFramePrimaryBuffer, render_size_primary_);
+//    }
+//  }

IIRC we decided to live with the wrong resolution at the time since we thought it would only be temporary, but the delays in getting compositor bypass working means we should try to fix this in M58 if possible.

Comment 2 by klausw@chromium.org, Mar 23 2017

Proposed fix in https://codereview.chromium.org/2775513002 , that change is relative to branch-heads/3029.

See attached screenshot, I think visual quality and performance are closer to expected now. Framerate is still a bit less steady, though this wasn't entirely consistent while running.
screen-3029-rev2775513002.png
2.1 MB View Download

Comment 3 by klausw@chromium.org, Mar 23 2017

Cc: mthiesse@chromium.org
Owner: klausw@chromium.org
Status: Started (was: Untriaged)

Comment 4 Deleted

Comment 5 by klausw@chromium.org, Mar 23 2017

Labels: Merge-Request-58
I'd like to request a merge of this fix into M58 / branch-heads/3029, but that's a bit complicated since it's not a simple cherry pick.

http://crrev.com/2775513002 is the proposed fix relative to branch-heads/3029 . This reverts a small part of the VrShellGl refactor r438256 aka http://crrev.com/2562733002 which had introduced the issue. Reverting the entire refactor would be  messy because it moved files, and multiple further changes were applied on top of the refactor since then.

In addition, my compositor bypass patch from r456272 aka http://crrev.com/2729523002 contains essentially the same proposed resizing code. That patch was rejected for merging into M58 due to being too large, but we've been testing the resizing code as part of M59 Canary where it has been working well.

(See https://cs.chromium.org/chromium/src/chrome/browser/android/vr_shell/vr_shell_gl.cc?l=757&rcl=257f9fb084fd9c3a660ef8d7fd2948cb3d3fd1fb for the current ToT version of this resizing code.)

We've been manually testing a build of branch-heads/3029 + http://crrev.com/2775513002, it fixes the issue (see comment 2 in this bug for example) and we haven't found regressions for the WebVR sites we tried.

I've set "Merge-Request-58" on this bug. If I understand it right this should trigger manual review since there's no CL included in this bug yet. Please let me know if I should be doing something different instead, and please don't hesitate to ask for further clarifications or explanations.

Comment 6 by klausw@chromium.org, Mar 23 2017

Components: Blink>WebVR
Labels: -Merge-Request-58 Merge-Approved-58
Merge approved for M58 branch 3029.
Project Member

Comment 8 by bugdroid1@chromium.org, Mar 24 2017

Labels: -merge-approved-58 merge-merged-3029
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/59cacfe504a022686f7238bff37121f693ad4cc3

commit 59cacfe504a022686f7238bff37121f693ad4cc3
Author: klausw <klausw@chromium.org>
Date: Fri Mar 24 05:02:03 2017

WebVR: match GVR renderbuffer resolution to canvas resolution

This is a partial revert of the VrShellGl refactor r438256 aka
http://crrev.com/2562733002 which had commented out this resolution
change.

Matching resolution improves visual quality and performance, the
internal rendering was at 3606x2268 instead of the intended 2560x1440
on a Pixel XL.

(This is a manual bugfix, basically a partial revert of 0be372f1b41a7e7ad897743abd6b265da979a82e or equivalently a partial cherry pick of 362c621af1b1c9ad8da5bac607a082108b4aa213, as approved by amineer@. Please see bug for details.)

BUG= 704364 
NOTRY=true
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2775513002
Cr-Commit-Position: refs/branch-heads/3029@{#402}
Cr-Branched-From: 939b32ee5ba05c396eef3fd992822fcca9a2e262-refs/heads/master@{#454471}

[modify] https://crrev.com/59cacfe504a022686f7238bff37121f693ad4cc3/chrome/browser/android/vr_shell/vr_shell_gl.cc
[modify] https://crrev.com/59cacfe504a022686f7238bff37121f693ad4cc3/chrome/browser/android/vr_shell/vr_shell_gl.h

Comment 9 by klausw@chromium.org, Mar 24 2017

Status: Fixed (was: Started)
Closing, this fix should become available in an upcoming M58 Beta build. Unfortunately it's too late for M57.
Components: Blink>WebXR

Sign in to add a comment