Refactor Tracy source locations to be static

#597
This commit is contained in:
Wojtek Figat
2021-08-13 13:44:29 +02:00
parent 7fc144b07b
commit bc634e9d37
10 changed files with 115 additions and 20 deletions

View File

@@ -1222,6 +1222,11 @@ Asset::LoadResult VisualScript::load()
method.ProfilerName.Get()[assetName.Length()] = ':';
method.ProfilerName.Get()[assetName.Length() + 1] = ':';
Platform::MemoryCopy(method.ProfilerName.Get() + assetName.Length() + 2, method.Name.Get(), method.Name.Length());
method.ProfilerData.name = method.ProfilerName.Get();
method.ProfilerData.function = method.Name.Get();
method.ProfilerData.file = nullptr;
method.ProfilerData.line = 0;
method.ProfilerData.color = 0;
}
#endif
@@ -2139,7 +2144,7 @@ VisualScriptingBinaryModule* VisualScripting::GetBinaryModule()
Variant VisualScripting::Invoke(VisualScript::Method* method, ScriptingObject* instance, Span<Variant> parameters)
{
CHECK_RETURN(method && method->Script->IsLoaded(), Variant::Zero);
PROFILE_CPU_NAMED(*method->ProfilerName);
PROFILE_CPU_SRC_LOC(method->ProfilerData);
// Add to the calling stack
ScopeContext scope;