Add memory profiling events to the main areas of the engine

This commit is contained in:
Wojtek Figat
2025-05-22 04:47:01 +02:00
parent 32bc73610f
commit c639a3103c
101 changed files with 502 additions and 17 deletions

View File

@@ -18,6 +18,7 @@
#include "Engine/Content/Deprecated.h"
#include "Engine/Engine/EngineService.h"
#include "Engine/Profiler/ProfilerCPU.h"
#include "Engine/Profiler/ProfilerMemory.h"
#include "Engine/Serialization/Serialization.h"
#include <ThirdParty/recastnavigation/DetourNavMesh.h>
#include <ThirdParty/recastnavigation/RecastAlloc.h>
@@ -93,6 +94,7 @@ NavMeshRuntime* NavMeshRuntime::Get(const NavMeshProperties& navMeshProperties,
if (!result && createIfMissing)
{
// Create a new navmesh
PROFILE_MEM(Navigation);
result = New<NavMeshRuntime>(navMeshProperties);
NavMeshes.Add(result);
}
@@ -178,16 +180,20 @@ NavigationService NavigationServiceInstance;
void* dtAllocDefault(size_t size, dtAllocHint)
{
PROFILE_MEM(Navigation);
return Allocator::Allocate(size);
}
void* rcAllocDefault(size_t size, rcAllocHint)
{
PROFILE_MEM(Navigation);
return Allocator::Allocate(size);
}
NavigationSettings::NavigationSettings()
{
PROFILE_MEM(Navigation);
// Init navmeshes
NavMeshes.Resize(1);
auto& navMesh = NavMeshes[0];