[Perf] (MG_State, MG_Backend/DirectGLES): skip never-touched buffer bind points via high-water mark; SyncNeccessaryBuffers 15.7% -> 4.2%

This commit is contained in:
2026-07-12 04:31:34 -04:00
parent 527e229ac8
commit 340449b77e
5 changed files with 29 additions and 1 deletions
@@ -201,7 +201,9 @@ namespace MobileGL::MG_Backend::DirectGLES {
#ifdef TRACY_ENABLE
ZoneScopedC(TRACY_ZONECOLOR_BACKEND);
#endif
auto bindingPointCnt = MG_State::pGLContext->GetBufferBindingPointCount(target);
// Only sync up to the high-water mark of app-touched points; the fixed array is 36
// deep but apps bind a handful, so the never-touched tail is already at GL default 0.
auto bindingPointCnt = MG_State::pGLContext->GetTouchedBufferBindingPointCount(target);
for (SizeT i = 0; i < bindingPointCnt; ++i) {
auto& point = MG_State::pGLContext->GetBufferBindingPoint(target, i);
auto& obj = point.GetBoundObject();