Commit f5f6704c1cf00faa87a8b55eec0988600a8128e6

Charlie Lao 2025-03-27T13:58:14

Vulkan: Remove mArrayBufferObserverBindings Right now VertexArray observes gl::Buffer change. Buffer change will end up with many virtual function calls on VertexArray. GL spec says that when buffer changes, only the current context's vertex array have to pick up the changes without any GL API call. All other context's vertex array must issue bind calls to pick up the buffer's state change. This CL removes VertexArray::mArrayBufferObserverBindings as gl::Buffer's observer. The Buffer's change is directly applied to current context's vertexArray (Note that gl::VertexArray still have mContentsObservers which is not touched in this CL. Once the content observer also removed, there will be no observer calls into gl::VertexArray which allows us to do further optimizations on vertex arrays.) In order to further reduce the overhead, we also tracks vertex array's binding index in the buffer. When a buffer is bound to current vertex array, the bit is set at that index and bit is removed when buffer is unbound. When vertex array becomes un-current, all bits are cleared. Since a buffer could be bound to multiple context's current vertex array, that bitmask is tracked for multiple contexts with the contextID. Bug: angleproject:400711938 Change-Id: I9ad91573e101d7bf11a742a3d823bd8965f43395 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6419663 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>