Add memory profiling events to the main areas of the engine
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "Engine/Graphics/RenderTask.h"
|
||||
#include "Engine/Serialization/JsonTools.h"
|
||||
#include "Engine/Profiler/ProfilerCPU.h"
|
||||
#include "Engine/Profiler/ProfilerMemory.h"
|
||||
|
||||
extern void registerFlaxEngineInternalCalls();
|
||||
|
||||
@@ -173,6 +174,7 @@ void onEngineUnloading(MAssembly* assembly);
|
||||
|
||||
bool ScriptingService::Init()
|
||||
{
|
||||
PROFILE_MEM(Scripting);
|
||||
Stopwatch stopwatch;
|
||||
|
||||
// Initialize managed runtime
|
||||
@@ -254,30 +256,35 @@ void ScriptingService::Update()
|
||||
void ScriptingService::LateUpdate()
|
||||
{
|
||||
PROFILE_CPU_NAMED("Scripting::LateUpdate");
|
||||
PROFILE_MEM(Scripting);
|
||||
INVOKE_EVENT(LateUpdate);
|
||||
}
|
||||
|
||||
void ScriptingService::FixedUpdate()
|
||||
{
|
||||
PROFILE_CPU_NAMED("Scripting::FixedUpdate");
|
||||
PROFILE_MEM(Scripting);
|
||||
INVOKE_EVENT(FixedUpdate);
|
||||
}
|
||||
|
||||
void ScriptingService::LateFixedUpdate()
|
||||
{
|
||||
PROFILE_CPU_NAMED("Scripting::LateFixedUpdate");
|
||||
PROFILE_MEM(Scripting);
|
||||
INVOKE_EVENT(LateFixedUpdate);
|
||||
}
|
||||
|
||||
void ScriptingService::Draw()
|
||||
{
|
||||
PROFILE_CPU_NAMED("Scripting::Draw");
|
||||
PROFILE_MEM(Scripting);
|
||||
INVOKE_EVENT(Draw);
|
||||
}
|
||||
|
||||
void ScriptingService::BeforeExit()
|
||||
{
|
||||
PROFILE_CPU_NAMED("Scripting::BeforeExit");
|
||||
PROFILE_MEM(Scripting);
|
||||
INVOKE_EVENT(Exit);
|
||||
}
|
||||
|
||||
@@ -306,6 +313,7 @@ void Scripting::ProcessBuildInfoPath(String& path, const String& projectFolderPa
|
||||
bool Scripting::LoadBinaryModules(const String& path, const String& projectFolderPath)
|
||||
{
|
||||
PROFILE_CPU_NAMED("LoadBinaryModules");
|
||||
PROFILE_MEM(Scripting);
|
||||
LOG(Info, "Loading binary modules from build info file {0}", path);
|
||||
|
||||
// Read file contents
|
||||
@@ -482,6 +490,7 @@ bool Scripting::LoadBinaryModules(const String& path, const String& projectFolde
|
||||
bool Scripting::Load()
|
||||
{
|
||||
PROFILE_CPU();
|
||||
PROFILE_MEM(Scripting);
|
||||
// Note: this action can be called from main thread (due to Mono problems with assemblies actions from other threads)
|
||||
ASSERT(IsInMainThread());
|
||||
ScopeLock lock(BinaryModule::Locker);
|
||||
@@ -1034,6 +1043,7 @@ bool Scripting::IsTypeFromGameScripts(const MClass* type)
|
||||
|
||||
void Scripting::RegisterObject(ScriptingObject* obj)
|
||||
{
|
||||
PROFILE_MEM(Scripting);
|
||||
const Guid id = obj->GetID();
|
||||
ScopeLock lock(_objectsLocker);
|
||||
|
||||
@@ -1116,6 +1126,7 @@ bool initFlaxEngine()
|
||||
|
||||
void onEngineLoaded(MAssembly* assembly)
|
||||
{
|
||||
PROFILE_MEM(Scripting);
|
||||
if (initFlaxEngine())
|
||||
{
|
||||
LOG(Fatal, "Failed to initialize Flax Engine runtime.");
|
||||
|
||||
Reference in New Issue
Block a user