summaryrefslogtreecommitdiff
path: root/Runtime/Profiler/ExternalGraphicsProfiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/Profiler/ExternalGraphicsProfiler.h')
-rw-r--r--Runtime/Profiler/ExternalGraphicsProfiler.h20
1 files changed, 20 insertions, 0 deletions
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