Hash :
d919870f
Author :
Date :
2023-09-14T16:00:07
Vulkan: Do host image copy without holding the share group lock When an application uploads texture data such as with `glTexSubImage2D`, the share group lock is being hold while the data is being copied. Without VK_EXT_host_image_copy, this is a copy to a staging buffer, which may itself be expensive. With VK_EXT_host_image_copy, the cost of the copy is higher and so the lock would be held for a longer duration. This is particularly harmful to applications that spawn a separate thread for texture uploads (as the main thread is unable to make GL calls). This change moves the actual copy call to the tail of the call after the share group lock has been released. As a result: - The upload thread may be a bit slower, but - The copy does not interfere with the main thread, and - The copy does not interfere with the GPU's rendering work. As a result, games that load content seamlessly during gameplay should experience less stutter during texture uploads. Bug: angleproject:8341 Change-Id: I818c4389d4bf828847578da89414623e4b5e844e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4864290 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>