From b556ec313491ef18a33495fad3f319d869ec493c Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Wed, 7 Oct 2026 10:50:37 -0400 Subject: [PATCH] [Perf] (Espryt): a clean framebuffer attachment skips its per-draw resync behind the unit list's gate (rd12 monolith 74.5 -> 77.0 fps). --- MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp index bf9842ba..9f5c894c 100644 --- a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp +++ b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp @@ -2325,6 +2325,14 @@ namespace MobileGL::MG_Backend::DirectGLES { Vector& list, Bool listValid) { if (listValid) { for (const auto& entry : list) { + // P14: the unit list's aggregate clean gate first (SyncNeccessaryTextures): an + // attachment whose storage, parameters and sampler are already the driver's + // costs two record reads instead of three nested syncs and their SharedPtr + // traffic. Same borrow rule as there - the list's key proves the twin alive. + const auto* record = PipeTextureRecordForHandle(entry.Res); + if (record != nullptr && entry.backend != nullptr && + entry.backend->IsDrawSyncCleanByRecord(entry.Res, *record)) + continue; TextureImpl::SyncTextureToBackendByHandle(entry.Res, /*imageBindableStorageRequired=*/false); } return;