summaryrefslogtreecommitdiff
path: root/Runtime/Profiler/ExternalGraphicsProfiler.h
blob: 89b82ccfa0cfb96d5ea97d104f160c3a41fc1607 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include "Profiler.h"

#if ENABLE_PROFILER

#include "Runtime/GfxDevice/GfxDevice.h"

struct AutoGfxEventMainThread {
	AutoGfxEventMainThread(const char* name) { GetGfxDevice().BeginProfileEvent(name); }
	~AutoGfxEventMainThread() { GetGfxDevice().EndProfileEvent(); }
};
#define PROFILER_AUTO_GFX(INFO, OBJECT_PTR) PROFILER_AUTO(INFO,OBJECT_PTR); AutoGfxEventMainThread _gfx_event(INFO.name);


#else // no profiling compiled in

#	define PROFILER_AUTO_GFX(INFO, OBJECT_PTR)

#endif