PROFILE_START_IF profiler macro

sig is an action, a stringtable variable, and an unquoted string to compare against
demonstrated with bitmapSTB
This commit is contained in:
AzaezelX 2025-10-16 18:11:29 -05:00
parent 7a0ae4c7af
commit ba18fdbe6d
2 changed files with 30 additions and 3 deletions

View file

@ -170,6 +170,12 @@ if(gProfiler) gProfiler->hashPush(& pdata##name##obj )
#define PROFILE_END_NAMED(name) if(gProfiler) gProfiler->hashPop(& pdata##name##obj)
#define PROFILE_START_IF(act, val,fmt) \
if (val.equal(#fmt, String::NoCase)) { \
static ProfilerRootData pdata##act##_##fmt##obj(#act#fmt); \
if (gProfiler) gProfiler->hashPush(&pdata##act##_##fmt##obj); \
}
class ScopedProfiler {
public:
ScopedProfiler(ProfilerRootData *data) {