summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/opengles20/TimerQueryGLES20.h
blob: 67137eba64978ceeed880942dc297d5142ee2b3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef TIMERQUERYGLES_H
#define TIMERQUERYGLES_H

#if ENABLE_PROFILER && GFX_SUPPORTS_OPENGLES20

#include "IncludesGLES20.h"
#include "Runtime/GfxDevice/GfxTimerQuery.h"

struct TimerQueriesGLES
{
	enum
	{
		kQueriesCount = 128,
	};

	GLuint		timestamp_gl[kQueriesCount];
	unsigned	nextIndex;

	bool		Init();

	void		BeginTimerQueries();
	void		EndTimerQueries();

	unsigned	SetTimestamp();
	UInt64		GetElapsedTime(unsigned idx, bool wait);
};
extern TimerQueriesGLES g_TimerQueriesGLES;


class TimerQueryGLES
  : public GfxTimerQuery
{
public:

	TimerQueryGLES();

	virtual void				Measure();
	virtual ProfileTimeFormat	GetElapsed(UInt32 flags);

private:

	unsigned			m_Index;
	ProfileTimeFormat	m_Time;
};

#endif
#endif