-
Notifications
You must be signed in to change notification settings - Fork 6k
Faster vulkan buffer tracking #56099
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. |
| if (!object) { | ||
| return; | ||
| } | ||
| tracked_objects_.insert(std::move(object)); |
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 was copying the shared_ptr, we would have had to use emplace. Also it was hashing, which we don't even need. The only people recalling this were tests that don't seem to exist. Duplicate entries are fine.
|
|
||
| void TrackedObjectsVK::Track(std::shared_ptr<const DeviceBuffer> buffer) { | ||
| if (!buffer) { | ||
| if (!buffer || (!tracked_buffers_.empty() && |
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.
Ah so always check if this was the last buffer to avoid endless increases? smart.
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.
Yea, in some of the unit tests I've seen this drop the number of buffers from 45 to 1. It isn't a logical error to have multiple entries but hopefully there isn't the pathological case of repeatedly adding (1,2,1,2,1,2,1,2,...)
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.
no, i think in reality all buffers will either be the same or change over once. So either 1, 1, 1, 1, 1 or 1, 1, 1, 2, 2, 2
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!
|
auto label is removed for flutter/engine/56099, due to - The status or check suite Linux mac_android_aot_engine has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…157613) flutter/engine@38e9be1...eb867e0 2024-10-25 [email protected] Faster vulkan buffer tracking (flutter/engine#56099) 2024-10-25 [email protected] [Impeller] Reland: hash less stuff per frame. (flutter/engine#55742) 2024-10-25 [email protected] Roll Skia from cc75472dedc2 to da6c17329e0b (3 revisions) (flutter/engine#56132) 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
issue: flutter#157538 This removes multiple instances of copying std::shared_ptr and hashing. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I signed the [CLA]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style [testing the engine]: https://github.com/flutter/flutter/wiki/Testing-the-engine [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
issue: flutter/flutter#157538
This removes multiple instances of copying std::shared_ptr and hashing.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.