[Perf] (MG_Backend/DirectGLES): Skip IBO binding for VA when not dirty.

This commit is contained in:
BZLZHH
2026-02-03 01:52:24 +08:00
parent 863aa77ff0
commit 8e897d54a2
2 changed files with 13 additions and 8 deletions
@@ -283,6 +283,8 @@ namespace MobileGL::MG_Backend::DirectGLES {
}
}
Uint16 currentIndexBufferVersion = stateVAOObject->GetIndexBufferBindingSlot().GetVersion();
if (currentIndexBufferVersion != m_syncedIndexBufferVersion) {
const auto& indexBufferBinding = stateVAOObject->GetIndexBufferBindingSlot().GetBoundObject();
if (indexBufferBinding) {
const auto& backendBufferIt = BufferImpl::g_backendBufferObjects.find(indexBufferBinding);
@@ -293,6 +295,8 @@ namespace MobileGL::MG_Backend::DirectGLES {
MGLOG_W("No backend buffer found for index buffer binding, cannot bind index buffer.");
}
}
m_syncedIndexBufferVersion = currentIndexBufferVersion;
}
m_syncedAttributeVersions = allAttributeVersions;
}
@@ -53,6 +53,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
Uint m_backendVAOId = 0;
Bool m_isInitialized = false;
Uint16 m_syncedIndexBufferVersion = 0;
Array<MG_State::GLState::VertexAttributeVersion, MG_State::GLState::VertexArrayObject::MAX_VERTEX_ATTRIBS>
m_syncedAttributeVersions;
};