Jonah Williams 4a5c573f14 [Impeller] add additional setup method that caches more pipelines, warms internal shader code (flutter/engine#50521)
Part of https://github.com/flutter/flutter/issues/138236

Fixes a number of issues related to startup performance by adding an "InitializeCommonlyUsedShadersIfNeeded" method to content context.

On the first frame of a flutter application renders, the backend will populate the glyph atlas for the first time. On the Vulkan backend, this executes vkCmdCopyBufferToImage. The first time this runs, Arm Mali drivers will generate an additional shader program. Creates a 1x1 texture and sets the contents to force this code to compile eagerly.

![image](https://github.com/flutter/engine/assets/8975114/558e7680-77e1-4cec-94d2-17128f4c8865)

The first time a render pass is constructed, a shader is complied. This does not seem to depend on the properties of the render pass, so we just create a trivial one and submit it.

![image](https://github.com/flutter/engine/assets/8975114/4d9c9266-adfb-4d18-84cc-eb60127147ed)

Finally there are a few missing shader variants. Lets just go ahead a populate that cache a bit more
2024-02-17 05:37:05 +00:00
Languages
Dart 75%
C++ 16.5%
Objective-C++ 2.9%
Java 2.8%
Objective-C 0.7%
Other 1.9%