Vulkan: Make VkEvent for Buffer work with more general usage Before this CL, BufferHelper::mCurrentWriteAccess and mCurrentReadAccess, mCurrentWriteStages, mCurrentReadStages still track all accesses, regardless if it is tracked by RfCountedEvent or via PipelineBarrier. This is okay for very limited usage case, but becomes fragile when expand the event for general usage case. The problem is that you can not correctly tell which bits in mCurrentReadAccess is for pipelineBarrier and which is for Event, since event and pipeline barrier could have the same VkAccessFlags. Similarly problem exist for mCurrentWriteAccess. The reliable way is actually track pipeline barrier access and VkEvent access completely separately. This CL changes mCurrentWriteAccess, mCurrentWriteStages, mCurrentReadAccess and mCurrentReadStage to only contain bits that not tracked by VkEvent. For this reason, RefCountedEventWithAccessFlags wrapper class is added to wrap mCurrentWriteEvent and its associated VkAccessFlags. Bug: angleproject:360274928 Change-Id: I057484f0c3baa2739d56c3a75889eb88a647a65a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6210683 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>