-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Track clip coverage per-pass when not collapsing. #46597
Conversation
impeller/entity/entity_pass.cc
Outdated
|
|
||
| // Start non-collapsed subpasses with a fresh clip coverage stack limited by | ||
| // the subpass coverage. This is important because image filters applied to | ||
| // save layers may transform the subpass texture after its rendered, causing |
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.
| // save layers may transform the subpass texture after its rendered, causing | |
| // save layers may transform the subpass texture after it's rendered, causing |
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.
Done. 👍
|
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. |
|
Oh man, you ran into flutter/flutter#135511. You are going to have to change the color of your circle so the golden test passes. |
|
I double checked this against flutter/flutter#126583 and it doesn't address this that issue. That makes this the 2nd bug we've found and fixed in service of fixing that bug haha. |
|
Changed the color of the circle and added a scaling version. :) |
gaaclarke
left a comment
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.
Code and tests LGTM. I would like to see us document coordinate systems in our docstrings. I found this code frustrating to work with because I didn't know what should be accounted for where.
|
|
||
| //---------------------------------------------------------------------------- | ||
| /// @brief Get the coverage of an unfiltered subpass. | ||
| /// @brief Computes the coverage of a given subpass. This is used to |
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 you please include the coordinate space of the returned rect? I think it should be relative to it's parent subpass in pixels?
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.
Done.
I think it should be relative to it's parent subpass in pixels?
Actually, the output is in screen space. :)
After writing #46524 (comment), I also decided to do another iteration on the GetCoverage docstrings.
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.
Thank you! 🙏
|
Golden file changes are available for triage from new commit, Click here to view. |
|
|
||
| //---------------------------------------------------------------------------- | ||
| /// @brief Get the coverage of an unfiltered subpass. | ||
| /// @brief Computes the coverage of a given subpass. This is used to |
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.
Thank you! 🙏
…136082) flutter/engine@59b6b94...1bb228d 2023-10-06 [email protected] [Impeller] Track clip coverage per-pass when not collapsing. (flutter/engine#46597) 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#136082) flutter/engine@59b6b94...1bb228d 2023-10-06 [email protected] [Impeller] Track clip coverage per-pass when not collapsing. (flutter/engine#46597) 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…acks flutter#46597 creates a new clip coverage stack for each subpass. This PR updates some clip coverage operations and assertions in EntityPass::OnRender to reflect that the current clip coverage stack only contains the range of depths within the current subpass.
Resolves flutter/flutter#135916. Big credits to @gaaclarke for the repros and investigation around this. Moves back to tracking clip coverage per-pass when not collapsing. This is especially important for SaveLayers with MatrixImageFilters, which can transform the rendered layer texture and thereby move elements inside or outside of existing parent clips. This should have little to no performance impact, since we should already be generating correct minimal subpass textures based on correct subpass coverage computation. Before: <img width="679" alt="Screenshot 2023-10-05 at 1 25 29 PM" src="https://github.com/flutter/engine/assets/919017/fe63808a-6353-4969-8225-120fd5ee0949"> https://github.com/flutter/engine/assets/919017/9284f055-bee1-40cd-8b7e-f478b00d01da After: <img width="679" alt="Screenshot 2023-10-05 at 1 24 17 PM" src="https://github.com/flutter/engine/assets/919017/066b1e25-9611-4e14-a383-cc3a866dbe36"> https://github.com/flutter/engine/assets/919017/0fbd1f96-8920-472c-bb0e-4414187fc72d
Resolves flutter/flutter#135916.
Big credits to @gaaclarke for the repros and investigation around this.
Moves back to tracking clip coverage per-pass when not collapsing. This is especially important for SaveLayers with MatrixImageFilters, which can transform the rendered layer texture and thereby move elements inside or outside of existing parent clips.
This should have little to no performance impact, since we should already be generating correct minimal subpass textures based on correct subpass coverage computation.
Before:

Screen.Recording.2023-10-05.at.1.34.35.PM.mov
After:

Screen.Recording.2023-10-05.at.1.36.05.PM.mov