mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
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:
parent
7a0ae4c7af
commit
ba18fdbe6d
2 changed files with 30 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue