-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Provide the clear color to an advanced blend if it was optimized out #48646
[Impeller] Provide the clear color to an advanced blend if it was optimized out #48646
Conversation
impeller/entity/entity_pass.cc
Outdated
| // for blending (otherwise the blend pass will end up executing before | ||
| // all the previous commands in the active pass). | ||
|
|
||
| // If all previous elements were skipped due to clear color optimization |
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.
If we applied the clear color, that means we have a single color/rectangle as a dst input. Rather than rendering the element and allocating the render target to do this, we could instead create a 1x1 host uploaded texture with the color already set - that would be much faster.
The ColorFilterContents::MakeBlend also has the option of specifying a "foreground" color, which I believe applies to the destination - the same place you'd use this texture. If this works all you need to do is conditionally pass the clear color instead of another texture which should be much simpler.
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.
Changed this to pass the clear color as the foreground color for ColorFilterContents::MakeBlend
|
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. |
10cd24a to
80a01d8
Compare
jonahwilliams
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.
LGTM!
|
It looks like the clear color optimization is applying to AdvancedBlendCoverageHintIsNotResetByEntityPass, so to fix that test you'd likely need to modify the drawing commands so at least one entity was drawn. |
80a01d8 to
988117f
Compare
|
Golden file changes are available for triage from new commit, Click here to view. |
…imized out If all previous elements were skipped due to clear color optimization, then the clear color must be provided as the foreground to the advanced blend if framebuffer fetch is not available.
988117f to
939a6a4
Compare
|
Golden file changes are available for triage from new commit, Click here to view. |
…it was optimized out (flutter/engine#48646)
…it was optimized out (flutter/engine#48646)
…it was optimized out (flutter/engine#48646)
…it was optimized out (flutter/engine#48646)
…it was optimized out (flutter/engine#48646)
…it was optimized out (flutter/engine#48646)
…it was optimized out (flutter/engine#48646)
…it was optimized out (flutter/engine#48646)
…139716) flutter/engine@347f506...82de334 2023-12-07 [email protected] Revert "Replace use of Fontmgr::RefDefault with explicit creation calls" (flutter/engine#48755) 2023-12-07 [email protected] Roll Skia from 2abb01e18ab3 to 8ebf43ba1c09 (1 revision) (flutter/engine#48761) 2023-12-07 [email protected] Roll Dart SDK from dbfe4e3f867e to be8a95b6717d (1 revision) (flutter/engine#48757) 2023-12-06 [email protected] Remove obsolete properties. (flutter/engine#48753) 2023-12-06 [email protected] Roll Skia from 7ff0103760d0 to 2abb01e18ab3 (1 revision) (flutter/engine#48751) 2023-12-06 [email protected] Roll Skia from 570103e08087 to 7ff0103760d0 (1 revision) (flutter/engine#48748) 2023-12-06 [email protected] Roll Skia from 326bdc97ac40 to 570103e08087 (1 revision) (flutter/engine#48746) 2023-12-06 [email protected] Roll Dart SDK from 6eb13603c212 to dbfe4e3f867e (1 revision) (flutter/engine#48745) 2023-12-06 [email protected] [Impeller] Store Buffer/Texture bindings in vector instead of map. (flutter/engine#48719) 2023-12-06 [email protected] Roll Skia from 33cba437bf70 to 326bdc97ac40 (2 revisions) (flutter/engine#48743) 2023-12-06 [email protected] [Impeller] Provide the clear color to an advanced blend if it was optimized out (flutter/engine#48646) 2023-12-06 [email protected] [Windows] Set swap interval on raster thread after startup (flutter/engine#47787) 2023-12-06 [email protected] Roll Skia from 384d14063dc1 to 33cba437bf70 (3 revisions) (flutter/engine#48740) 2023-12-06 [email protected] [Windows] Refactor the GLES proc table (flutter/engine#48688) 2023-12-06 [email protected] Replace use of Fontmgr::RefDefault with explicit creation calls (flutter/engine#48571) 2023-12-06 [email protected] [Impeller] disable entity culling by default. (flutter/engine#48717) 2023-12-06 [email protected] Roll Skia from 23e1cb20a6b5 to 384d14063dc1 (1 revision) (flutter/engine#48738) 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
If all previous elements were skipped due to clear color optimization, then the clear color must be rendered as an input to the advanced blend if framebuffer fetch is not available.