Commit 9d93491267b5fb6c2ea95efa3335979333e87587

Charlie Lao 2025-01-09T11:31:42

Vulkan: Use VkEvent to track transform feedback buffer write This CL adds event tracking into BufferHelper class: mCurrentWriteEvent is used to track the write event and mCurrentReadEvents is used to track all different reads from the buffer. Since you can have multiple different reads accumulate over time, read events are an array of EventStage and the actual VkAccessFlags per event is tracked in mCurrentReadEventsAccessFlags. Note that this is specifically designed to allow pipelineBarrier and eventBarrier to co-exist. If mCurrentReadStages contains more bits than mCurrentReadEvents, the remaining bits will be using pipelineBarrier. Similarly if mCurrentWriteStages contains more bits than mCurrentWriteEvent, the remaining bits will be using pipelineBarrier. A heuristic tracking is also added to track the buffer writes over a period of time. Right now we will opt buffer into VkEvent if the buffer ever written by transform feedback in the heuristic tracking window. This could be expanded in future if we found more usage pattern that would be benefit from using VkEvent. Also note that DrawIndirect and VertexInput will be using the same VkEvent to track. It still will be using different VkAccessFlags since the access flags comes from buffer instead of event. Bug: angleproject:360274928 Change-Id: I027ffed8a0fbff7f280f42cf70564b8a3f243d69 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6085490 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>