-
Notifications
You must be signed in to change notification settings - Fork 3
/
GPUProfiler.hpp
54 lines (35 loc) · 849 Bytes
/
GPUProfiler.hpp
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
48
49
50
51
52
53
54
#if 0
// GPU performance-measurement subsystem
#pragma once
#define MAX_TIMESTAMPS 30
#define NOOF_FRAMES 3
class GPUProfiler
{
public:
struct TimeStamp
{
WCHAR m_name[100];
ID3D11Query * m_timeStamp;
float m_duration;
};
GPUProfiler ();
~GPUProfiler(){}
bool Init ();
void Shutdown ();
bool CreateTimestamp(WCHAR* name, UINT& timerID);
void BeginFrame();
void AddTimestamp(UINT timerID);
void EndFrame();
void ResolveAllTimerData();
TimeStamp& GetTimerData(UINT timerID);
UINT GetNoofTimers() { return m_noofTimers; }
protected:
static const UINT sm_maxNoofTimers = 100;
UINT m_noofTimers;
double m_gpuTickDelta;
ComPtr<ID3D12QueryHeap> queryHeap;
ComPtr<ID3D12Resource> readBackBuffer;
TimeStamp m_timeStamps[NOOF_FRAMES][MAX_TIMESTAMPS];
float m_timerData[NOOF_FRAMES][MAX_TIMESTAMPS];
};
#endif