LkEngine 0.1.2
 
Loading...
Searching...
No Matches
Profiler.h
Go to the documentation of this file.
1
5#pragma once
6
14/* Always enable profiling in non-dist builds. */
15/* FIXME: Re-enable this. */
16#ifndef LK_PROFILING
17//#define LK_PROFILING !LK_DIST
18#define LK_PROFILING 0
19#endif
20
21#if LK_PROFILING
22#include <tracy/Tracy.hpp>
23#endif
24
25#if LK_PROFILING
26# define LK_SCOPE_PERF(Name) FScopePerfTimer LK_SCOPED_PerfTimer__LINE__(Name, LApplication::Get().GetPerformanceProfiler());
27# define LK_SCOPE_TIMER(Name) FScopedTimer LK_SCOPED_Timer__LINE__(Name);
28
29# define LK_PROFILE_MARK_FRAME FrameMark
30# define LK_PROFILE_FUNC(...) ZoneScoped##__VA_OPT__(N(__VA_ARGS__))
31# define LK_PROFILE_THREAD(...) tracy::SetThreadName(__VA_ARGS__)
32#else
33# define LK_SCOPE_PERF(Name) (void)(Name)
34# define LK_SCOPE_TIMER(Name) (void)(Name)
35
36# define LK_PROFILE_MARK_FRAME (void)(0)
37# define LK_PROFILE_FUNC(...)
38# define LK_PROFILE_THREAD(...)
39#endif
40