Add more profiler categories for navigation
This commit is contained in:
@@ -25,6 +25,7 @@ NavMesh::NavMesh(const SpawnParams& params)
|
||||
void NavMesh::SaveNavMesh()
|
||||
{
|
||||
#if COMPILE_WITH_ASSETS_IMPORTER
|
||||
PROFILE_MEM(NavigationMesh);
|
||||
|
||||
// Skip if scene is missing
|
||||
const auto scene = GetScene();
|
||||
@@ -111,7 +112,7 @@ void NavMesh::OnAssetLoaded(Asset* asset, void* caller)
|
||||
if (Data.Tiles.HasItems())
|
||||
return;
|
||||
ScopeLock lock(DataAsset->Locker);
|
||||
PROFILE_MEM(Navigation);
|
||||
PROFILE_MEM(NavigationMesh);
|
||||
|
||||
// Remove added tiles
|
||||
if (_navMeshActive)
|
||||
|
||||
@@ -733,7 +733,7 @@ public:
|
||||
bool Run() override
|
||||
{
|
||||
PROFILE_CPU_NAMED("BuildNavMeshTile");
|
||||
PROFILE_MEM(Navigation);
|
||||
PROFILE_MEM(NavigationBuilding);
|
||||
const auto navMesh = NavMesh.Get();
|
||||
if (!navMesh)
|
||||
return false;
|
||||
@@ -1095,6 +1095,7 @@ void BuildDirtyBounds(Scene* scene, const BoundingBox& dirtyBounds, bool rebuild
|
||||
else if (settings->AutoAddMissingNavMeshes)
|
||||
{
|
||||
// Spawn missing navmesh
|
||||
PROFILE_MEM(Navigation);
|
||||
navMesh = New<NavMesh>();
|
||||
navMesh->SetStaticFlags(StaticFlags::FullyStatic);
|
||||
navMesh->SetName(TEXT("NavMesh.") + navMeshProperties.Name);
|
||||
@@ -1156,7 +1157,7 @@ void ClearNavigation(Scene* scene)
|
||||
|
||||
void NavMeshBuilder::Update()
|
||||
{
|
||||
PROFILE_MEM(Navigation);
|
||||
PROFILE_MEM(NavigationBuilding);
|
||||
ScopeLock lock(NavBuildQueueLocker);
|
||||
|
||||
// Process nav mesh building requests and kick the tasks
|
||||
@@ -1207,7 +1208,7 @@ void NavMeshBuilder::Build(Scene* scene, float timeoutMs)
|
||||
}
|
||||
|
||||
PROFILE_CPU_NAMED("NavMeshBuilder");
|
||||
PROFILE_MEM(Navigation);
|
||||
PROFILE_MEM(NavigationBuilding);
|
||||
ScopeLock lock(NavBuildQueueLocker);
|
||||
|
||||
BuildRequest req;
|
||||
@@ -1244,7 +1245,7 @@ void NavMeshBuilder::Build(Scene* scene, const BoundingBox& dirtyBounds, float t
|
||||
}
|
||||
|
||||
PROFILE_CPU_NAMED("NavMeshBuilder");
|
||||
PROFILE_MEM(Navigation);
|
||||
PROFILE_MEM(NavigationBuilding);
|
||||
ScopeLock lock(NavBuildQueueLocker);
|
||||
|
||||
BuildRequest req;
|
||||
|
||||
@@ -326,7 +326,7 @@ void NavMeshRuntime::EnsureCapacity(int32 tilesToAddCount)
|
||||
if (newTilesCount <= capacity)
|
||||
return;
|
||||
PROFILE_CPU_NAMED("NavMeshRuntime.EnsureCapacity");
|
||||
PROFILE_MEM(Navigation);
|
||||
PROFILE_MEM(NavigationMesh);
|
||||
|
||||
// Navmesh tiles capacity growing rule
|
||||
int32 newCapacity = capacity ? capacity : 32;
|
||||
@@ -387,7 +387,7 @@ void NavMeshRuntime::AddTiles(NavMesh* navMesh)
|
||||
return;
|
||||
auto& data = navMesh->Data;
|
||||
PROFILE_CPU_NAMED("NavMeshRuntime.AddTiles");
|
||||
PROFILE_MEM(Navigation);
|
||||
PROFILE_MEM(NavigationMesh);
|
||||
ScopeLock lock(Locker);
|
||||
|
||||
// Validate data (must match navmesh) or init navmesh to match the tiles options
|
||||
@@ -419,7 +419,7 @@ void NavMeshRuntime::AddTile(NavMesh* navMesh, NavMeshTileData& tileData)
|
||||
ASSERT(navMesh);
|
||||
auto& data = navMesh->Data;
|
||||
PROFILE_CPU_NAMED("NavMeshRuntime.AddTile");
|
||||
PROFILE_MEM(Navigation);
|
||||
PROFILE_MEM(NavigationMesh);
|
||||
ScopeLock lock(Locker);
|
||||
|
||||
// Validate data (must match navmesh) or init navmesh to match the tiles options
|
||||
|
||||
@@ -180,7 +180,7 @@ NavigationService NavigationServiceInstance;
|
||||
|
||||
void* dtAllocDefault(size_t size, dtAllocHint)
|
||||
{
|
||||
PROFILE_MEM(Navigation);
|
||||
PROFILE_MEM(NavigationMesh);
|
||||
return Allocator::Allocate(size);
|
||||
}
|
||||
|
||||
|
||||
@@ -260,6 +260,8 @@ void InitProfilerMemory(const Char* cmdLine, int32 stage)
|
||||
INIT_PARENT(Content, ContentFiles);
|
||||
INIT_PARENT(Level, LevelFoliage);
|
||||
INIT_PARENT(Level, LevelTerrain);
|
||||
INIT_PARENT(Navigation, NavigationMesh);
|
||||
INIT_PARENT(Navigation, NavigationBuilding);
|
||||
INIT_PARENT(Scripting, ScriptingVisual);
|
||||
INIT_PARENT(Scripting, ScriptingCSharp);
|
||||
INIT_PARENT(ScriptingCSharp, ScriptingCSharpGCCommitted);
|
||||
|
||||
@@ -105,6 +105,10 @@ public:
|
||||
|
||||
// Total navigation system memory.
|
||||
Navigation,
|
||||
// Navigation mesh memory.
|
||||
NavigationMesh,
|
||||
// Navigation mesh builder memory.
|
||||
NavigationBuilding,
|
||||
|
||||
// Total networking system memory.
|
||||
Networking,
|
||||
|
||||
Reference in New Issue
Block a user