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] Reland 3: Implement draw order optimization. #54673

Merged
merged 4 commits into from
Aug 23, 2024

Conversation

bdero
Copy link
Member

@bdero bdero commented Aug 21, 2024

Attempt 1: #54136
Revert 1: #54067
Attempt 2: #54215
Revert 2: #54261
Attempt 3: #54268
Revert 3: #54325

This time for sure!

Includes a fix for the bug discovered in yt.

This turned out to be a bug that was laying dormant in EntityPass for about 5 months. During the clip replay, the clip scissor was getting set to clip_coverage_stack.CurrentClipCoverage() instead of the coverage stored along side the clip being replayed.

Description

For each clip scope, draw opaque items in reverse order and translucent/backdrop-independent items in their original order afterwards. Clips are treated as translucent by the parent scope.

Respects clips, subpass collapse, and the clear color optimization.

Local new_gallery before/after (iPhone 12 mini):

cd ~/projects/flutter/flutter/dev/integration_tests/new_gallery
flutter drive --profile --local-engine-src-path ~/projects/flutter/engine/src --local-engine=ios_profile --local-engine-host=host_profile_arm64 --trace-startup -t test_driver/transitions_perf.dart -d 00008101-000A59A93C10001E

image

@bdero bdero force-pushed the bdero/draw-order-optimization-3 branch from 3db20e1 to 9a54d47 Compare August 21, 2024 06:06
if (draw_order_layers_.size() == 1u) {
// This is likely recoverable, so don't assert.
VALIDATION_LOG
<< "Attemped to pop the first draw order clip layer. This is a bug in "
Copy link
Contributor

Choose a reason for hiding this comment

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

Should that read "may be a bug"?

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.

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

As long as the draw order resolver is working off of indices, it should be straightforward to port to the new canvas. That said, I plan to reland the switch after #54604 which would disable this optimization, unless you update exp canvas as well.

@flar
Copy link
Contributor

flar commented Aug 21, 2024

As long as the draw order resolver is working off of indices, it should be straightforward to port to the new canvas. That said, I plan to reland the switch after #54604 which would disable this optimization, unless you update exp canvas as well.

I'm still trying to reland indices (#54676) so we can't do reorder optimization until that happens. And expCanvas doesn't use indices at all yet, so we'd need to decide if we want to do that conversion as a separate step or combine it with the re-order re-write.

@bdero
Copy link
Member Author

bdero commented Aug 21, 2024

It's hard to know exactly what features we need in the DL until this actually sticks. The nature of what we'd need to do in exp canvas to support this kind of thing changed significantly from the first time I tried to land this.

So I'll help unravel the puzzle after this change sticks.

@bdero bdero requested review from flar and jonahwilliams August 21, 2024 21:24
@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 #54673 at sha 5ac4d63

while (const EntityPassClipStack::ReplayResult* next_replay_clip =
clip_coverage_stack.GetNextReplayResult(element_entity)) {
auto& replay_entity = next_replay_clip->entity;
SetClipScissor(next_replay_clip->clip_coverage, *result.pass,
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only line that changed from the previous attempt (other than the new golden that I added).

clip_coverage_stack.CurrentClipCoverage() changed to next_replay_clip->clip_coverage.

@bdero bdero merged commit c99eda4 into flutter:main Aug 23, 2024
32 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 23, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 23, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 23, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 23, 2024
…153994)

flutter/engine@67a7fe1...e4fac78

2024-08-23 flar@google.com Revert "Framework wide color" (flutter/engine#54728)
2024-08-23 skia-flutter-autoroll@skia.org Roll Skia from 7ac776072577 to 7d96b8516e8d (3 revisions) (flutter/engine#54731)
2024-08-23 skia-flutter-autoroll@skia.org Roll Skia from 789f5cb0b9c2 to 7ac776072577 (1 revision) (flutter/engine#54729)
2024-08-23 skia-flutter-autoroll@skia.org Roll Skia from b25553b2fb9f to 789f5cb0b9c2 (1 revision) (flutter/engine#54726)
2024-08-23 skia-flutter-autoroll@skia.org Roll Dart SDK from ca009736fb3e to f9e6abb21ac7 (1 revision) (flutter/engine#54725)
2024-08-23 bdero@google.com [Impeller] Reland 3: Implement draw order optimization. (flutter/engine#54673)
2024-08-23 skia-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from 2fOjXGNxdSoRSGCL7... to 2TaLkdJNlAIbDYccn... (flutter/engine#54721)
2024-08-23 skia-flutter-autoroll@skia.org Roll Fuchsia GN SDK from sbh76PYVTMxav4ACT... to OKGFjciA5Vd0TQks4... (flutter/engine#54722)
2024-08-22 magder@google.com Test running the macOS engine has no stray logging (flutter/engine#54716)
2024-08-22 skia-flutter-autoroll@skia.org Roll Dart SDK from 937389f7bc48 to ca009736fb3e (1 revision) (flutter/engine#54719)
2024-08-22 matanlurey@users.noreply.github.com More diagnostic clean ups (flutter/engine#54265)
2024-08-22 30870216+gaaclarke@users.noreply.github.com Framework wide color (flutter/engine#54415)
2024-08-22 skia-flutter-autoroll@skia.org Roll Skia from 10e9072dcea0 to b25553b2fb9f (2 revisions) (flutter/engine#54717)
2024-08-22 skia-flutter-autoroll@skia.org Roll Dart SDK from ce160bf13347 to 937389f7bc48 (1 revision) (flutter/engine#54715)
2024-08-22 yjbanov@google.com [web:semantics] fix double click due to long-press (flutter/engine#54697)
2024-08-22 skia-flutter-autoroll@skia.org Roll Skia from 04ce2e2bfc35 to 10e9072dcea0 (1 revision) (flutter/engine#54713)
2024-08-22 zanderso@users.noreply.github.com Pin mac host and iOS builds to arm64 builders (flutter/engine#54711)
2024-08-22 chris@bracken.jp macOS: Bundle dSYM packages in FlutterMacOS.xcframework (flutter/engine#54696)
2024-08-22 skia-flutter-autoroll@skia.org Roll Skia from 7611984dc27b to 04ce2e2bfc35 (2 revisions) (flutter/engine#54712)
2024-08-22 joel.winarske@gmail.com vulkan_glfw validation layer logging (flutter/engine#54607)
2024-08-22 skia-flutter-autoroll@skia.org Roll Skia from 4c66b7e42027 to 7611984dc27b (1 revision) (flutter/engine#54710)
2024-08-22 skia-flutter-autoroll@skia.org Roll Dart SDK from 025bf8d376d3 to ce160bf13347 (1 revision) (flutter/engine#54709)

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 jimgraham@google.com,rmistry@google.com,zra@google.com 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
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…lutter#153994)

flutter/engine@67a7fe1...e4fac78

2024-08-23 flar@google.com Revert "Framework wide color" (flutter/engine#54728)
2024-08-23 skia-flutter-autoroll@skia.org Roll Skia from 7ac776072577 to 7d96b8516e8d (3 revisions) (flutter/engine#54731)
2024-08-23 skia-flutter-autoroll@skia.org Roll Skia from 789f5cb0b9c2 to 7ac776072577 (1 revision) (flutter/engine#54729)
2024-08-23 skia-flutter-autoroll@skia.org Roll Skia from b25553b2fb9f to 789f5cb0b9c2 (1 revision) (flutter/engine#54726)
2024-08-23 skia-flutter-autoroll@skia.org Roll Dart SDK from ca009736fb3e to f9e6abb21ac7 (1 revision) (flutter/engine#54725)
2024-08-23 bdero@google.com [Impeller] Reland 3: Implement draw order optimization. (flutter/engine#54673)
2024-08-23 skia-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from 2fOjXGNxdSoRSGCL7... to 2TaLkdJNlAIbDYccn... (flutter/engine#54721)
2024-08-23 skia-flutter-autoroll@skia.org Roll Fuchsia GN SDK from sbh76PYVTMxav4ACT... to OKGFjciA5Vd0TQks4... (flutter/engine#54722)
2024-08-22 magder@google.com Test running the macOS engine has no stray logging (flutter/engine#54716)
2024-08-22 skia-flutter-autoroll@skia.org Roll Dart SDK from 937389f7bc48 to ca009736fb3e (1 revision) (flutter/engine#54719)
2024-08-22 matanlurey@users.noreply.github.com More diagnostic clean ups (flutter/engine#54265)
2024-08-22 30870216+gaaclarke@users.noreply.github.com Framework wide color (flutter/engine#54415)
2024-08-22 skia-flutter-autoroll@skia.org Roll Skia from 10e9072dcea0 to b25553b2fb9f (2 revisions) (flutter/engine#54717)
2024-08-22 skia-flutter-autoroll@skia.org Roll Dart SDK from ce160bf13347 to 937389f7bc48 (1 revision) (flutter/engine#54715)
2024-08-22 yjbanov@google.com [web:semantics] fix double click due to long-press (flutter/engine#54697)
2024-08-22 skia-flutter-autoroll@skia.org Roll Skia from 04ce2e2bfc35 to 10e9072dcea0 (1 revision) (flutter/engine#54713)
2024-08-22 zanderso@users.noreply.github.com Pin mac host and iOS builds to arm64 builders (flutter/engine#54711)
2024-08-22 chris@bracken.jp macOS: Bundle dSYM packages in FlutterMacOS.xcframework (flutter/engine#54696)
2024-08-22 skia-flutter-autoroll@skia.org Roll Skia from 7611984dc27b to 04ce2e2bfc35 (2 revisions) (flutter/engine#54712)
2024-08-22 joel.winarske@gmail.com vulkan_glfw validation layer logging (flutter/engine#54607)
2024-08-22 skia-flutter-autoroll@skia.org Roll Skia from 4c66b7e42027 to 7611984dc27b (1 revision) (flutter/engine#54710)
2024-08-22 skia-flutter-autoroll@skia.org Roll Dart SDK from 025bf8d376d3 to ce160bf13347 (1 revision) (flutter/engine#54709)

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 jimgraham@google.com,rmistry@google.com,zra@google.com 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants