Repository navigation
Consider using a static set of less specialized shaders that can be compiled on startup #77412
Description
Activity
- addedengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.c: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)dependency: skiaSkia team may need to help usSkia team may need to help usperf: speedPerformance issues related to (mostly rendering) speedPerformance issues related to (mostly rendering) speedP1High-priority issues at the top of the work listHigh-priority issues at the top of the work list
on Mar 5, 2021 Any updates?
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.
Reacted by Davide Dessì, Julian Bissekkou, Henry Riehl, mono — Masayuki Ono, Nico:Roy, lin72h and Pablo PadillaReacted by bugsbugsbux, Dmytro Babiienko, Rustem Kakimov, Guillaume Cendre, Davide Dessì, Luis, El, bouraine, epaterlini and Nico:Roy- addede: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requests
on Feb 18, 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
Reacted by fabiancrx, Daniel Cachapa, El, Raul Mateo Beneyto, Henry Riehl, Valentin Hăloiu, Julian Bissekkou, Nico:Roy, Peter Taoussanis, Dominik Roszkowski and 21 moreReacted by Mario PepeReacted by Mario PepeReacted by Erlend, bugsbugsbux, Julian Bissekkou, Matej Knopp, Caden Kriese, Nico:Roy, Bui Dai Duong, Jarle Stabell, Gil Sinclair-Julio, Hari07 and 8 moreAfter 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.
Reacted by Luca Steeb, mono — Masayuki Ono, fabiancrx, Erlend, Curt Weber, Liber Da Silva, bugsbugsbux, Furkan Sarıhan and SurajThis 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 -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Jun 1, 2023
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields✅ Done
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.