Skip to content

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

Closed
@Hixie

Description

@Hixie
Contributor

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.

Activity

added
engineflutter/engine repository. See also e: labels.
c: performanceRelates to speed or footprint issues (see "perf:" labels)
perf: speedPerformance issues related to (mostly rendering) speed
P1High-priority issues at the top of the work list
on Mar 5, 2021
armandsLa

armandsLa commented on Jul 10, 2021

@armandsLa

Any updates?

Hixie

Hixie commented on Jul 10, 2021

@Hixie
ContributorAuthor

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.

added
e: impellerImpeller rendering backend issues and features requests
on Feb 18, 2022
Hixie

Hixie commented on May 2, 2022

@Hixie
ContributorAuthor

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

7 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)dependency: skiaSkia team may need to help use: impellerImpeller rendering backend issues and features requestsengineflutter/engine repository. See also e: labels.perf: speedPerformance issues related to (mostly rendering) speed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @chinmaygarde@Hixie@zanderso@armandsLa@darshankawar

        Issue actions

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