Add more memory profiling insights and groups

This commit is contained in:
Wojtek Figat
2025-05-28 04:03:44 +02:00
parent 72ee80242d
commit ab61ed5a37
16 changed files with 89 additions and 22 deletions

View File

@@ -7,12 +7,14 @@
#include "Engine/Level/Level.h"
#include "Engine/Level/Scene/Scene.h"
#include "Engine/Profiler/ProfilerCPU.h"
#include "Engine/Profiler/ProfilerMemory.h"
#include "Engine/Threading/Threading.h"
#include <ThirdParty/recastnavigation/DetourCrowd.h>
NavCrowd::NavCrowd(const SpawnParams& params)
: ScriptingObject(params)
{
PROFILE_MEM(Navigation);
_crowd = dtAllocCrowd();
}
@@ -51,6 +53,7 @@ bool NavCrowd::Init(float maxAgentRadius, int32 maxAgents, NavMeshRuntime* navMe
if (!_crowd || !navMesh)
return true;
PROFILE_CPU();
PROFILE_MEM(Navigation);
// This can happen on game start when no navmesh is loaded yet (eg. navmesh tiles data is during streaming) so wait for navmesh
if (navMesh->GetNavMesh() == nullptr)
@@ -175,6 +178,7 @@ void NavCrowd::RemoveAgent(int32 id)
void NavCrowd::Update(float dt)
{
PROFILE_CPU();
PROFILE_MEM(Navigation);
_crowd->update(Math::Max(dt, ZeroTolerance), nullptr);
}