New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 831620 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug
Proj-XR
Proj-XR-VR

Blocking:
issue 837646



Sign in to add a comment

VR UI performance: Make the floor grid cheaper to draw

Project Member Reported by cjgrant@chromium.org, Apr 11 2018

Issue description

The current UI draws every floor pixel, using the shader to compute the appearance of lines.  While flexible, this is very expensive to draw.

Originally, we drew simple GL lines.  We moved away from this, possibly because the lack of MSAA made them look rough.  Now that we use MSAA, the original approach may again be fine.

Assuming that it's much cheaper to render, we should move back.
 

Comment 1 by tiborg@chromium.org, Apr 13 2018

Labels: -M-67 -Hotlist-VRB-MVP M-68 Hotlist-VRB-MVP-Next
Did some perf testing and drawing the grid with GL_LINES or not drawing the grid at all doesn't make a notable performance different. Removing MVP for now. Maybe we should close this bug entirely.

Comment 2 by tiborg@chromium.org, Apr 27 2018

Blocking: 837646
Owner: acondor@chromium.org
Status: Started (was: Assigned)
Status: Assigned (was: Started)
Project Member

Comment 5 by bugdroid1@chromium.org, May 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a390e0340ad7432fc2bbdcf863b04ac3bf290f57

commit a390e0340ad7432fc2bbdcf863b04ac3bf290f57
Author: Aldo Culquicondor <acondor@chromium.org>
Date: Fri May 18 21:18:44 2018

VR: Optimizing floor grid shader performance.

According to meassurements, the grid costs about 2.4ms to render. This
CL reduces the time to about 1.1ms. The approach was to simplify the
math and to use discard, as we don't really need a gradient anymore.
Branch and discard is a good option in this case (as opposed to using
step) because the discarded fragments are the majority.

Bug:  831620 
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_vr
Change-Id: Ieee547205e7a3f01ac028b39a31c4232e32e5c3d
Reviewed-on: https://chromium-review.googlesource.com/1065574
Reviewed-by: Christopher Grant <cjgrant@chromium.org>
Commit-Queue: Aldo Culquicondor <acondor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560041}
[modify] https://crrev.com/a390e0340ad7432fc2bbdcf863b04ac3bf290f57/chrome/browser/vr/elements/environment/grid.cc
[modify] https://crrev.com/a390e0340ad7432fc2bbdcf863b04ac3bf290f57/chrome/browser/vr/elements/environment/grid.h
[modify] https://crrev.com/a390e0340ad7432fc2bbdcf863b04ac3bf290f57/chrome/browser/vr/ui_scene_creator.cc

Status: Fixed (was: Assigned)
Did we measure the savings if we were to use lines?
I just did the testing. Only about 0.2ms are saved with GL_LINES (Tested on Pixel XL). In exchange, we obtain a harsh grid and the perspective is lost (which should affect width of the lines).
As a side note, both the shader grid and the lines grid don't produce artifacts when AA is disabled.
Just in case we want to revisit this later, a CL was posted: crrev.com/c/1070482
Cool, thanks for checking!

Sign in to add a comment