Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a GrContextOptions::PersistentCache to Skia #14028

Closed
chinmaygarde opened this issue Jan 10, 2018 · 11 comments
Closed

Provide a GrContextOptions::PersistentCache to Skia #14028

chinmaygarde opened this issue Jan 10, 2018 · 11 comments
Assignees
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) engine flutter/engine repository. See also e: labels.

Comments

@chinmaygarde
Copy link
Member

Implement GrContextOptions::PersistentCache and provide it to Skia GrContextOptions.fPersistentCache. This allows Skia to cache shaders compilations to persistent storage. Even if platforms cache shader bytecode, Skia still has to do some non-trivial amount of work to generate the shader source in the first place. Using the persistent cache allows Skia to avoid repeating this work.

@chinmaygarde chinmaygarde self-assigned this May 2, 2018
@xster xster added engine flutter/engine repository. See also e: labels. c: performance Relates to speed or footprint issues (see "perf:" labels) labels May 3, 2018
@xster xster added this to the bucket4 milestone May 4, 2018
@gspencergoog gspencergoog modified the milestones: bucket4, Overdue May 23, 2018
@Hixie Hixie modified the milestones: Overdue, Goals May 24, 2018
@liyuqian
Copy link
Contributor

liyuqian commented Aug 2, 2018

@chinmaygarde : are you still actively working on this? One developer is having this issue and posted a very simple reproduction: #813 (comment)

@Hixie
Copy link
Contributor

Hixie commented Aug 28, 2018

This won't help first-launch performance, though, right?

@liyuqian
Copy link
Contributor

Yes, it would only help if the app is reopened. We have to compile the shaders at some time.

@Hixie
Copy link
Contributor

Hixie commented Aug 28, 2018

Can we compile them at the same time as we compile the Dart code?

@chinmaygarde
Copy link
Member Author

We don't know what shaders to compile because the Dart code will generate the picture for the rasterizer to render. The shaders to create depend on the complexity of the picture.

@Hixie
Copy link
Contributor

Hixie commented Aug 28, 2018

Can we use some slower but more general shaders that are precompiled ahead of time to render the first few frames, while we compile the more specialised shaders we actually need, then swap to the faster ones once we have them?

@liyuqian
Copy link
Contributor

liyuqian commented Aug 28, 2018

There are probably no such general shaders (or uber shaders as I heard from other Skia engineers). However, we can use software backend to render it if no shaders are compiled.

On the other hand, maybe we can improve flutter tools to capture some shaders? The developers would have to run their apps before shipping and flutter tools may be able to find and package those shaders.

@mklim
Copy link
Contributor

mklim commented Nov 15, 2018

Reopened by flutter/engine#6835

@mklim mklim reopened this Nov 15, 2018
@liyuqian
Copy link
Contributor

liyuqian commented Dec 14, 2018

I'll mark this as a duplicate of #813 so we'll put link all our future work to that single issue.

@liyuqian
Copy link
Contributor

Duplicate of #813

@liyuqian liyuqian marked this as a duplicate of #813 Dec 14, 2018
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) engine flutter/engine repository. See also e: labels.
Projects
None yet
Development

No branches or pull requests

6 participants