mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 12:48:32 +09:00
Each sampled texture was resolved ~3x per draw: SetupDraw's layout-probe loop, its post-transition loop, and again inside ResolveSamplerDescriptor. No GL texture mutation happens mid-SetupDraw, and layout is tracked on the TextureResource independently of SyncTexture, so the repeat SyncTexture work (mip-completeness / resource+view resync / dirty scan) is pure redundancy. Add a per-draw memo in VkTextureManager (BeginDrawSyncScope/EndDrawSyncScope + RAII DrawSyncScope guard around SetupDraw): after the first successful sync of a texture in a draw, repeat SyncTextureAndGetDescriptor calls short-circuit to the already-synced resource. Device-verified on Adreno 830 (MC 26.3-snapshot3, Magma): rendering correct, no validation errors; wall-clock profile of the render thread shows SyncTextureAndGetDescriptor dropping from 15.2% to ~5% and SetupDraw from 43.7% to 28.9%. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>