Skip to content

Configure Skia to operate in a mode that reduces shader variants. #84213

@chinmaygarde

Description

@chinmaygarde

Internal: b/193583954 b/177473804

Skia attempts to prepare (just in time) the most optimal shaders to render a specific scene. This may be in spite of the presence of an existing shader pipeline that could render the scene identically but less optimally in the steady state. The preparation of these pipeline variants may cause jank.

Skia now allows clients to opt into a mode that disregards opportunities to prepare additional shader variants. The flag needs to be set on the on screen context via its GrContextOptions::fReducedShaderVariations field. Setting the flag on the resource context is unnecessary.

The flag is new and its adoption within Skia is getting better with time. Flutter should opt into this flag ASAP and track it's effects across benchmarks. When enabled (and as Skia makes more use of this flag), Flutter can expect a degradation is steady state performance at the cost of jank. When benchmark regressions are detected, a decision on whether to accept these needs to be made on a case by case basis.

This effort is separate from the asynchronous compilation of shader pipelines and their variants.

cc @bsalomon, @jvanverth, @heathmill, @zanderso

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)customer: money (g3)dependency: skiaSkia team may need to help usengineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions