Add PROFILE_CPU_ASSET for asset related profiler scoped zone
This commit is contained in:
@@ -480,11 +480,7 @@ bool Asset::onLoad(LoadAssetTask* task)
|
|||||||
// Load asset
|
// Load asset
|
||||||
LoadResult result;
|
LoadResult result;
|
||||||
{
|
{
|
||||||
#if TRACY_ENABLE
|
PROFILE_CPU_ASSET(this);
|
||||||
ZoneScoped;
|
|
||||||
const StringView name(GetPath());
|
|
||||||
ZoneName(*name, name.Length());
|
|
||||||
#endif
|
|
||||||
result = loadAsset();
|
result = loadAsset();
|
||||||
}
|
}
|
||||||
const bool isLoaded = result == LoadResult::Ok;
|
const bool isLoaded = result == LoadResult::Ok;
|
||||||
|
|||||||
@@ -402,8 +402,10 @@ struct TIsPODType<ProfilerCPU::Event>
|
|||||||
|
|
||||||
#ifdef TRACY_ENABLE
|
#ifdef TRACY_ENABLE
|
||||||
#define PROFILE_CPU_SRC_LOC(srcLoc) tracy::ScopedZone ___tracy_scoped_zone( (tracy::SourceLocationData*)&(srcLoc) ); ScopeProfileBlockCPU ProfileBlockCPU((srcLoc).name)
|
#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
|
#else
|
||||||
#define PROFILE_CPU_SRC_LOC(srcLoc) ScopeProfileBlockCPU ProfileBlockCPU((srcLoc).name)
|
#define PROFILE_CPU_SRC_LOC(srcLoc) ScopeProfileBlockCPU ProfileBlockCPU((srcLoc).name)
|
||||||
|
#define PROFILE_CPU_ASSET(asset)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user