[CP-beta][Impeller] Wait for the Vulkan device to become idle before destroying Vulkan objects in the AHBSwapchainImplVK destructor#188519
Conversation
…g Vulkan objects in the AHBSwapchainImplVK destructor (flutter#187477) AHBSwapchainImplVK holds Vulkan objects such as fences that may be used by operations submitted to the Vulkan device. The AHBSwapchainImplVK destructor must wait until the device is no longer using these objects before destroying them. Fixes flutter#187237
|
@jason-simmons please fill out the PR description above, afterwards the release team will review this request. |
|
This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter. Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed. |
There was a problem hiding this comment.
Code Review
This pull request ensures that the Vulkan device is idle before destroying objects by calling a new WaitIdle method in the destructor of AHBSwapchainImplVK, and adds a corresponding unit test. The review feedback recommends logging vkDeviceWaitIdle failures as ERROR instead of INFO to properly reflect the severity of the failure according to the Google C++ Style Guide.
|
We cut the new beta branch, 3.46 yesterday - closing this cherry pick. Will re-open against 3.46 |
Issue Link:
#187237
Impact Description:
This can cause a crash on Impeller/Vulkan during app lifecycle events (shutdown/rotation/etc.) when using HCPP/AHBSwapchain.
Changelog Description:
[flutter/187237] Fixes a crash that can happen during app shutdown or rotation on some Android devices using Impeller/Vulkan with HCPP.
Workaround:
Disable Impeller or use the Impeller GLES back end
Risk:
What is the risk level of this cherry-pick?
Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
Run the
AndroidAHBSwapchainTest.AHBSwapchainDtorCallsWaitIdleunit test. Or try reproducing the crash in the #187237 example app and verifying that it is fixed.