Optimize Global Surface Atlas defragmenting to just reset tiles, not whole objects list

This commit is contained in:
Wojtek Figat
2024-06-21 23:01:32 +02:00
parent 4d0d08f245
commit 3b3cd5ade4

View File

@@ -268,7 +268,14 @@ public:
(float)AtlasPixelsUsed / AtlasPixelsTotal < maxUsageToDefrag)
{
PROFILE_CPU_NAMED("Defragment Atlas");
ClearObjects();
LastFrameAtlasDefragmentation = Engine::FrameCount;
for (auto& e : Objects)
{
auto& object = e.Value;
Platform::MemoryClear(object.Tiles, sizeof(object.Tiles));
}
Atlas.Clear();
AtlasPixelsUsed = 0;
}
}