New issue
Advanced search Search tips

Issue 812071 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: 2018-02-22
OS: Mac
Pri: 1
Type: Bug-Regression

Blocked on:
issue 730303

Blocking:
issue 814769
issue 815154



Sign in to add a comment

Slow WebGL performance when using alpha: false

Project Member Reported by ricardocabello@google.com, Feb 14 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36

Steps to reproduce the problem:
1. Compare these two pages:
https://jsfiddle.net/fz6s3sez/10/embedded/result/ (alpha: false)
https://jsfiddle.net/fz6s3sez/11/embedded/result/ (alpha: true)

What is the expected behavior?
Performance shouldn't be affected, if anything it should be faster when disabling alpha.

What went wrong?
Feels like the whole javascript code gets deoptimised.

Did this work before? Yes 

Does this work in other browsers? Yes

Chrome version: 64.0.3282.140  Channel: stable
OS Version: OS X 10.12.6
Flash Version:
 
Screen Shot 2018-02-13 at 5.56.30 PM.png
456 KB View Download
Screen Shot 2018-02-13 at 5.56.16 PM.png
571 KB View Download
gpu.htm
151 KB View Download

Comment 1 by kbr@chromium.org, Feb 14 2018

Cc: zmo@chromium.org oetu...@nvidia.com
GPU in affected hardware is Intel(R) Iris(TM) Graphics 550. Can't reproduce on my NVIDIA based MBP.

Mo, possible this is actually the loop-to-initialize-arrays issue you fixed earlier today?

Comment 2 by zmo@chromium.org, Feb 14 2018

Status: Available (was: Unconfirmed)
Yes, this is Intel specific. I can reproduce on my retina (AMD/Intel) by --force_integrated_gpu. kbr@, I suspect you can also reproduce on your NVidia/Intel with the same switch.

No, it's not related with the loop-to-init-variables. By passing --dont_use_loops_to_initialize_variables and also tested on Canary, the perf issue is still visible.

Comment 3 by kbr@chromium.org, Feb 14 2018

Labels: allpublic
Doesn't need to be restricted view.

Comment 4 by kbr@chromium.org, Feb 14 2018

Cc: kainino@chromium.org jdarpinian@chromium.org
Labels: Needs-Bisect
James or Kai: could one of you please help by bisecting this?

Owner: kainino@chromium.org
Status: Assigned (was: Available)
I'll take this since I have a mac dev env.
Blockedon: 730303
Cc: -oetu...@nvidia.com
Labels: GPU-Intel
Owner: yang...@intel.com
This bisects to
https://chromium.googlesource.com/chromium/src/+/cdc786f5d2a2b538f4914ba0afbaee15634206b9
> Use 8x MSAA rather than 4x MSAA when available.

We may need to use the max_msaa_sample_count_4 workaround on Mac/Intel.

Over to the Intel folks to look into this.
N.b., this bug only affects alpha:false contexts for unknown reasons. So max_msaa_sample_count_4 may not be the right solution.

See also the msaa_is_slow workaround,  issue 527565 .
Labels: M-63

Comment 9 by yang...@intel.com, Feb 15 2018

Cc: jie.a.c...@intel.com
Just a guess, this might be related to crrev.com/c/899957. 
BTW, the change to 8x MSAA by default actually caused a lot of performance issues on Intel platforms. We're collecting data on various OSes to see if we can handle AA better in Chromium. 
Labels: -Needs-Bisect Triaged-ET Needs-Triage-M64
ricardocabello@ Thanks for the issue.

Tested this issue on Mac OS 10.12.6 on the reported version 64.0.3282.140 and the latest Canary 66.0.3347.0 and somehow was unable to reproduce this issue.

On comparing the above two given fiddles with alpha as true and false, can see see no issues in performance.
Attached is the chrome://gpu details.

As per comment #6, removing the Needs-Bisect label as the bisect is already provided.

Thanks..

gpu.htm
61.3 KB View Download
Thanks for testing Susan. I can see you're using a Intel(R) HD Graphics 6000 on a MacBook Air. The issue seems to be with Intel(R) Iris(TM) Graphics 550 on retina devices.
Actually, I did repro on a device that should be identical to Susan's except for the OS - MacBook Air early 2015, non-retina, Intel HD 6000, macOS 10.13.3.

Comment 13 by kbr@chromium.org, Feb 15 2018

Cc: yang...@intel.com
Owner: kbr@chromium.org
Kai, thanks for bisecting and sorry all for the difficulty.

I'm not sure why Chrome's RGB emulation on top of RGBA textures/IOSurfaces would be more prone to slowdowns in this area. We do operations like clearing the alpha channel and setting write masks, so maybe this incurs a read/modify/write to main memory rather than being able to simply keep multisample data on-chip.

I'll look into blacklisting the 8x MSAA path on Intel GPUs in response. The quality difference from 4x to 8x MSAA is not worth this hit.

Owner: kainino@chromium.org
Status: Started (was: Assigned)
kbr investigated and it doesn't seem that there should be any RGB-on-RGBA emulation code happening if we run Chrome without IOSurface. Since disabling IOSurface didn't fix the regression, it doesn't seem to be related to that emulation.

