summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/opengles30/TimerQueryGLES30.h
blob: 9bf7e22ab448def5615c9744e3e51f54373f96ef (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_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