Vulkan: Add VkCmdWaitEvents for image barriers This CL add EventBarrierArray (sister class of PipelineBarrierArray) that accumulates the event barriers instead of pipeline barriers. ImageHelper::barrierImpl and ImageHelper::updateLayoutAndBarrier has been updated to have a code path that inserts waiting event to EventBarrierArray. PipelineBarrier code path is still kept and is also used when event is invalid or under certain situation as a fallback method from waitEvent. After we generate barrier (regardless it is pipelineBarrier or eventBarrier, we always release ImageHelper::mCurrentEvent. When next barrier/layout call is made, if we see mCurrentEvent is invalid, we always fallback to pipelineBarrier. This way it is safe that if somehow we did not (intentionally or accidentally) insert a new event between two barrier calls, we will not end up with second barrier call wait for old event which creates synchronization hazard. With this approach, second barrier will use pipelineBarrier which is still safe. In this CL the useVkEventForImageBarrier feature flag is still disabled, so no events are created and thus pipelineBarrier is still used. Bug: b/336844257 Change-Id: Idaf5a7200b85f901eae5d376543f189d21522022 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5263701 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>