This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[Impeller] Compute ContextContentOptions key via bit manipulating (instead of hashing each property).#48902
Merged
auto-submit[bot] merged 6 commits intoflutter:mainfrom Dec 13, 2023
Merged
Conversation
added 2 commits
December 11, 2023 19:53
gaaclarke
reviewed
Dec 12, 2023
Member
gaaclarke
left a comment
There was a problem hiding this comment.
Nice find. We should change the bool conversions and add static_asserts to be safe.
| static_cast<uint64_t>(o.primitive_type) << 24 | // | ||
| static_cast<uint64_t>(o.color_attachment_pixel_format) << 16 | // | ||
| // bools | ||
| static_cast<uint64_t>(o.has_stencil_attachment) << 2 | |
Member
There was a problem hiding this comment.
This approach for the bools is correct.
Suggested change
| static_cast<uint64_t>(o.has_stencil_attachment) << 2 | | |
| (o.has_stencil_attachment ? 1 : 0) << 2 |
| o.primitive_type, o.color_attachment_pixel_format, | ||
| o.has_stencil_attachment, o.wireframe, o.is_for_rrect_blur_clear); | ||
| constexpr uint64_t operator()(const ContentContextOptions& o) const { | ||
| return static_cast<uint64_t>(o.sample_count) << 56 | // |
Member
There was a problem hiding this comment.
nit: I think this would be a bit easier to read if you count up instead of down.
| o.primitive_type, o.color_attachment_pixel_format, | ||
| o.has_stencil_attachment, o.wireframe, o.is_for_rrect_blur_clear); | ||
| constexpr uint64_t operator()(const ContentContextOptions& o) const { | ||
| return static_cast<uint64_t>(o.sample_count) << 56 | // |
Member
There was a problem hiding this comment.
All of this is predicated on those fields being 8bits so you should add static_asserts here.
Member
|
Otherwise LGTM (fyi I'm OOO today so might have to approve tomorrow) |
gaaclarke
approved these changes
Dec 13, 2023
| static_assert(sizeof(o.primitive_type) == 1); | ||
| static_assert(sizeof(o.color_attachment_pixel_format) == 1); | ||
|
|
||
| return static_cast<uint64_t>(o.is_for_rrect_blur_clear ? 1u : 0u) << 0 | |
Member
There was a problem hiding this comment.
fyi you can get rid of these static casts if you use uint64_t literals. I think its 1llu? something like that.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Dec 13, 2023
…ting (instead of hashing each property). (flutter/engine#48902)
zanderso
pushed a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Dec 13, 2023
…ting (instead of hashing each property). (flutter/engine#48902)
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Dec 13, 2023
flutter/engine@fc32677...9f7004e 2023-12-13 [email protected] [Impeller] Made the new blur work on devices without the decal address mode (flutter/engine#48899) 2023-12-13 [email protected] Allow tests to run on macOS 13 (flutter/engine#48894) 2023-12-13 [email protected] [Impeller] Compute ContextContentOptions key via bit manipulating (instead of hashing each property). (flutter/engine#48902) 2023-12-13 [email protected] Roll Skia from f3401c6186c1 to 69c02c9d56b2 (1 revision) (flutter/engine#48992) 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The hash function we use for pipeline hashncash is actually pretty slow. Since all of the properties we hash on fit in 64 bits, we can compute a hash value directly. From local benchmarking this is about twice as fast, which still leaves quite a bit of room for future improvement (faster hashmap? not using a hashmap at all?)