mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 05:38:31 +09:00
[Optimization] (MG_State/BufferState, VertexArrayState): optimize performance on vao deletion
This commit is contained in:
@@ -60,8 +60,12 @@ namespace MobileGL {
|
||||
void GLContext::MarkBufferObjectForDeletion(Uint index) {
|
||||
if (ValidateBufferObject(index)) {
|
||||
auto bufferObject = m_bufferState.GetBufferObject(index);
|
||||
for (SizeT i = 0; i < m_vertexArrayState.GetAllVertexArrays().size(); ++i) {
|
||||
auto vao = m_vertexArrayState.GetAllVertexArrays()[i];
|
||||
auto& vaos = m_vertexArrayState.GetAllVertexArrays();
|
||||
for (SizeT i = 0; i < vaos.size(); ++i) {
|
||||
auto vao = vaos[i];
|
||||
if (vao == nullptr)
|
||||
continue;
|
||||
|
||||
if (vao->GetIndexBufferBindingSlot().GetBoundObject() == bufferObject) {
|
||||
vao->GetIndexBufferBindingSlot().Bind(nullptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user