Skip to content

Add --shader-report and --fail-on-unused-shaders option to impeller_golden_tests - #193319

Merged
auto-submit[bot] merged 9 commits into
flutter:masterfrom
walley892:unittest_shaders
Oct 8, 2026
Merged

auto-submit[bot] merged 9 commits into
flutter:masterfrom
walley892:unittest_shaders

Conversation

@walley892

@walley892 walley892 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #193318

Adds a --shader-report option to impeller_golden_tests. When running with this option, the test suite will spit out a report on which shaders were prewarmed, but never used.

Adds a --fail-on-unused-shaders option to impeller_golden_tests. When running with this option, the goldens will fail if there are any shaders that are completely unused in the golden tests.

Everything is only run in debug builds inside of impeller_golden_tests, so no production impact. --fail-on-unused-shaders is not hooked up to CI yet.

Example output for --shader-report:

================================================================================
Impeller pipeline variant usage
================================================================================
  2948 tests run, 55 skipped, 0 failed, filter '*'

  Legend: SC = specialization constants, +flag = option enabled,
          "drawn as" = how the same pipeline was actually drawn.

--------------------------------------------------------------------------------
Metal
  276 variants: 137 warmed (0 drawn) | 0 created lazily, never drawn
  Draws covered by warmed variants: 0 of 620,223 (0.0%)

  WARMED BUT NEVER DRAWN (137) - candidates to stop warming
    Likely cause: 111 of 137 were drawn, but only with other options:
         111  depth Always -> GreaterEqual
          48  blend SrcOver -> Src
          45  format B10G10R10A10XR -> B8G8R8A8UNormInt
          26  prim Triangle -> TriangleStrip
          16  depth_stencil on -> off
          16  msaa 4x -> 1x
           4  prim TriangleStrip -> Triangle
           2  blend SrcOver -> Dst
      ... 3 other changes
    26 of 137 were never drawn with any options.

    msaa=1x blend=SrcOver depth=Always stencil=Ignore prim=TriangleStrip format=B8G8R8A8UNormInt
      Gaussian Pipeline SC=[1]                     drawn as: depth Always -> GreaterEqual (2,248 draws)
      TextureDownsample Pipeline                   drawn as: depth Always -> GreaterEqual (866 draws)
      TextureDownsampleBounded Pipeline            drawn as: depth Always -> GreaterEqual (18 draws)

    msaa=1x blend=SrcOver depth=Always stencil=Ignore prim=TriangleStrip format=B10G10R10A10XR
      Gaussian Pipeline SC=[1]                     drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (2,248 draws)
      TextureDownsample Pipeline                   drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (866 draws)
      TextureDownsampleBounded Pipeline            drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (18 draws)

    msaa=4x blend=SrcOver depth=Always stencil=Ignore prim=Triangle format=B8G8R8A8UNormInt +depth_stencil
      Circle Pipeline                              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (2,949 draws)
      Clip Pipeline                                drawn as: blend SrcOver -> Dst, depth Always -> GreaterEqual, stencil Ignore -> StencilIncrementAll, prim Triangle -> TriangleStrip (390 draws)
      ComplexRse Pipeline                          drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (8 draws)
      ConicalGradientSsboFill Pipeline SC=[0]      never drawn with any options
      ConicalGradientSsboFill Pipeline SC=[1]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (8 draws)
      ConicalGradientSsboFill Pipeline SC=[2]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (4 draws)
      ConicalGradientSsboFill Pipeline SC=[3]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (41 draws)
      FastGradient Pipeline                        drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, depth_write off -> on (8 draws)
      GlyphAtlas Pipeline SC=[1]                   drawn as: depth Always -> GreaterEqual (690 draws)
      LinearGradientSsboFill Pipeline              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (86 draws)
      RadialGradientSsboFill Pipeline              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (96 draws)
      ShadowVertices Pipeline                      drawn as: depth Always -> GreaterEqual (660 draws)
      SolidFill Pipeline                           drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (2,400 draws)
      SweepGradientSsboFill Pipeline               drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (36 draws)
      TextureFill Pipeline                         drawn as: depth Always -> GreaterEqual (16 draws)
      TextureFillStrictSrc Pipeline                drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (60 draws)
      TiledTextureFill Pipeline SC=[1]             drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (418 draws)
      UberSdf Pipeline                             drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (295,723 draws)
      VerticesUber1 Pipeline SC=[1]                drawn as: depth Always -> GreaterEqual (8 draws)
      VerticesUber2 Pipeline SC=[1]                never drawn with any options

    msaa=4x blend=SrcOver depth=Always stencil=Ignore prim=Triangle format=B10G10R10A10XR +depth_stencil
      Circle Pipeline                              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (2,949 draws)
      Clip Pipeline                                drawn as: blend SrcOver -> Dst, depth Always -> GreaterEqual, stencil Ignore -> StencilIncrementAll, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (390 draws)
      ComplexRse Pipeline                          drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      ConicalGradientSsboFill Pipeline SC=[0]      never drawn with any options
      ConicalGradientSsboFill Pipeline SC=[1]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      ConicalGradientSsboFill Pipeline SC=[2]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (4 draws)
      ConicalGradientSsboFill Pipeline SC=[3]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (41 draws)
      FastGradient Pipeline                        drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt, depth_write off -> on (8 draws)
      GlyphAtlas Pipeline SC=[1]                   drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (690 draws)
      LinearGradientSsboFill Pipeline              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (86 draws)
      RadialGradientSsboFill Pipeline              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (96 draws)
      ShadowVertices Pipeline                      drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (660 draws)
      SolidFill Pipeline                           drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (2,400 draws)
      SweepGradientSsboFill Pipeline               drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (36 draws)
      TextureFill Pipeline                         drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (16 draws)
      TextureFillStrictSrc Pipeline                drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (60 draws)
      TiledTextureFill Pipeline SC=[1]             drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (418 draws)
      UberSdf Pipeline                             drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (2 draws)
      VerticesUber1 Pipeline SC=[1]                drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      VerticesUber2 Pipeline SC=[1]                never drawn with any options

    msaa=4x blend=SrcOver depth=Always stencil=Ignore prim=TriangleStrip format=B8G8R8A8UNormInt +depth_stencil
      AdvancedBlend Pipeline SC=[0,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[1,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[2,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[3,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[4,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[5,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[6,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[7,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[8,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[9,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[10,1]             drawn as: depth Always -> GreaterEqual (30 draws)
      AdvancedBlend Pipeline SC=[11,1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[12,1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[13,1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[14,1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      BorderMaskBlur Pipeline                      never drawn with any options
      ColorMatrixColorFilter Pipeline              drawn as: depth Always -> GreaterEqual (68 draws)
      FramebufferBlend Pipeline SC=[0,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (52 draws)
      FramebufferBlend Pipeline SC=[1,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[2,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[3,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (52 draws)
      FramebufferBlend Pipeline SC=[4,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (52 draws)
      FramebufferBlend Pipeline SC=[5,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[6,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[7,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[8,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (56 draws)
      FramebufferBlend Pipeline SC=[9,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (76 draws)
      FramebufferBlend Pipeline SC=[10,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (56 draws)
      FramebufferBlend Pipeline SC=[11,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[12,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (48 draws)
      FramebufferBlend Pipeline SC=[13,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[14,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      LinearToSrgbFilter Pipeline                  drawn as: depth Always -> GreaterEqual (8 draws)
      MorphologyFilter Pipeline SC=[1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (48 draws)
      PorterDuffBlend Pipeline SC=[1,0,0,0,0,0]    never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,0,0,1]    drawn as: depth Always -> GreaterEqual (4 draws)
      PorterDuffBlend Pipeline SC=[1,0,0,0,1,0]    never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,-1,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,0,-1]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,0,0]    drawn as: depth Always -> GreaterEqual (20 draws)
      PorterDuffBlend Pipeline SC=[1,0,1,0,0,0]    drawn as: depth Always -> GreaterEqual, prim TriangleStrip -> Triangle (86 draws)
      PorterDuffBlend Pipeline SC=[1,0,1,1,-1,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,0,0,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,0,1,0]   drawn as: depth Always -> GreaterEqual, prim TriangleStrip -> Triangle (4 draws)
      PorterDuffBlend Pipeline SC=[1,1,-1,1,-1,0]  never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,1,0,0]   drawn as: depth Always -> GreaterEqual (8 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,0,0,0]    drawn as: depth Always -> GreaterEqual (8 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,1,-1,0]   drawn as: depth Always -> GreaterEqual (6 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,1,0,0]    drawn as: depth Always -> GreaterEqual, format B8G8R8A8UNormInt -> B10G10R10A10XR (4 draws)
      RrectBlur Pipeline                           drawn as: depth Always -> GreaterEqual (454 draws)
      RsuperellipseBlur Pipeline                   never drawn with any options
      SrgbToLinearFilter Pipeline                  never drawn with any options
      YuvToRgbFilter Pipeline                      never drawn with any options

    msaa=4x blend=SrcOver depth=Always stencil=Ignore prim=TriangleStrip format=B10G10R10A10XR +depth_stencil
      BorderMaskBlur Pipeline                      never drawn with any options
      ColorMatrixColorFilter Pipeline              drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (68 draws)
      FramebufferBlend Pipeline SC=[0,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (52 draws)
      FramebufferBlend Pipeline SC=[1,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[2,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[3,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (52 draws)
      FramebufferBlend Pipeline SC=[4,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (52 draws)
      FramebufferBlend Pipeline SC=[5,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[6,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[7,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[8,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (56 draws)
      FramebufferBlend Pipeline SC=[9,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (76 draws)
      FramebufferBlend Pipeline SC=[10,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (56 draws)
      FramebufferBlend Pipeline SC=[11,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[12,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (48 draws)
      FramebufferBlend Pipeline SC=[13,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[14,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      LinearToSrgbFilter Pipeline                  drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      MorphologyFilter Pipeline SC=[1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt, depth_stencil on -> off (48 draws)
      PorterDuffBlend Pipeline SC=[1,0,0,0,0,0]    never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,0,0,1]    drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (4 draws)
      PorterDuffBlend Pipeline SC=[1,0,0,0,1,0]    never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,-1,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,0,-1]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,0,0]    drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (20 draws)
      PorterDuffBlend Pipeline SC=[1,0,1,0,0,0]    drawn as: depth Always -> GreaterEqual, prim TriangleStrip -> Triangle, format B10G10R10A10XR -> B8G8R8A8UNormInt (86 draws)
      PorterDuffBlend Pipeline SC=[1,0,1,1,-1,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,0,0,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,0,1,0]   drawn as: depth Always -> GreaterEqual, prim TriangleStrip -> Triangle, format B10G10R10A10XR -> B8G8R8A8UNormInt (4 draws)
      PorterDuffBlend Pipeline SC=[1,1,-1,1,-1,0]  never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,1,0,0]   drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,0,0,0]    drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,1,-1,0]   drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (6 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,1,0,0]    drawn as: depth Always -> GreaterEqual (4 draws)
      RrectBlur Pipeline                           drawn as: depth Always -> GreaterEqual (4 draws)
      RsuperellipseBlur Pipeline                   never drawn with any options
      SrgbToLinearFilter Pipeline                  never drawn with any options
      YuvToRgbFilter Pipeline                      never drawn with any options

Example output for --fail-on-unused-shaders:

================================================================================
Unused Impeller shaders
================================================================================
  13 shaders were created by a ContentContext but never drawn with, with
  any options, on any backend:

    BorderMaskBlur Pipeline                        [Metal]
    ConicalGradientSsboFill Pipeline spec=[0]      [Metal]
    PorterDuffBlend Pipeline spec=[1,0,0,0,0,0]    [Metal]
    PorterDuffBlend Pipeline spec=[1,0,0,0,1,0]    [Metal]
    PorterDuffBlend Pipeline spec=[1,0,0,1,-1,0]   [Metal]
    PorterDuffBlend Pipeline spec=[1,0,0,1,0,-1]   [Metal]
    PorterDuffBlend Pipeline spec=[1,0,1,1,-1,0]   [Metal]
    PorterDuffBlend Pipeline spec=[1,1,-1,0,0,0]   [Metal]
    PorterDuffBlend Pipeline spec=[1,1,-1,1,-1,0]  [Metal]
    RsuperellipseBlur Pipeline                     [Metal]
    SrgbToLinearFilter Pipeline                    [Metal]
    VerticesUber2 Pipeline spec=[1]                [Metal]
    YuvToRgbFilter Pipeline                        [Metal]

  Add a golden test that draws with each of them, or stop creating them.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant in-code documentation (doc comments with ///).
  • If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on [Discord].

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Sep 24, 2026
@walley892 walley892 added the CICD Run CI/CD label Sep 24, 2026
@walley892
walley892 requested a review from gaaclarke September 24, 2026 23:25
@walley892
walley892 marked this pull request as ready for review September 24, 2026 23:27

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a pipeline variant recording diagnostic for Impeller to track warmed versus drawn pipeline variants. It introduces the PipelineVariantRecorder utility, adds corresponding unit tests, and integrates report generation into the test suite via the --shader-report flag. Feedback on the implementation highlights a potential null pointer dereference in the ContentContext destructor when accessing pipelines_ without a prior null check.

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output is inscrutable right now =)

The flag should set the return value as non-zero when there is a warmed pipeline that isn't used. The log should only report the pipelines that are not used. It shouldn't mention used pipelines or how many times they were used.

"spec" is a surprising abbreviation for "specialization constants", "SC" is more clear.

@walley892 walley892 changed the title Add -shader-report option to impeller_unittests Add --shader-report and --fail-on-unused-shaders option to impeller_golden_tests Sep 25, 2026
@walley892

Copy link
Copy Markdown
Contributor Author

The flag should set the return value as non-zero when there is a warmed pipeline that isn't used. The log should only report the pipelines that are not used. It shouldn't mention used pipelines or how many times they were used.

Split the flag in two

--shader-report: The big ugly text dump that reports on which variants are prewarmed, but not used - this will be used to inform changes to our prewarming defaults.

--fail-on-unused-shaders: A coverage signal that indicates gaps in our testing/completely dead shaders - will be run in CI after the report from the description is handled.

"spec" is a surprising abbreviation for "specialization constants", "SC" is more clear.

Changed

inscrutable

📚 https://www.merriam-webster.com/word-of-the-day 📚

@walley892
walley892 requested a review from gaaclarke September 25, 2026 22:07

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to pull more of this added logic out of ContentContext. I'd like no additions to content_context.h and the only additions to content_context.cc to be macro calls. We can do that by splitting out more logic into it's own file and maybe a bit fancier bookkeeping.

Comment on lines +101 to +106
#ifdef IMPELLER_RECORD_PIPELINE_VARIANTS
warmed = tVariantRecorder != nullptr;
if (warmed) {
recorder_ = tVariantRecorder;
}
#endif // IMPELLER_RECORD_PIPELINE_VARIANTS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a scoped conditional compilation, please use a macro instead.

[warmed, recorder_] = IMPELLER_RECORD_PIPELINE_VARIANTS_FOOBAR();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved I think, didn't follow your exact pattern

@walley892
walley892 requested a review from gaaclarke September 30, 2026 18:14
gaaclarke
gaaclarke previously approved these changes Oct 1, 2026

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks that looks much more clean on content_context.cc

@walley892

Copy link
Copy Markdown
Contributor Author

@gaaclarke, had to do a minor fix for clang_tidy

gaaclarke
gaaclarke previously approved these changes Oct 1, 2026
@walley892

Copy link
Copy Markdown
Contributor Author

@gaaclarke I am once again asking for a re-lgtm

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 6, 2026
@auto-submit

auto-submit Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/193319, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR.

@walley892 walley892 added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 6, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 7, 2026
@auto-submit

auto-submit Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

auto label is removed for flutter/flutter/193319, Failed to enqueue flutter/flutter/193319 with HTTP 400: Something went wrong while executing your query on 2026-10-07T15:17:05Z. Please include C58E:193EC1:4A08C4:EDBBBF:6AC6626E when reporting this issue..

@walley892 walley892 added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 7, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 7, 2026
Merged via the queue into flutter:master with commit 37f6113 Oct 8, 2026
28 of 29 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 8, 2026
Renzo-Olivares pushed a commit to Renzo-Olivares/flutter that referenced this pull request Oct 16, 2026
…ter#194055)

Add golden tests for previously untested shaders. Follow on from
flutter#193319.




## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
dayanruben pushed a commit to dayanruben/flutter that referenced this pull request Oct 28, 2026
…er#194597)

flutter#193319 revealed that in our
golden test suite, 0% of draw calls were handled by a prewarmed pipeline
variant.

This causes a first-frame shader cache miss 100% of the time - causing
in the worst case a full re-compilation + link.

This change changes our defaults to better match what we actually
request at draw time.

Running impeller_golden_tests with --shader-report before this change:

```
Draws covered by warmed variants: 0 of 620,533 (0.0%)
```

Running impeller_golden_tests with --shader-report after this change:

```
Draws covered by warmed variants: 610,441 of 620,533 (98.4%)
```

Without compiling additional variants, we can't get full coverage in our
golden suite, but this change is directionally correct toward the goal
of eliminating first-frame shader cache misses.

Fixes flutter#194595

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…olden_tests (flutter#193319)

Fixes flutter#193318

Adds a --shader-report option to impeller_golden_tests. When running
with this option, the test suite will spit out a report on which shaders
were prewarmed, but never used.

Adds a --fail-on-unused-shaders option to impeller_golden_tests. When
running with this option, the goldens will fail if there are any shaders
that are completely unused in the golden tests.

Everything is only run in debug builds inside of impeller_golden_tests,
so no production impact. --fail-on-unused-shaders is not hooked up to CI
yet.

Example output for --shader-report:

```
================================================================================
Impeller pipeline variant usage
================================================================================
  2948 tests run, 55 skipped, 0 failed, filter '*'

  Legend: SC = specialization constants, +flag = option enabled,
          "drawn as" = how the same pipeline was actually drawn.

--------------------------------------------------------------------------------
Metal
  276 variants: 137 warmed (0 drawn) | 0 created lazily, never drawn
  Draws covered by warmed variants: 0 of 620,223 (0.0%)

  WARMED BUT NEVER DRAWN (137) - candidates to stop warming
    Likely cause: 111 of 137 were drawn, but only with other options:
         111  depth Always -> GreaterEqual
          48  blend SrcOver -> Src
          45  format B10G10R10A10XR -> B8G8R8A8UNormInt
          26  prim Triangle -> TriangleStrip
          16  depth_stencil on -> off
          16  msaa 4x -> 1x
           4  prim TriangleStrip -> Triangle
           2  blend SrcOver -> Dst
      ... 3 other changes
    26 of 137 were never drawn with any options.

    msaa=1x blend=SrcOver depth=Always stencil=Ignore prim=TriangleStrip format=B8G8R8A8UNormInt
      Gaussian Pipeline SC=[1]                     drawn as: depth Always -> GreaterEqual (2,248 draws)
      TextureDownsample Pipeline                   drawn as: depth Always -> GreaterEqual (866 draws)
      TextureDownsampleBounded Pipeline            drawn as: depth Always -> GreaterEqual (18 draws)

    msaa=1x blend=SrcOver depth=Always stencil=Ignore prim=TriangleStrip format=B10G10R10A10XR
      Gaussian Pipeline SC=[1]                     drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (2,248 draws)
      TextureDownsample Pipeline                   drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (866 draws)
      TextureDownsampleBounded Pipeline            drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (18 draws)

    msaa=4x blend=SrcOver depth=Always stencil=Ignore prim=Triangle format=B8G8R8A8UNormInt +depth_stencil
      Circle Pipeline                              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (2,949 draws)
      Clip Pipeline                                drawn as: blend SrcOver -> Dst, depth Always -> GreaterEqual, stencil Ignore -> StencilIncrementAll, prim Triangle -> TriangleStrip (390 draws)
      ComplexRse Pipeline                          drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (8 draws)
      ConicalGradientSsboFill Pipeline SC=[0]      never drawn with any options
      ConicalGradientSsboFill Pipeline SC=[1]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (8 draws)
      ConicalGradientSsboFill Pipeline SC=[2]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (4 draws)
      ConicalGradientSsboFill Pipeline SC=[3]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (41 draws)
      FastGradient Pipeline                        drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, depth_write off -> on (8 draws)
      GlyphAtlas Pipeline SC=[1]                   drawn as: depth Always -> GreaterEqual (690 draws)
      LinearGradientSsboFill Pipeline              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (86 draws)
      RadialGradientSsboFill Pipeline              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (96 draws)
      ShadowVertices Pipeline                      drawn as: depth Always -> GreaterEqual (660 draws)
      SolidFill Pipeline                           drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (2,400 draws)
      SweepGradientSsboFill Pipeline               drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (36 draws)
      TextureFill Pipeline                         drawn as: depth Always -> GreaterEqual (16 draws)
      TextureFillStrictSrc Pipeline                drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (60 draws)
      TiledTextureFill Pipeline SC=[1]             drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (418 draws)
      UberSdf Pipeline                             drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (295,723 draws)
      VerticesUber1 Pipeline SC=[1]                drawn as: depth Always -> GreaterEqual (8 draws)
      VerticesUber2 Pipeline SC=[1]                never drawn with any options

    msaa=4x blend=SrcOver depth=Always stencil=Ignore prim=Triangle format=B10G10R10A10XR +depth_stencil
      Circle Pipeline                              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (2,949 draws)
      Clip Pipeline                                drawn as: blend SrcOver -> Dst, depth Always -> GreaterEqual, stencil Ignore -> StencilIncrementAll, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (390 draws)
      ComplexRse Pipeline                          drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      ConicalGradientSsboFill Pipeline SC=[0]      never drawn with any options
      ConicalGradientSsboFill Pipeline SC=[1]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      ConicalGradientSsboFill Pipeline SC=[2]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (4 draws)
      ConicalGradientSsboFill Pipeline SC=[3]      drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (41 draws)
      FastGradient Pipeline                        drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt, depth_write off -> on (8 draws)
      GlyphAtlas Pipeline SC=[1]                   drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (690 draws)
      LinearGradientSsboFill Pipeline              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (86 draws)
      RadialGradientSsboFill Pipeline              drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (96 draws)
      ShadowVertices Pipeline                      drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (660 draws)
      SolidFill Pipeline                           drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (2,400 draws)
      SweepGradientSsboFill Pipeline               drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (36 draws)
      TextureFill Pipeline                         drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (16 draws)
      TextureFillStrictSrc Pipeline                drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (60 draws)
      TiledTextureFill Pipeline SC=[1]             drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip, format B10G10R10A10XR -> B8G8R8A8UNormInt (418 draws)
      UberSdf Pipeline                             drawn as: depth Always -> GreaterEqual, prim Triangle -> TriangleStrip (2 draws)
      VerticesUber1 Pipeline SC=[1]                drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      VerticesUber2 Pipeline SC=[1]                never drawn with any options

    msaa=4x blend=SrcOver depth=Always stencil=Ignore prim=TriangleStrip format=B8G8R8A8UNormInt +depth_stencil
      AdvancedBlend Pipeline SC=[0,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[1,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[2,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[3,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[4,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[5,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[6,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[7,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[8,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[9,1]              drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[10,1]             drawn as: depth Always -> GreaterEqual (30 draws)
      AdvancedBlend Pipeline SC=[11,1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[12,1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[13,1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      AdvancedBlend Pipeline SC=[14,1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (2 draws)
      BorderMaskBlur Pipeline                      never drawn with any options
      ColorMatrixColorFilter Pipeline              drawn as: depth Always -> GreaterEqual (68 draws)
      FramebufferBlend Pipeline SC=[0,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (52 draws)
      FramebufferBlend Pipeline SC=[1,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[2,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[3,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (52 draws)
      FramebufferBlend Pipeline SC=[4,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (52 draws)
      FramebufferBlend Pipeline SC=[5,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[6,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[7,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[8,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (56 draws)
      FramebufferBlend Pipeline SC=[9,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (76 draws)
      FramebufferBlend Pipeline SC=[10,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (56 draws)
      FramebufferBlend Pipeline SC=[11,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[12,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (48 draws)
      FramebufferBlend Pipeline SC=[13,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      FramebufferBlend Pipeline SC=[14,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual (44 draws)
      LinearToSrgbFilter Pipeline                  drawn as: depth Always -> GreaterEqual (8 draws)
      MorphologyFilter Pipeline SC=[1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, depth_stencil on -> off (48 draws)
      PorterDuffBlend Pipeline SC=[1,0,0,0,0,0]    never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,0,0,1]    drawn as: depth Always -> GreaterEqual (4 draws)
      PorterDuffBlend Pipeline SC=[1,0,0,0,1,0]    never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,-1,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,0,-1]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,0,0]    drawn as: depth Always -> GreaterEqual (20 draws)
      PorterDuffBlend Pipeline SC=[1,0,1,0,0,0]    drawn as: depth Always -> GreaterEqual, prim TriangleStrip -> Triangle (86 draws)
      PorterDuffBlend Pipeline SC=[1,0,1,1,-1,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,0,0,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,0,1,0]   drawn as: depth Always -> GreaterEqual, prim TriangleStrip -> Triangle (4 draws)
      PorterDuffBlend Pipeline SC=[1,1,-1,1,-1,0]  never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,1,0,0]   drawn as: depth Always -> GreaterEqual (8 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,0,0,0]    drawn as: depth Always -> GreaterEqual (8 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,1,-1,0]   drawn as: depth Always -> GreaterEqual (6 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,1,0,0]    drawn as: depth Always -> GreaterEqual, format B8G8R8A8UNormInt -> B10G10R10A10XR (4 draws)
      RrectBlur Pipeline                           drawn as: depth Always -> GreaterEqual (454 draws)
      RsuperellipseBlur Pipeline                   never drawn with any options
      SrgbToLinearFilter Pipeline                  never drawn with any options
      YuvToRgbFilter Pipeline                      never drawn with any options

    msaa=4x blend=SrcOver depth=Always stencil=Ignore prim=TriangleStrip format=B10G10R10A10XR +depth_stencil
      BorderMaskBlur Pipeline                      never drawn with any options
      ColorMatrixColorFilter Pipeline              drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (68 draws)
      FramebufferBlend Pipeline SC=[0,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (52 draws)
      FramebufferBlend Pipeline SC=[1,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[2,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[3,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (52 draws)
      FramebufferBlend Pipeline SC=[4,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (52 draws)
      FramebufferBlend Pipeline SC=[5,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[6,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[7,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[8,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (56 draws)
      FramebufferBlend Pipeline SC=[9,1]           drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (76 draws)
      FramebufferBlend Pipeline SC=[10,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (56 draws)
      FramebufferBlend Pipeline SC=[11,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[12,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (48 draws)
      FramebufferBlend Pipeline SC=[13,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      FramebufferBlend Pipeline SC=[14,1]          drawn as: blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (44 draws)
      LinearToSrgbFilter Pipeline                  drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      MorphologyFilter Pipeline SC=[1]             drawn as: msaa 4x -> 1x, blend SrcOver -> Src, depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt, depth_stencil on -> off (48 draws)
      PorterDuffBlend Pipeline SC=[1,0,0,0,0,0]    never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,0,0,1]    drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (4 draws)
      PorterDuffBlend Pipeline SC=[1,0,0,0,1,0]    never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,-1,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,0,-1]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,0,0,1,0,0]    drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (20 draws)
      PorterDuffBlend Pipeline SC=[1,0,1,0,0,0]    drawn as: depth Always -> GreaterEqual, prim TriangleStrip -> Triangle, format B10G10R10A10XR -> B8G8R8A8UNormInt (86 draws)
      PorterDuffBlend Pipeline SC=[1,0,1,1,-1,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,0,0,0]   never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,0,1,0]   drawn as: depth Always -> GreaterEqual, prim TriangleStrip -> Triangle, format B10G10R10A10XR -> B8G8R8A8UNormInt (4 draws)
      PorterDuffBlend Pipeline SC=[1,1,-1,1,-1,0]  never drawn with any options
      PorterDuffBlend Pipeline SC=[1,1,-1,1,0,0]   drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,0,0,0]    drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (8 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,1,-1,0]   drawn as: depth Always -> GreaterEqual, format B10G10R10A10XR -> B8G8R8A8UNormInt (6 draws)
      PorterDuffBlend Pipeline SC=[1,1,0,1,0,0]    drawn as: depth Always -> GreaterEqual (4 draws)
      RrectBlur Pipeline                           drawn as: depth Always -> GreaterEqual (4 draws)
      RsuperellipseBlur Pipeline                   never drawn with any options
      SrgbToLinearFilter Pipeline                  never drawn with any options
      YuvToRgbFilter Pipeline                      never drawn with any options
```

Example output for --fail-on-unused-shaders:

```
================================================================================
Unused Impeller shaders
================================================================================
  13 shaders were created by a ContentContext but never drawn with, with
  any options, on any backend:

    BorderMaskBlur Pipeline                        [Metal]
    ConicalGradientSsboFill Pipeline spec=[0]      [Metal]
    PorterDuffBlend Pipeline spec=[1,0,0,0,0,0]    [Metal]
    PorterDuffBlend Pipeline spec=[1,0,0,0,1,0]    [Metal]
    PorterDuffBlend Pipeline spec=[1,0,0,1,-1,0]   [Metal]
    PorterDuffBlend Pipeline spec=[1,0,0,1,0,-1]   [Metal]
    PorterDuffBlend Pipeline spec=[1,0,1,1,-1,0]   [Metal]
    PorterDuffBlend Pipeline spec=[1,1,-1,0,0,0]   [Metal]
    PorterDuffBlend Pipeline spec=[1,1,-1,1,-1,0]  [Metal]
    RsuperellipseBlur Pipeline                     [Metal]
    SrgbToLinearFilter Pipeline                    [Metal]
    VerticesUber2 Pipeline spec=[1]                [Metal]
    YuvToRgbFilter Pipeline                        [Metal]

  Add a golden test that draws with each of them, or stop creating them.
```

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…ter#194055)

Add golden tests for previously untested shaders. Follow on from
flutter#193319.




## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…er#194597)

flutter#193319 revealed that in our
golden test suite, 0% of draw calls were handled by a prewarmed pipeline
variant.

This causes a first-frame shader cache miss 100% of the time - causing
in the worst case a full re-compilation + link.

This change changes our defaults to better match what we actually
request at draw time.

Running impeller_golden_tests with --shader-report before this change:

```
Draws covered by warmed variants: 0 of 620,533 (0.0%)
```

Running impeller_golden_tests with --shader-report after this change:

```
Draws covered by warmed variants: 610,441 of 620,533 (98.4%)
```

Without compiling additional variants, we can't get full coverage in our
golden suite, but this change is directionally correct toward the goal
of eliminating first-frame shader cache misses.

Fixes flutter#194595

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Audit pipeline usage in impeller_unittests

2 participants