-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] exploit perfect hash for SamplerDescriptor. #57036
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
jason-simmons
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.
The crash is happening because the std::unique_ptr instances in the samplers_ vector will be invalidated if the vector is enlarged and its buffer is reallocated.
The TextureAndSampler struct used by the render pass is holding a std::unique_ptr<Sampler>* to a unique_ptr that may become invalidated.
TextureAndSampler should instead hold the Sampler* raw pointer.
impeller/core/sampler_descriptor.h
Outdated
| width_address_mode == o.width_address_mode && | ||
| height_address_mode == o.height_address_mode && | ||
| depth_address_mode == o.depth_address_mode; | ||
| static uint32_t ToKey(const SamplerDescriptor& d) { |
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.
This should return a uint64_t
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
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.
Updated this to use the raw_ptr wrapper type
…160220) flutter/engine@9b51e30...5eedfef 2024-12-13 [email protected] Normalize round rect bounds when coming from Flutter (flutter/engine#57171) 2024-12-13 [email protected] [ios]enable the webview non tappable workaround by checking subviews recursively (flutter/engine#57168) 2024-12-12 [email protected] removed c style casts and enabled the lint (flutter/engine#57162) 2024-12-12 [email protected] [Impeller] exploit perfect hash for SamplerDescriptor. (flutter/engine#57036) 2024-12-12 [email protected] Reenabled labelling test with a capabilities check. (flutter/engine#57160) 2024-12-12 [email protected] [Impeller] dont print format strings for blend filter and snapshots. (flutter/engine#57105) 2024-12-12 [email protected] Make fl_engine_send_key_event into a standard async function. (flutter/engine#57112) 2024-12-12 [email protected] Roll Fuchsia Linux SDK from HJ57Y3zxqDamI8qkY... to iWMEbVYaNdH8RJmXZ... (flutter/engine#57163) 2024-12-12 [email protected] Migrate FlPlatformChannel tests to FlMockBinaryMessenger (flutter/engine#57140) 2024-12-12 [email protected] Migrate FlBasicMessageChannel tests to FlMockBinaryMessenger (flutter/engine#57115) 2024-12-12 [email protected] Migrate layers and layer_tree to DisplayList/Impeller geometry classes (flutter/engine#57153) 2024-12-12 [email protected] [web] Use CanvasKit to run tests under engine/ (flutter/engine#54786) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from HJ57Y3zxqDam to iWMEbVYaNdH8 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] 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
…e#57036) There are only 3 or 4 sampler's active at any given time in a flutter app. rather than store them in a hashmap, just use a vector.
There are only 3 or 4 sampler's active at any given time in a flutter app. rather than store them in a hashmap, just use a vector.