Towards implementing the FragmentProgram API in Impeller.
Specifies an Impeller specific format for data the renderer can use to create
pipelines with user supplied shader stages at runtime.
The data is in the form of a flatbuffer with a known schema.
This patch implements the wire format, creating and loading the program
payloads, and creating pipeline state objects using these payloads.
If the user supplied SPIRV intended for the older API, the loader will reject
this invalid payload. This is probably not going to be too much of an issue
because the FragmentProgram API will probably be modified to only allow buffers
loaded from asset managers. But still, in the meantime, I am using the old API
to pass these new buffers.
Fixes https://github.com/flutter/flutter/issues/104750
Fixes https://github.com/flutter/flutter/issues/105542
Towards resolving https://github.com/flutter/flutter/issues/102853
* Dries up GN rules for Metal and OpenGL ES shader compilation and embedding in
a target binary.
* Adds support for shader compile time macro definitions. This is so that
workarounds for specific shader backends can be implemented. In the case of
this patch, there are temporary OpenGLES workaround for users of instancing
and SSBOs. These will be removed when I rework glyph rendering to not use
these features that are missing in legacy targets.
* Since there is no concept of an OpenGLES shader library akin to a `.metallib`,
adds a target called `blobcat` that concatenates shader blobs into single blob
that can be embedded into a target binary. No parsing or data copying is
necessary.
* `imgui_raster.vert` has been rewritten to work around the absence of unsigned
integer types in legacy backends.
As we add more rendering backends, adding a new enum value to a single macro
`INSTANTIATE_PLAYGROUND_SUITE` in `playground.h` will create a new test variant
in any suite that uses playgrounds.
The invocations will look like the following:
```
[ RUN ] Play/TypographerTest.CanCreateGlyphAtlas/Metal
[ OK ] Play/TypographerTest.CanCreateGlyphAtlas/Metal (210 ms)
[ RUN ] Play/TypographerTest.CanCreateGlyphAtlas/OpenGLES
[ OK ] Play/TypographerTest.CanCreateGlyphAtlas/OpenGLES (xxx ms)
```
If you want to test just one backend, you may add a filter like so
`--gtest_filter="*/Metal"`
Right now, I have not added a the OpenGLES variant to the default test suite
instantiation since there are so many failures (that is just a stub ATM). But,
if the need arises to skip specific tests based on the backend in use (we won't
support instancing in OpenGLES for example), the backend for the playground may
be queried before deciding to GTEST_SKIP the invocation.
One additional change in the patch that will be reworked soon is the Metal
specificity of the source set generated after reflection. This will be made
agnostic in the coming few patches. Right now, these headers are in the `mtl`
folder.
Also fixes the files with missing licenses. This check is somewhat easy with
Impeller than in the engine because all source files must have the same license
block.
Resolves an action item in the umbrella issue https://github.com/flutter/flutter/issues/97686.