diff --git a/Source/Engine/Navigation/NavMesh.cpp b/Source/Engine/Navigation/NavMesh.cpp index 5593d732a..5932607a0 100644 --- a/Source/Engine/Navigation/NavMesh.cpp +++ b/Source/Engine/Navigation/NavMesh.cpp @@ -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) diff --git a/Source/Engine/Navigation/NavMeshBuilder.cpp b/Source/Engine/Navigation/NavMeshBuilder.cpp index e92173846..1f43b7fda 100644 --- a/Source/Engine/Navigation/NavMeshBuilder.cpp +++ b/Source/Engine/Navigation/NavMeshBuilder.cpp @@ -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->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; diff --git a/Source/Engine/Navigation/NavMeshRuntime.cpp b/Source/Engine/Navigation/NavMeshRuntime.cpp index 2758077c6..911700e19 100644 --- a/Source/Engine/Navigation/NavMeshRuntime.cpp +++ b/Source/Engine/Navigation/NavMeshRuntime.cpp @@ -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 diff --git a/Source/Engine/Navigation/Navigation.cpp b/Source/Engine/Navigation/Navigation.cpp index 34983652f..06413ea7f 100644 --- a/Source/Engine/Navigation/Navigation.cpp +++ b/Source/Engine/Navigation/Navigation.cpp @@ -180,7 +180,7 @@ NavigationService NavigationServiceInstance; void* dtAllocDefault(size_t size, dtAllocHint) { - PROFILE_MEM(Navigation); + PROFILE_MEM(NavigationMesh); return Allocator::Allocate(size); } diff --git a/Source/Engine/Profiler/ProfilerMemory.cpp b/Source/Engine/Profiler/ProfilerMemory.cpp index c936ff5b2..794a208b0 100644 --- a/Source/Engine/Profiler/ProfilerMemory.cpp +++ b/Source/Engine/Profiler/ProfilerMemory.cpp @@ -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); diff --git a/Source/Engine/Profiler/ProfilerMemory.h b/Source/Engine/Profiler/ProfilerMemory.h index 5dddb912b..1b9139b9a 100644 --- a/Source/Engine/Profiler/ProfilerMemory.h +++ b/Source/Engine/Profiler/ProfilerMemory.h @@ -105,6 +105,10 @@ public: // Total navigation system memory. Navigation, + // Navigation mesh memory. + NavigationMesh, + // Navigation mesh builder memory. + NavigationBuilding, // Total networking system memory. Networking,