Add **Assets profiler** to Editor
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -128,14 +128,17 @@ public:
|
||||
}
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether this asset was marked to be deleted on unload.
|
||||
/// </summary>
|
||||
API_PROPERTY() bool ShouldDeleteFileOnUnload() const;
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Gets amount of CPU memory used by this resource (in bytes). It's a rough estimation. Memory may be fragmented, compressed or sub-allocated so the actual memory pressure from this resource may vary.
|
||||
/// </summary>
|
||||
API_PROPERTY() virtual uint64 GetMemoryUsage() const;
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
/// Reloads the asset.
|
||||
@@ -160,7 +163,6 @@ public:
|
||||
virtual void CancelStreaming();
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
/// <summary>
|
||||
/// Gets the asset references. Supported only in Editor.
|
||||
/// </summary>
|
||||
@@ -184,7 +186,6 @@ public:
|
||||
/// </remarks>
|
||||
/// <returns>The collection of the asset ids referenced by this asset.</returns>
|
||||
API_FUNCTION() Array<Guid, HeapAllocation> GetReferences() const;
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user