diff --git a/Source/Engine/Content/Asset.cpp b/Source/Engine/Content/Asset.cpp index 03bb7f75f..9a68d6a17 100644 --- a/Source/Engine/Content/Asset.cpp +++ b/Source/Engine/Content/Asset.cpp @@ -480,11 +480,7 @@ bool Asset::onLoad(LoadAssetTask* task) // Load asset LoadResult result; { -#if TRACY_ENABLE - ZoneScoped; - const StringView name(GetPath()); - ZoneName(*name, name.Length()); -#endif + PROFILE_CPU_ASSET(this); result = loadAsset(); } const bool isLoaded = result == LoadResult::Ok; diff --git a/Source/Engine/Profiler/ProfilerCPU.h b/Source/Engine/Profiler/ProfilerCPU.h index 7ffdc85eb..565ee3697 100644 --- a/Source/Engine/Profiler/ProfilerCPU.h +++ b/Source/Engine/Profiler/ProfilerCPU.h @@ -402,8 +402,10 @@ struct TIsPODType #ifdef TRACY_ENABLE #define PROFILE_CPU_SRC_LOC(srcLoc) tracy::ScopedZone ___tracy_scoped_zone( (tracy::SourceLocationData*)&(srcLoc) ); ScopeProfileBlockCPU ProfileBlockCPU((srcLoc).name) +#define PROFILE_CPU_ASSET(asset) ZoneScoped; const StringView __tracy_asset_name((asset)->GetPath()); ZoneName(*__tracy_asset_name, __tracy_asset_name.Length()) #else #define PROFILE_CPU_SRC_LOC(srcLoc) ScopeProfileBlockCPU ProfileBlockCPU((srcLoc).name) +#define PROFILE_CPU_ASSET(asset) #endif #else