Commit a1b829dd96394ec15dc7c2bcaa5857d394f68812

Tim Van Patten 2021-09-22T18:29:08

Vulkan: Retain src buffer in acquireAndUpdate() It's possible for acquireBufferHelper() to garbage collect the original (src) buffer before copyFromBuffer() has a chance to retain it, so it must be retained before then. Previously, we were relying on the retain calls in copyFromBuffer() to be sufficient. However, there is a race condition when the asynchronous CommandProcessor is enabled, since the garbage could be freed before copyFromBuffer() has a chance to retain the buffer (and allow destroyIfComplete() to skip destroying the object). For the full context, see the comment chain here: https://chromium-review.googlesource.com/c/angle/angle/+/3146319/16..24/src/libANGLE/renderer/vulkan/BufferVk.cpp#b833 Bug: angleproject:5971 Change-Id: I7c812069343fdad948189d696bfebab8da68c1a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3179866 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>