[Impeller] temp work around for cmd pool validation issues. (flutter/engine#46131)

I'm not able to reproduce most validation errors in the macrobenchmark app with this change. THe real fix seems to be to track this last cmd buffer but I'm struggling to find a way to do this.
This commit is contained in:
Jonah Williams
2023-09-20 20:48:47 -07:00
committed by GitHub
parent ec1d57db35
commit 98d9a51a31
2 changed files with 7 additions and 1 deletions

View File

@@ -80,7 +80,6 @@ std::unique_ptr<Surface> SurfaceContextVK::AcquireNextSurface() {
if (auto allocator = parent_->GetResourceAllocator()) {
allocator->DidAcquireSurfaceFrame();
}
parent_->GetCommandPoolRecycler()->Dispose();
return surface;
}

View File

@@ -424,6 +424,13 @@ bool SwapchainImplVK::Present(const std::shared_ptr<SwapchainImageVK>& image,
//----------------------------------------------------------------------------
/// Transition the image to color-attachment-optimal.
///
// Increment the frame count right before allocating the cmd buffer below to
// force this to use the next frame's pool. This cmd buffer is completely
// untracked, and so we may end up resetting the cmd pool before all buffers
// have been collected.
context.GetCommandPoolRecycler()->Dispose();
sync->final_cmd_buffer = context.CreateCommandBuffer();
if (!sync->final_cmd_buffer) {
return false;