Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impeller] Move primitive type to pipeline descriptor #37315

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

iskakaushik
Copy link
Contributor

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

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
Copy link
Contributor

@dnfield dnfield left a 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

@iskakaushik iskakaushik added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 4, 2022
@auto-submit auto-submit bot merged commit 2ac9c73 into flutter:main Nov 4, 2022
@iskakaushik iskakaushik deleted the primitive-assembly-pipeline branch November 4, 2022 18:06
@@ -115,6 +115,10 @@ class PipelineDescriptor final : public Comparable<PipelineDescriptor> {

WindingOrder GetWindingOrder() const;

void SetPrimitiveType(PrimitiveType type);
Copy link
Member

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;
}
}
Copy link
Member

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.

Copy link
Contributor Author

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();
Copy link
Member

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;
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

@iskakaushik iskakaushik changed the title Move primitive type to pipeline descriptor [Impeller] Move primitive type to pipeline descriptor Nov 4, 2022
@iskakaushik iskakaushik self-assigned this Nov 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 4, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 4, 2022
…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)
iskakaushik added a commit to iskakaushik/engine that referenced this pull request Nov 9, 2022
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
schwa423 pushed a commit to schwa423/engine that referenced this pull request Nov 16, 2022
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
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
…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)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Impeller] Move primitive topology from Command to PipelineDescriptor.
3 participants