mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
In the Vulkan backend, the CommandPoolRecyclerVK stores command pools that can be reused while rendering a frame. For each frame, SurfaceContextVK::AcquireNextSurface calls CommandPoolRecyclerVK::Dispose to clear the cached pools. However, the CommandPoolRecyclerVK's cache of pools is placed in thread-local storage. So command pools used on the IO thread will not be cleaned up if frame rendering calls Dispose on the raster thread. This PR adds a Context API that the IO thread can call after using a command pool in order to ensure that cached resources are disposed. Fixes https://github.com/flutter/flutter/issues/155519