48 Commits

Author SHA1 Message Date
Chinmay Garde
c79513f07c [Impeller] Specify the min simulator version. (flutter/engine#36809) 2022-10-17 21:22:55 +00:00
Brandon DeRosier
c1ea726441 [Impeller] Enable impeller_unittests on Windows (flutter/engine#36405) 2022-09-25 14:20:35 -07:00
Dan Field
dc1b2c14d1 [Impeller] Compute shader support (flutter/engine#35750) 2022-08-31 19:07:49 +00:00
Chinmay Garde
2bd509563a [Impeller] Remove redundant GN flags. (flutter/engine#35062) 2022-08-01 21:54:03 +00:00
Zachary Anderson
8cd062be3c Remove FragmentProgram.compile() (flutter/engine#34855) 2022-07-22 18:30:54 -07:00
Zachary Anderson
26a5b40455 [impellerc] Adds an --iplr flag (flutter/engine#34822) 2022-07-21 13:52:33 -07:00
Chinmay Garde
b69a07df25 [Impeller] Stub a Vulkan backend. (flutter/engine#34717) 2022-07-18 23:26:05 +00:00
Zachary Anderson
3258c4c00b [impellerc] Adds an SkSL backend (flutter/engine#34441) 2022-07-13 15:05:00 -07:00
Brandon DeRosier
214c13830a [Impeller] Add shader library; reduce branching in advanced blends (flutter/engine#34349) 2022-06-30 11:00:42 -07:00
Kaushik Iska
3e6c1ed814 [Impeller] Pass --std=ios-metal1.2 only in opt mode (flutter/engine#34256)
Passing this flag in unopt mode disables the debug symbols
from being shown in xcode.

fixes: https://github.com/flutter/flutter/issues/106066
2022-06-28 13:30:19 -04:00
Chinmay Garde
16731be1a7 [Impeller] Allow for the specification of pipeline stage information at runtime. (flutter/engine#33882)
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
2022-06-13 18:33:00 -07:00
Jason Simmons
71b57d8468 Update the impellerc GN template to match the behavior of flutter-spirv mode (flutter/engine#33917) 2022-06-09 10:18:04 -07:00
Zachary Anderson
7572a18ffe pylint a few python scripts and lint in lint.sh (flutter/engine#33675) 2022-06-04 15:21:18 -07:00
Zachary Anderson
1790d5a019 Adds a python formatter (flutter/engine#33797)
* Adds a python formatter

* Apply format
2022-06-03 13:00:14 -07:00
Chinmay Garde
80963f0f7b [Impeller] Control GL error checking and tracing via GN options. (flutter/engine#33734) 2022-05-31 18:33:04 -07:00
Brandon DeRosier
32b77309c7 Fixes to get impeller_unittests building on Windows (flutter/engine#33705) 2022-05-31 01:13:47 -07:00
Chinmay Garde
cc83eb1091 [Impeller] Compile simulator specific Metal shader variants. (flutter/engine#33670) 2022-05-27 17:53:05 -07:00
Lau Ching Jun
bf793ac0cd [impeller] Import the header file in the generated shader file. (flutter/engine#33623) 2022-05-25 14:28:04 -07:00
Chinmay Garde
7df5e81ea8 [impeller] Wire up the OpenGL ES Backend. (flutter/engine#33405) 2022-05-17 13:16:25 -07:00
Zachary Anderson
98bfa2d298 Add an option to use a prebuilt impellerc (flutter/engine#33139) 2022-05-05 18:38:37 -07:00
Chinmay Garde
eaccba761d [impeller] Implement an OpenGL ES 2.0 backend. (flutter/engine#33084) 2022-05-04 15:54:06 -07:00
Chinmay Garde
bbe5ef72cb Compile and package all shaders for the OpenGL ES backend. (flutter/engine#146)
* 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.
2022-04-27 15:57:33 -07:00
Chinmay Garde
12d6f25901 Add an OpenGL ES stub and parameterize all playgrounds on rendering backend. (flutter/engine#141)
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.
2022-04-27 15:57:33 -07:00
Chinmay Garde
621719cab6 Add impellerc options to compile OpenGL Desktop and ES variant shaders. (flutter/engine#139)
Also parameterize all unit-tests so all backends are automatically tested.
2022-04-27 15:57:33 -07:00
Dan Field
7a8c2a90e7 Move rendering TUs behind own flag (flutter/engine#134) 2022-04-27 15:57:33 -07:00
Dan Field
3ca787ddae Allow building targets that do not create metal shaders on all platforms. (flutter/engine#133) 2022-04-27 15:57:33 -07:00
Chinmay Garde
3c2ea47abf Add static thread safety analysis ready synchronization primitives. (flutter/engine#117) 2022-04-27 15:57:33 -07:00
Chinmay Garde
0648a2a261 Document GN rules and make targets that cannot be built on the platform be no-ops. (flutter/engine#70) 2022-04-27 15:57:33 -07:00
Chinmay Garde
615d4e8413 Add a script that checks that all source files have a valid license block. (flutter/engine#63)
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.
2022-04-27 15:57:33 -07:00
Dan Field
6fc72b98a7 Remove FML dependency on geometry, tessellator (flutter/engine#59)
* Remove FML dependency on geometry, tessellator

* update readme
2022-04-27 15:57:33 -07:00
Zachary Anderson
2659111946 Adds a GN flag for playgrounds (flutter/engine#7) 2022-04-27 15:57:33 -07:00
Zachary Anderson
a7c3fab3d8 Use -M0 instead of -frecord-sources (flutter/engine#5) 2022-04-27 15:57:33 -07:00
Chinmay Garde
da1929b38b Gate the minimum iOS deployment versions in the generated shaders. 2022-04-27 15:57:33 -07:00
Chinmay Garde
a440bc8733 Shader data can now be compiled into the binary.
There is no more need to figure out separate packaging of shader data.
2022-04-27 15:57:33 -07:00
Chinmay Garde
35432f7578 Forward targets specification to the code generator in impellerc. 2022-04-27 15:57:33 -07:00
Chinmay Garde
3c5bfd5901 Holy size savings Batman!
Optimize and compress shaders for size in release modes.
2022-04-27 15:57:33 -07:00
Chinmay Garde
d4308e38ee Rename the compositor to the entity framework. 2022-04-27 15:57:33 -07:00
Chinmay Garde
36cb61f523 Merge shader_glue into compositor. 2022-04-27 15:57:33 -07:00
Chinmay Garde
ef4981b4d5 Generate code for simple named binders. 2022-04-27 15:57:33 -07:00
Chinmay Garde
13c5f46edc Generate reflection info for samplers and images. 2022-04-27 15:57:33 -07:00
Chinmay Garde
fe94b51880 Add FIXME to address removing debug information from generated shaders. 2022-04-27 15:57:33 -07:00
Chinmay Garde
88fed81b83 Embed shader and driver sources in compiled Metal AIR files. 2022-04-27 15:57:33 -07:00
Chinmay Garde
36373c0e04 Pipeline state objects pass validation. 2022-04-27 15:57:33 -07:00
Chinmay Garde
60ca2b8fbc Reorganize project structure. 2022-04-27 15:57:33 -07:00
Chinmay Garde
ee3b16e857 Modularize build rules. 2022-04-27 15:57:33 -07:00
Chinmay Garde
87d1a4fa8e Wire up depfile support and Metal shader linking in GN rules. 2022-04-27 15:57:33 -07:00
Chinmay Garde
2092759b01 Fix runtime shader loading. 2022-04-27 15:57:33 -07:00
Chinmay Garde
8182721179 Wire up metal library generation. 2022-04-27 15:57:33 -07:00