From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Profiler/ExternalGraphicsProfiler.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Runtime/Profiler/ExternalGraphicsProfiler.h (limited to 'Runtime/Profiler/ExternalGraphicsProfiler.h') diff --git a/Runtime/Profiler/ExternalGraphicsProfiler.h b/Runtime/Profiler/ExternalGraphicsProfiler.h new file mode 100644 index 0000000..89b82cc --- /dev/null +++ b/Runtime/Profiler/ExternalGraphicsProfiler.h @@ -0,0 +1,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 -- cgit v1.1-26-g67d0