I'll land the max_msaa_sample_count_4 workaround entry.
Project Member

Comment 15 by bugdroid1@chromium.org, Feb 21 2018

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

commit 28cc4cd37aa9c4e27d882c249092098197920133
Author: Kai Ninomiya <kainino@chromium.org>
Date: Wed Feb 21 02:03:58 2018

Use 4x MSAA on Mac/Intel to avoid perf regression

On Mac/Intel, the default 8x MSAA causes huge performance regressions
specifically in WebGL contexts with {alpha:false,antialias:true}.

Add a workaround to fall back to 4x MSAA on Mac/Intel devices.

Adds pixel test suppressions that will be removed, after rebaseline,
in https://crrev.com/c/924310

Bug:  812071 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ifd2283f6b232371cb63d67a8641236073cb0b4da
Reviewed-on: https://chromium-review.googlesource.com/923103
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537993}
[modify] https://crrev.com/28cc4cd37aa9c4e27d882c249092098197920133/content/test/gpu/gpu_tests/pixel_expectations.py
[modify] https://crrev.com/28cc4cd37aa9c4e27d882c249092098197920133/content/test/gpu/gpu_tests/pixel_test_pages.py
[modify] https://crrev.com/28cc4cd37aa9c4e27d882c249092098197920133/gpu/config/gpu_driver_bug_list.json

Labels: -Pri-2 Merge-Request-65 Pri-1
Requesting merge of #15 to M65.
The change is a small and safe - an addition to the workaround list. It fixes a major performance regression seen with most WebGL content on Chrome 63/64.
Project Member

Comment 17 by sheriffbot@chromium.org, Feb 21 2018

Labels: -Merge-Request-65 Merge-Review-65 Hotlist-Merge-Review
This bug requires manual review: We are only 12 days from stable.
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), bhthompson@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
NextAction: 2018-02-22
Pls test/verify cl listed at #15 on next canary and update canary result here before M65 merge approval. Thank you.
Labels: Needs-Feedback
Tried to verify this issue on the latest Canary 66.0.3352.0 on Mac OS 10.13.3 by following the steps mentioned in the original comment.
Compared the performance of the above fiddles with alpha:false and alpha:true and attached are the screen shots of the results.

kainino@ Request you to please check the attached screenshots and verify if the fix is working as intended on the latest Canary build?

Thanks..
812071-alpha-false.png
561 KB View Download
812071-alpha-true.png
571 KB View Download
The NextAction date has arrived: 2018-02-22
Labels: -Needs-Feedback
Verified fixed in Canary.
Labels: -Merge-Review-65 Merge-Approved-65
Approving merge to M65 branch 3325 based on comments #16 and #21. Please merge ASAP. Thank you.
Project Member

Comment 23 by bugdroid1@chromium.org, Feb 22 2018

Labels: -merge-approved-65 merge-merged-3325
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5aa3cbd79236759e67b8ffcff8b4f51f96efcc39

commit 5aa3cbd79236759e67b8ffcff8b4f51f96efcc39
Author: Kai Ninomiya <kainino@chromium.org>
Date: Thu Feb 22 18:44:38 2018

Use 4x MSAA on Mac/Intel to avoid perf regression

On Mac/Intel, the default 8x MSAA causes huge performance regressions
specifically in WebGL contexts with {alpha:false,antialias:true}.

Add a workaround to fall back to 4x MSAA on Mac/Intel devices.

Adds pixel test suppressions that will be removed, after rebaseline,
in https://crrev.com/c/924310

TBR=kainino@chromium.org

Bug:  812071 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ifd2283f6b232371cb63d67a8641236073cb0b4da
Reviewed-on: https://chromium-review.googlesource.com/923103
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#537993}(cherry picked from commit 28cc4cd37aa9c4e27d882c249092098197920133)
Reviewed-on: https://chromium-review.googlesource.com/932007
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/branch-heads/3325@{#552}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
[modify] https://crrev.com/5aa3cbd79236759e67b8ffcff8b4f51f96efcc39/content/test/gpu/gpu_tests/pixel_test_pages.py
[modify] https://crrev.com/5aa3cbd79236759e67b8ffcff8b4f51f96efcc39/gpu/config/gpu_driver_bug_list.json

Status: Fixed (was: Started)
Thanks!
Project Member

Comment 26 by bugdroid1@chromium.org, Feb 23 2018

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

commit 77ccad70106609e52630b5936eb3a7f488a3e5c6
Author: Kai Ninomiya <kainino@chromium.org>
Date: Fri Feb 23 03:59:33 2018

Remove pixel test suppressions after rebaseline

Follow-up to https://crrev.com/c/923103

TBR=zmo@chromium.org

Bug:  812071 
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ib9cf961ef492ce3aea6a2cd415716d4df7236391
Reviewed-on: https://chromium-review.googlesource.com/924310
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538693}
[modify] https://crrev.com/77ccad70106609e52630b5936eb3a7f488a3e5c6/content/test/gpu/gpu_tests/pixel_expectations.py

Blocking: 815154
Blocking: 814769

Sign in to add a comment