diff --git a/src/dawn/native/vulkan/QueueVk.cpp b/src/dawn/native/vulkan/QueueVk.cpp index 512a28f2cdc..63046caf82b 100644 --- a/src/dawn/native/vulkan/QueueVk.cpp +++ b/src/dawn/native/vulkan/QueueVk.cpp @@ -360,6 +360,14 @@ MaybeError Queue::SubmitPendingCommandsImpl() { }); } + // Ownership of {commandPool, commandBuffer} has transferred to the + // TrackSerialTask lambdas above. Clear them so that an error in + // OnAfterSubmit() below cannot cause WaitForIdleForDestructionImpl() to + // double-track the same VkCommandPool in mUnusedCommands (which would lead + // to a double-destroy in DestroyImpl). + mRecordingContext.commandPool = VK_NULL_HANDLE; + mRecordingContext.commandBuffer = VK_NULL_HANDLE; + for (auto texture : mRecordingContext.specialSyncTextures) { DAWN_TRY(texture->OnAfterSubmit()); }