8#define PROFILING_ENABLED 1
10#define STAT_NAME_LENGTH 31
11#define STAT_NAME_BUFFER_LENGTH (STAT_NAME_LENGTH + 1)
37 void EndCpuStat(
const char* name,
bool persistent);
98#define SCOPED_FRAME_STAT(name) ScopedCpuStat scopedStat##__LINE__(name, false);
99#define BEGIN_FRAME_STAT(name) GetProfiler()->BeginCpuStat(name, false);
100#define END_FRAME_STAT(name) GetProfiler()->EndCpuStat(name, false);
102#define SCOPED_STAT(name) ScopedCpuStat scopedStat##__LINE__(name, true);
103#define BEGIN_STAT(name) GetProfiler()->BeginCpuStat(name, true);
104#define END_STAT(name) GetProfiler()->EndCpuStat(name, true);
106#define SCOPED_GPU_STAT(name) ScopedGpuStat scopedStat##__LINE__(name);
107#define BEGIN_GPU_STAT(name) GetProfiler()->BeginGpuStat(name);
108#define END_GPU_STAT(name) GetProfiler()->EndGpuStat(name);
110#define SCOPED_FRAME_STAT(name)
111#define BEGIN_FRAME_STAT(name)
112#define END_FRAME_STAT(name)
114#define SCOPED_STAT(name)
115#define BEGIN_STAT(name)
116#define END_STAT(name)
118#define SCOPED_GPU_STAT(name)
119#define BEGIN_GPU_STAT(name)
120#define END_GPU_STAT(name)
Profiler * GetProfiler()
Definition Profiler.cpp:206
#define STAT_NAME_LENGTH
Definition Profiler.h:10
#define STAT_NAME_BUFFER_LENGTH
Definition Profiler.h:11
void CreateProfiler()
Definition Profiler.cpp:185
void DestroyProfiler()
Definition Profiler.cpp:195
CpuStat * FindCpuStat(const char *name, bool persistent)
Definition Profiler.cpp:123
void DumpPersistentStats()
Definition Profiler.cpp:169
const std::vector< CpuStat > & GetCpuPersistentStats() const
Definition Profiler.cpp:147
void EndCpuStat(const char *name, bool persistent)
Definition Profiler.cpp:70
void BeginCpuStat(const char *name, bool persistent)
Definition Profiler.cpp:44
std::vector< CpuStat > mCpuPersistentStats
Definition Profiler.h:55
const std::vector< GpuStat > & GetGpuStats() const
Definition Profiler.cpp:152
void SetGpuStatTime(const char *name, float time)
Definition Profiler.cpp:98
void BeginFrame()
Definition Profiler.cpp:13
void LogPersistentStats()
Definition Profiler.cpp:157
std::vector< GpuStat > mGpuStats
Definition Profiler.h:56
void EndFrame()
Definition Profiler.cpp:26
std::vector< CpuStat > mCpuFrameStats
Definition Profiler.h:54
const std::vector< CpuStat > & GetCpuFrameStats() const
Definition Profiler.cpp:142
void BeginGpuStat(const char *name)
Definition Profiler.cpp:84
void EndGpuStat(const char *name)
Definition Profiler.cpp:91
float mTime
Definition Profiler.h:18
uint64_t mStartTime
Definition Profiler.h:16
float mSmoothedTime
Definition Profiler.h:19
uint64_t mEndTime
Definition Profiler.h:17
char mName[STAT_NAME_BUFFER_LENGTH]
Definition Profiler.h:15
char mName[STAT_NAME_BUFFER_LENGTH]
Definition Profiler.h:24
float mTime
Definition Profiler.h:25
float mSmoothedTime
Definition Profiler.h:26
ScopedCpuStat(const char *name, bool persistent)
Definition Profiler.h:65
~ScopedCpuStat()
Definition Profiler.h:72
bool mPersistent
Definition Profiler.h:78
char mName[STAT_NAME_BUFFER_LENGTH]
Definition Profiler.h:77
ScopedGpuStat(const char *name)
Definition Profiler.h:83
~ScopedGpuStat()
Definition Profiler.h:89
char mName[STAT_NAME_BUFFER_LENGTH]
Definition Profiler.h:94