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

Issue 648816 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocking:
issue 648644



Sign in to add a comment

ANGLE generates GL_POINTS geometry shader even if it isn't used

Project Member Reported by jbau...@chromium.org, Sep 21 2016

Issue description

I'm not sure why, but ANGLE always generates the GL_POINTS geometry shader when linking the program. In my testing this takes over 1/3rd of the linking time (apparently compiling geometry shaders is slow) and we don't seem to use the shader anyway with shaders generated by skia.

Maybe there's some way to avoid compiling it unless it's absolutely necessary. This would help the browser's cold startup time when the binary program cache has been cleared.

 
Owner: jmad...@chromium.org
Status: Assigned (was: Available)
Yes we probably should defer this compilation until we need it. I'll address this. BTW, this kind of issue might make more sense on http://anglebug.com/new for the future.
One note is deferred compiles might interact with the shader cache. Point sprite shaders might not get cached if the shader binary is pulled immediately after linking, and end up being recompiled every use. This could be fixed when we move to the pass-through command buffer if we move the shader caching entirely into ANGLE.
Actually John, I mistakenly thought we generate the geometry shader always. It looks as though we only generate if the GS if the shader uses gl_PointSize. 

Can you confirm you can't remove gl_PointSize when you're drawing triangles/lines?

It could be a case of an ubershader or something like that, that you use for points and tris, but if it's not, you should be able to avoid the compile by removing any use of gl_PointSize.

Comment 4 by bsalo...@google.com, Sep 21 2016

Skia inserts gl_PointSize even when we're not drawing points in order to not have to recreate nearly identical shaders specifically for points. We could change that behavior. Points are rare.
Well, that would allow us to keep the caching behaviour for point sprite shaders the same, so I'd vote for Skia to skip gl_PointSize for non-point shaders if possible.
Another possibility is to defer the ANGLE compile, and give ANGLE a mechanism to tell Chromium that a shader needs to be re-cached. I'd worry that this might be finicky to get right, but it should be possible.
Owner: bsalomon@chromium.org
Project Member

Comment 9 by bugdroid1@chromium.org, Sep 21 2016

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

commit 4a35aa63801770012471d58b6d400bfd635c83f1
Author: skia-deps-roller <skia-deps-roller@chromium.org>
Date: Wed Sep 21 22:31:03 2016

Roll src/third_party/skia/ e4a9bd79c..0e4a466a6 (12 commits).

https://chromium.googlesource.com/skia.git/+log/e4a9bd79c676..0e4a466a613f

$ git log e4a9bd79c..0e4a466a6 --date=short --no-merges --format='%ad %ae %s'
2016-09-21 bsalomon Use sk_careful_memcpy when writing optional conic weights for GrShape path data key.
2016-09-21 bsalomon Add optional sw generated path coverage mask caching
2016-09-21 reed allow clip calls w/o op param, remove unnecessary kReplace ops
2016-09-21 robertphillips Remove unused SkImage_Base and SkImage_Gpu onNewSurface methods GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2353403002
2016-09-21 bsalomon Conditionally insert gl_PointSize into shaders.
2016-09-21 jvanverth Always use transfer_dst for buffers.
2016-09-21 mtklein Build tools on NoGPU bots.
2016-09-21 brianosman Add a transient image filter cache to SkImage::makeWithFilter & PDF
2016-09-21 mtklein GN: is_skia_standalone
2016-09-21 caryclark fix skia pathops fuzzers
2016-09-21 bsalomon Make GrShape compute keys for short paths from path data instead of using the gen id. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2357643002
2016-09-21 bsalomon Stop closing filled paths in GrShape

BUG= 648816 

CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
TBR=borenet@google.com

Review-Url: https://codereview.chromium.org/2358963002
Cr-Commit-Position: refs/heads/master@{#420183}

[modify] https://crrev.com/4a35aa63801770012471d58b6d400bfd635c83f1/DEPS

Blocking: 648644
Project Member

Comment 11 by bugdroid1@chromium.org, Sep 21 2016

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

commit 4a35aa63801770012471d58b6d400bfd635c83f1
Author: skia-deps-roller <skia-deps-roller@chromium.org>
Date: Wed Sep 21 22:31:03 2016

Roll src/third_party/skia/ e4a9bd79c..0e4a466a6 (12 commits).

https://chromium.googlesource.com/skia.git/+log/e4a9bd79c676..0e4a466a613f

$ git log e4a9bd79c..0e4a466a6 --date=short --no-merges --format='%ad %ae %s'
2016-09-21 bsalomon Use sk_careful_memcpy when writing optional conic weights for GrShape path data key.
2016-09-21 bsalomon Add optional sw generated path coverage mask caching
2016-09-21 reed allow clip calls w/o op param, remove unnecessary kReplace ops
2016-09-21 robertphillips Remove unused SkImage_Base and SkImage_Gpu onNewSurface methods GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2353403002
2016-09-21 bsalomon Conditionally insert gl_PointSize into shaders.
2016-09-21 jvanverth Always use transfer_dst for buffers.
2016-09-21 mtklein Build tools on NoGPU bots.
2016-09-21 brianosman Add a transient image filter cache to SkImage::makeWithFilter & PDF
2016-09-21 mtklein GN: is_skia_standalone
2016-09-21 caryclark fix skia pathops fuzzers
2016-09-21 bsalomon Make GrShape compute keys for short paths from path data instead of using the gen id. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2357643002
2016-09-21 bsalomon Stop closing filled paths in GrShape

BUG= 648816 

CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
TBR=borenet@google.com

Review-Url: https://codereview.chromium.org/2358963002
Cr-Commit-Position: refs/heads/master@{#420183}

[modify] https://crrev.com/4a35aa63801770012471d58b6d400bfd635c83f1/DEPS

Status: Fixed (was: Assigned)
Thanks Brian!

Sign in to add a comment