[go: nahoru, domu]

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

Consider using a static set of less specialized shaders that can be compiled on startup #77412

Closed
Hixie opened this issue Mar 5, 2021 · 5 comments
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) dependency: skia Skia team may need to help us e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list perf: speed Performance issues related to (mostly rendering) speed

Comments

@Hixie
Copy link
Contributor
Hixie commented Mar 5, 2021

Since we currently pay a price (jank) each time a new shader is used, and since some animations end up using a lot of new shaders, one option would be to use less specialized shaders.

If we had a static set of shaders, we could asynchronously compile them on program startup, so that by the time the application runs an animation we can use this static set and not stutter while we prepare a new one.

Medium term we could also determine what specialized shaders we would want to use in each scene, and compile them in the background so that the next time, if all the specialized shaders we would want to use are ready, we could just use them. That way we get the long-term sustained performance benefits of specialized shaders and the short-term smooth start performance benefits of a static shader set.

@Hixie Hixie added engine flutter/engine repository. See also e: labels. c: performance Relates to speed or footprint issues (see "perf:" labels) dependency: skia Skia team may need to help us perf: speed Performance issues related to (mostly rendering) speed P1 High-priority issues at the top of the work list labels Mar 5, 2021
@Hixie Hixie added this to Shader warmup in Early-onset jank Mar 5, 2021
@Hixie Hixie moved this from Shader warmup to Ongoing projects in Early-onset jank Mar 29, 2021
@armandsLa
Copy link

Any updates?

@Hixie
Copy link
Contributor Author
Hixie commented Jul 10, 2021

Work is ongoing (@chinmaygarde made a demo of a subset of this for Metal which looks promising), but this is a long-term research project so I wouldn't expect frequent updates.

@Hixie Hixie moved this from Ongoing projects to Shader jank in Early-onset jank Sep 10, 2021
@zanderso zanderso added the e: impeller Impeller rendering backend issues and features requests label Feb 18, 2022
@Hixie
Copy link
Contributor Author
Hixie commented May 2, 2022

For people who wish to follow along with this work, the library was recently merged into the engine tree (very much still as an experiment and nowhere near ready for production, please don't expect this to be available in stable for many many months yet): https://github.com/flutter/engine/tree/main/impeller

@chinmaygarde
Copy link
Member

After a preview period since January 2023, Impeller is now on-by-default on iOS in a stable branch. We are now primarily focused on rounding out support for the remaining platforms with Android up next.

Impeller uses a static shader set and all shaders are compiled and optimized on our build servers. Depending on the backend, the optimized shader representation is packaged as a blob in the engine and necessary pipeline state objects created at startup asynchronously. There is no runtime shader generation or compilation at all.

Closing this issue as completed.

@github-actions
Copy link
github-actions bot commented Jun 1, 2023

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 Jun 1, 2023
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) dependency: skia Skia team may need to help us e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list perf: speed Performance issues related to (mostly rendering) speed
Projects
Early-onset jank
Shader jank
Archived in project
Development

No branches or pull requests

5 participants