Add more profiler events to assets code

This commit is contained in:
2026-06-02 13:24:10 +02:00
parent ff526ecafb
commit a12c5e2203
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -272,6 +272,7 @@ String Asset::ToString() const
void Asset::OnDeleteObject()
{
PROFILE_CPU_NAMED("Asset.Unload");
ASSERT(IsInMainThread());
// Send event to the gameplay so it can release handle to this asset
+3
View File
@@ -7,6 +7,7 @@
#include "Engine/Core/Log.h"
#include "Engine/Level/Prefabs/PrefabManager.h"
#include "Engine/Level/Actor.h"
#include "Engine/Profiler/ProfilerCPU.h"
#include "Engine/Threading/Threading.h"
#include "Engine/Scripting/Scripting.h"
@@ -22,6 +23,7 @@ Prefab::Prefab(const SpawnParams& params, const AssetInfo* info)
Guid Prefab::GetRootObjectId() const
{
PROFILE_CPU();
ASSERT(IsLoaded());
ScopeLock lock(Locker);
@@ -57,6 +59,7 @@ Actor* Prefab::GetDefaultInstance()
// Skip if already created (reuse cached result)
if (_defaultInstance)
return _defaultInstance;
PROFILE_CPU();
// Skip if not loaded
if (!IsLoaded())