VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
profiler.h
Go to the documentation of this file.
1 #ifndef _NO_VRF_PROFILER_
2 /*********************************************************************************
3 ** Copyright (c) 2021 MAK Technologies, Inc.
4 ** All rights reserved.
5 *********************************************************************************/
6 
7 #pragma once
8 
10 #include <string>
11 #include <map>
12 #include <stdlib.h>
13 
24 
25 namespace makVrf
26 {
28  {
29  public:
30  static void initializeConsoleCommands();
31  static void setCollectTracyStats(bool);
32  static bool collectTracyStats();
34  static int tracyModuleLevel(size_t moduleNameHash);
39  static size_t addExternalModule(const std::string& Module);
41  static size_t theTerrainModuleName;
42  static size_t theVrfUtilModuleName;
43  static void Shutdown();
44  };
45 }
46 
51 #define TRACY_ENABLE
52 
54 //tracy
55 #ifdef TRACY_ENABLE
56 #define TRACY_ON_DEMAND
57 #define TRACY_DELAYED_INIT
58 #define TRACY_MANUAL_LIFETIME
59 //#define TRACY_NO_BROADCAST
61 #include <TracyClient/Tracy.hpp>
62 #include <TracyClient/client/TracyProfiler.hpp>
63 //#pragma comment(lib, "TracyClient.lib")
64 
65 inline void DtZoneSetText(tracy::ScopedZone& zone, const char* text) {
66  zone.Text(text, strlen(text));
67 }
68 inline void DtZoneSetText(tracy::ScopedZone& zone, const std::string& text) {
69  zone.Text(text.c_str(), text.size());
70 }
71 
72 #define ZoneScopedNA( name, active ) ZoneNamedN( ___tracy_scoped_zone, name, active )
73 #define ZoneScopedNCA( name, color, active ) ZoneNamedNC( ___tracy_scoped_zone, name, color, active )
74 
76 #define DtPROFILEzone ZoneNamed(___tracy_scoped_zone, makVrf::DtProfiler::collectTracyStats());
77 #define DtPROFILE(name) ZoneScopedNA(name, makVrf::DtProfiler::collectTracyStats());
78 #define DtPROFILEC(name, color) ZoneScopedNCA(name, color, makVrf::DtProfiler::collectTracyStats());
79 #define DtPROFILELEVEL(name, moduleName, level) ZoneScopedNA(name, (makVrf::DtProfiler::collectTracyStats() && (makVrf::DtProfiler::tracyModuleLevel(moduleName) >= level)));
81 #define DtPROFILELEVELC(name, color, moduleName, level) ZoneScopedNCA(name, color, (makVrf::DtProfiler::collectTracyStats() && (makVrf::DtProfiler::tracyModuleLevel(moduleName) >= level)));
82 #define DtPROFILE_SECTION(name) {ZoneScopedNA(name, makVrf::DtProfiler::collectTracyStats());
83 #define DtPROFILE_ZONE_TEXT(text) DtZoneSetText(___tracy_scoped_zone, text)
84 #define DtPROFILE_SECTION_END }
85 #define DtPROFILE_ZONE_TEXT(text) DtZoneSetText(___tracy_scoped_zone, text)
86 #define DtVRF_PROFILE(name) DtPROFILE(name)
87 #define DtVRF_PROFILE_FILE(name) DtPROFILE(name)
88 //#define DtPROFILE(name) ZoneScopedNS(name, 4); DtPROFILE_X(name, __LINE__);
90 #define DtProfilerFrameMark if(makVrf::DtProfiler::collectTracyStats()) { FrameMark; }
91 #define DtProfilerPlot(x,y) TracyPlot(x,y)
92 #define DtProfilerThreadName(name) tracy::SetThreadName(name );
93 #define DtProfilerMessage(str, stringLen) TracyMessage(str, stringLen)
94 #else
95 #define DtProfilerFrameMark
96 #define DtPROFILEzone
97 #define DtPROFILE(name)
98 #define DtPROFILEC(name, color)
99 #define DtPROFILE_SECTION(name)
100 #define DtPROFILE_SECTION_END
101 #define DtVRF_PROFILE(name)
102 #define DtVRF_PROFILE_FILE(name)
103 #endif
104 #endif
void DtZoneSetText(tracy::ScopedZone &zone, const char *text)
TO DO include tracy on linux just to get it&#39;s macros for throwing things out.
Definition: profiler.h:65
static size_t theVrfUtilModuleName
Definition: profiler.h:42
IMGUI_API void Shutdown(ImGuiContext *context)
Definition: profiler.h:27
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
static size_t theTerrainModuleName
Module(s) name hash of module that support higher level of trace.
Definition: profiler.h:41

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)