Add **Assets profiler** to Editor

This commit is contained in:
Wojciech Figat
2022-12-09 15:46:01 +01:00
parent e5742772ae
commit ed700cb070
6 changed files with 326 additions and 4 deletions

View File

@@ -313,6 +313,17 @@ bool Asset::ShouldDeleteFileOnUnload() const
#endif
uint64 Asset::GetMemoryUsage() const
{
uint64 result = sizeof(Asset);
Locker.Lock();
if (_loadingTask)
result += sizeof(ContentLoadTask);
result += (OnLoaded.Capacity() + OnReloading.Capacity() + OnUnloaded.Capacity()) * sizeof(EventType::FunctionType);
Locker.Unlock();
return result;
}
void Asset::Reload()
{
// Virtual assets are memory-only so reloading them makes no sense