Commit d3aaf79525e37abe4fb8a2203c8c56bcc539f540

Charlie Lao 2024-04-05T15:57:38

Vulkan: Early out ImageHelper::updateLayoutAndBarrier when possible If one image is attached to more than one attach points, when render pass closes we end up calling ImageHelper::updateLayoutAndBarrier multiple times. The first one is required since it does the layout transition etc. But the second call is unnecessarily inserting memory barriers. This is optimization itself, but will also fix the other bigger problem when we start using VkEvent instead of PipelineBarrier: we may end up waiting for an event that has not been set (since setEvent gets called after we end render pass but waitEvent is before render pass. Calling this sequence twice on the same image for the same render pass means second waitEvent is called before setEvent). Bug: b/333391804 Change-Id: Ic7b409c71806e63cb56c25e10b0bd0bfc9f6086d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5431033 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>