-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Move primitive type to pipeline descriptor #37315
[Impeller] Move primitive type to pipeline descriptor #37315
Conversation
This is the correct abstraction for Vulkan as we need this during primitive assembly. We also know this ahead of time so its useful to just wire it in. Fixes flutter/flutter#106379
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @jonahwilliams may be interested in looking at this
@@ -115,6 +115,10 @@ class PipelineDescriptor final : public Comparable<PipelineDescriptor> { | |||
|
|||
WindingOrder GetWindingOrder() const; | |||
|
|||
void SetPrimitiveType(PrimitiveType type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setters return a reference to the descriptor so we can chain them. Though I don't see that pattern followed a lot.
case PrimitiveType::kPoint: | ||
return vk::PrimitiveTopology::ePointList; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add FML_UNREACHABLE just to better guarantee exhaustive switches? The functions earlier in this TU do this as do all the other backends. For consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call! done: #37324
@@ -494,6 +494,8 @@ static bool Bind(PassBindingsCache& pass, | |||
return false; | |||
} | |||
|
|||
const PrimitiveType primitive_type = pipeline_desc.GetPrimitiveType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Could just convert it to MTLPrimitiveType here.
@@ -86,7 +86,6 @@ bool ClipContents::Render(const ContentContext& renderer, | |||
{ | |||
cmd.label = "Difference Clip (Increment)"; | |||
|
|||
cmd.primitive_type = PrimitiveType::kTriangleStrip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did we manage to get rid of the strip here without reworking the vertex buffer? Was it just incorrect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chinmaygarde it was always overwritten, see line: 123. I think there was a refactor at some point to use the geometry_result
but this line never got removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.
…114710) * 9584880f4 Use iOS 16 APIs to rotate orientation (flutter/engine#37302) * 2ac9c73f6 Move primitive type to pipeline descriptor (flutter/engine#37315) * 6950689ed Roll Skia from 7a45d3123f8b to dc49f35e1ac6 (6 revisions) (flutter/engine#37319)
This was wrongly removed in flutter#37315 where I assumed that this was overwritten by geometry_result a few lines below, but there is indeed a pipeline created earlier in line:100. Fixes: flutter/flutter#114870
This is the correct abstraction for Vulkan as we need this during primitive assembly. We also know this ahead of time so its useful to just wire it in. Fixes flutter/flutter#106379
…lutter#114710) * 9584880f4 Use iOS 16 APIs to rotate orientation (flutter/engine#37302) * 2ac9c73f6 Move primitive type to pipeline descriptor (flutter/engine#37315) * 6950689ed Roll Skia from 7a45d3123f8b to dc49f35e1ac6 (6 revisions) (flutter/engine#37319)
…lutter#114710) * 9584880f4 Use iOS 16 APIs to rotate orientation (flutter/engine#37302) * 2ac9c73f6 Move primitive type to pipeline descriptor (flutter/engine#37315) * 6950689ed Roll Skia from 7a45d3123f8b to dc49f35e1ac6 (6 revisions) (flutter/engine#37319)
This is the correct abstraction for Vulkan as we need this during primitive assembly. We also know this ahead of time so its useful to just wire it in.
Fixes flutter/flutter#106379