-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Discard invalid command buffer handles after destroying a command pool #44194
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). 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. |
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.
LGTM, any idea how we could test this?
| // When the command pool is destroyed, all of its command buffers are freed. | ||
| // Handles allocated from that pool are now invalid and must be discarded. | ||
| for (vk::UniqueCommandBuffer& buffer : buffers_to_collect_) { | ||
| buffer.release(); |
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.
But the handle to the buffer will still be leaked right? Unless this is a reset.
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.
Earlier this function calls graphics_pool_.reset(), which destroys the Vulkan command pool and frees all of the pool's buffers.
After that the buffer handle is invalid, and the Vulkan validation layers will warn about a call to vkFreeCommandBuffers using the handle.
|
@jason-simmons @chinmaygarde I see that @gaaclarke had a question about testing on this PR that went unanswered, so I'll go ahead and echo that. IIRC we there's a test harness for Vulkan we can use for stuff like this, right? |
|
@gaaclarke had created a framework for mocking a |
|
My bad. We were going through this in triage and missed the call. I am not sure how to test this though TBH. We'd need to mock out Vulkan entrypoints. |
|
I think Another option would be to hook into |
That's what |
…troying a command pool (flutter/engine#44194)
…131902) flutter/engine@0c1de9b...4c62dd8 2023-08-03 [email protected] [Impeller] Run clangd tidy, opting out in 2 cases. (flutter/engine#44351) 2023-08-03 [email protected] Reland "[web] Update text editing test skips" (flutter/engine#37655) 2023-08-03 [email protected] [Impeller] Discard invalid command buffer handles after destroying a command pool (flutter/engine#44194) 2023-08-03 [email protected] Roll Skia from bae32428c1c7 to 3b3c1a617544 (1 revision) (flutter/engine#44345) 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
Fixes flutter/flutter#131522