Automatically create profiler instance.

This commit is contained in:
Bartosz Taudul 2017-09-18 19:08:54 +02:00
parent de66ec5332
commit 0331d548d2
2 changed files with 13 additions and 0 deletions

View File

@ -1,6 +1,13 @@
#ifndef __TRACY_HPP__ #ifndef __TRACY_HPP__
#define __TRACY_HPP__ #define __TRACY_HPP__
#ifdef TRACY_DISABLE
#define ZoneScoped
#define FrameMark
#else
#include "TracyProfiler.hpp" #include "TracyProfiler.hpp"
#include "TracyScoped.hpp" #include "TracyScoped.hpp"
@ -8,3 +15,5 @@
#define FrameMark tracy::Profiler::FrameMark(); #define FrameMark tracy::Profiler::FrameMark();
#endif #endif
#endif

View File

@ -32,6 +32,10 @@ static moodycamel::ProducerToken& GetToken()
extern const char* PointerCheckA; extern const char* PointerCheckA;
const char* PointerCheckB = "tracy"; const char* PointerCheckB = "tracy";
#ifndef TRACY_DISABLE
Profiler s_profiler;
#endif
static Profiler* s_instance = nullptr; static Profiler* s_instance = nullptr;
Profiler::Profiler() Profiler::Profiler()