diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/GfxDevice/opengles30/TimerQueryGLES30.h |
Diffstat (limited to 'Runtime/GfxDevice/opengles30/TimerQueryGLES30.h')
-rw-r--r-- | Runtime/GfxDevice/opengles30/TimerQueryGLES30.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/opengles30/TimerQueryGLES30.h b/Runtime/GfxDevice/opengles30/TimerQueryGLES30.h new file mode 100644 index 0000000..9bf7e22 --- /dev/null +++ b/Runtime/GfxDevice/opengles30/TimerQueryGLES30.h @@ -0,0 +1,47 @@ +#ifndef TIMERQUERYGLES_H +#define TIMERQUERYGLES_H + +#if ENABLE_PROFILER && GFX_SUPPORTS_OPENGLES30 + +#include "IncludesGLES30.h" +#include "Runtime/GfxDevice/GfxTimerQuery.h" + +struct TimerQueriesGLES30 +{ + enum + { + kQueriesCount = 128, + }; + + GLuint timestamp_gl[kQueriesCount]; + unsigned nextIndex; + + bool Init(); + + void BeginTimerQueries(); + void EndTimerQueries(); + + unsigned SetTimestamp(); + UInt64 GetElapsedTime(unsigned idx, bool wait); +}; +extern TimerQueriesGLES30 g_TimerQueriesGLES30; + + +class TimerQueryGLES30 + : public GfxTimerQuery +{ +public: + + TimerQueryGLES30(); + + virtual void Measure(); + virtual ProfileTimeFormat GetElapsed(UInt32 flags); + +private: + + unsigned m_Index; + ProfileTimeFormat m_Time; +}; + +#endif +#endif |