[Impeller] basic outline of geometry classes + vertices#36649
[Impeller] basic outline of geometry classes + vertices#36649auto-submit[bot] merged 7 commits intoflutter:mainfrom
Conversation
| return {}; | ||
| } | ||
|
|
||
| GeometryVertexType VerticesGeometry::GetVertexType() { |
There was a problem hiding this comment.
This is a bool in the design, but we'll need to figure out all of the vertices combinations to support first - the color sources might need to know about it.
For example, if we have texture coordinates and a tiled texture image source, blend mode, and a paint color, do we need to blend those together?
There was a problem hiding this comment.
Ah geez, I knew I was forgetting something. I need to go through and check all these cases. If we end up needing to blend in the vertex colors for images and/or gradients, I think we can easily support it by finish up adding all the blends on the GPU and basically do 23 item switch statement -- although dynamic dispatch should be possible on some backends!
There was a problem hiding this comment.
(In practice this would just look like a couple of extra uniforms and a call into a shader library function in each color source fragment shader.)
| void VerticesContents::SetGeometry(std::unique_ptr<Geometry> geometry) { | ||
| geometry_ = std::move(geometry); | ||
| } | ||
|
|
There was a problem hiding this comment.
Passing this into VerticesContents to start using it right away is a cool idea.
There was a problem hiding this comment.
This and the GetCoverage seem like something that could eventually just be members of the base contents class, or perhaps of some base GeometryContents class?
There was a problem hiding this comment.
This should go on the ColorSourceContents base class once we start upgrading the color sources. Some Contents (namely FilterContents) take other Contents as input as opposed to Geometry.
There was a problem hiding this comment.
(VerticesContents should also go away and/or be renamed to ColorColorSourceContents in the end)
jonahwilliams
left a comment
There was a problem hiding this comment.
This breaks some stuff with drawVertices + colors, still looking at it
|
forgot to break 🤦 |
|
Gold has detected about 2 new digest(s) on patchset 7. |
I took an initial stab at some of the API in go/impeller-geometry. This only works for vertices so far. Some findings:
I put the geometry implementation in a single TU in impeller/entity. renderer felt too low level, and geometry doesn't have the necessary dependencies.
The pipeline declarations are awkward since I'm jamming all of this functionality into vertices for now, but once we remove the vertices_contents and make the other color sources support it it should hopefully simplify a bit.
Punted on adding support for texture coordinates to vertices for now