Add PROFILE_CPU_ASSET for asset related profiler scoped zone

This commit is contained in:
Wojtek Figat
2021-08-28 12:49:02 +02:00
parent 610763b637
commit d654d2d0ac
2 changed files with 3 additions and 5 deletions

View File

@@ -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;

View File

@@ -402,8 +402,10 @@ struct TIsPODType<ProfilerCPU::Event>
#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