Commit f231d94b280fc9117b8610fbefecf66cc3593155

Charlie Lao 2025-01-13T14:58:16

Vulkan: Add kBufferMemoryBarrierData to mirror image Right now we only maintain a mapping from EventStage (which is a value of VkPipelineStageFlags) to VkPipelineStageFlags for images. For next CL we need to indicate if use VkEvent is preferred or not for a given PipelineStage access. This CL expands kPipelineStageFlagBitMap (and renamed to kBufferMemoryBarrierData) to contain both the VkPipelineStages and EventStage to indicate if VkEvent should be used or not, similar to kImageMemoryBarrierData but a lot simpler. Right now it all set to EventStage::InvalidEnum which means will use pipelineBarrier. This will change in next CL. This CL also does some clean up: A few BufferHelper related functions changed argument from ErrorContext* to Context*, mainly because of BufferHelper::release() now takes Context* as argument so that we can recycle events within context's share group without lock. ImageLayoutToMemoryBarrierDataMap is added to replace angle::PackedEnumMap<ImageLayout, ImageMemoryBarrierData> kEventStageAndPipelineStageFlagsMap is removed. InitializeEventAndPipelineStagesMap is now using kImageMemoryBarrierData directly to construct mEventStageToPipelineStageFlagsMap. As result of this, EventAndPipelineBarrierHaveMatchingStageFlags is also removed since InitializeEventStageToVkPipelineStageFlagsMap already ensures this. Bug: angleproject:360274928 Change-Id: Idb74f3e4120ca9a04b8eccb7ed034aa769024bf9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6172763 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>