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] Simplify convex tessellation #47957

Merged
merged 9 commits into from
Nov 15, 2023

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Nov 11, 2023

Removes usage of index buffer and adds zig-zagging triangle strip. Could also be adapted emplace directly into host
buffer.

Benchmark is https://flutter-engine-perf.skia.org/e/?queries=test%3DBM_Convex_rrect_convex

Umbrella issue: flutter/flutter#138004

@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #47957 at sha f20b4d6

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #47957 at sha d0dd986

Copy link
Member

@bdero bdero left a comment

Choose a reason for hiding this comment

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

LGTM! Suggestion about testing.

for (auto j = 0u; j < polyline.contours.size(); j++) {
auto [start, end] = polyline.GetContourPointBounds(j);
auto center = polyline.GetPoint(start);
auto origin = polyline.GetPoint(start);
Copy link
Member

Choose a reason for hiding this comment

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

nit: first_point?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

TEST_P(AiksTest, CanDrawMultiContourConvexPath) {
PathBuilder builder = {};
for (auto i = 0; i < 10; i++) {
builder.AddCircle(Point(100 + 10 * i, 100 + 10 * i), 100);
Copy link
Member

Choose a reason for hiding this comment

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

nit: Interlace triangles here too (so the appended contours will be Circle, Triangle, Circle, Triangle, etc.) that way we know we're testing the a == b branch for TessellateConvex, which will only trigger for contours with an odd number of points.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh good idea.

output.emplace_back(polyline.GetPoint(b));
}
if (a == b) {
output.emplace_back(polyline.GetPoint(a));
Copy link
Member

Choose a reason for hiding this comment

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

I think this checks out... for 3 points it should append indices 0, 1, 2, and for 4 points it should append 0, 1, 3, 2, etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh but there is a bug here, on L268 b should start at end and not end -, probably ...

Copy link
Member Author

Choose a reason for hiding this comment

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

or maybe not, let me double check my assumptions here

Copy link
Member Author

Choose a reason for hiding this comment

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

YEah, there was an issue in how I was doing the strip breaks, I needed to remove an extra point, now the triangles show up. Good idea, once again

@jonahwilliams
Copy link
Member Author

image

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #47957 at sha 37c238a

@jonahwilliams
Copy link
Member Author

@bdero PTAL

Copy link
Member

@bdero bdero 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 jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 15, 2023
@auto-submit auto-submit bot merged commit ae30d33 into flutter:main Nov 15, 2023
27 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 15, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 15, 2023
…138457)

flutter/engine@d7ca057...bc5bbd3

2023-11-15 [email protected] [web] JSConfig: Add multiViewEnabled value. (flutter/engine#47939)
2023-11-15 [email protected] [Impeller] Simplify convex tessellation (flutter/engine#47957)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
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 will affect goldens
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants