VR-Forces 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 void setCollectTracyStatsWithoutStartup(bool);
33  static bool collectTracyStats();
35  static int tracyModuleLevel(size_t moduleNameHash);
40  static size_t addExternalModule(const std::string& Module);
42  static size_t theTerrainModuleName;
43  static size_t theVrfUtilModuleName;
44  static void Shutdown();
45  };
46 }
47 
52 #define TRACY_ENABLE
53 
55 //tracy
56 #ifdef TRACY_ENABLE
57 
58 #include <tracy/MAKTracyDefines.h>
59 #include <tracy/Tracy.hpp>
60 #include <client/TracyProfiler.hpp>
61 
62 inline void DtZoneSetText(tracy::ScopedZone& zone, const char* text) {
63  zone.Text(text, strlen(text));
64 }
65 inline void DtZoneSetText(tracy::ScopedZone& zone, const std::string& text) {
66  zone.Text(text.c_str(), text.size());
67 }
68 
70 #define DtPROFILEzone ZoneNamed(___tracy_scoped_zone, makVrf::DtProfiler::collectTracyStats());
71 #define DtPROFILE(name) ZoneNamedN( ___tracy_scoped_zone, name, makVrf::DtProfiler::collectTracyStats());
72 #define DtPROFILEC(name, color) ZoneNamedNC( ___tracy_scoped_zone, name, color, makVrf::DtProfiler::collectTracyStats());
73 #define DtPROFILELEVEL(name, moduleName, level) ZoneNamedN( ___tracy_scoped_zone ,name, (makVrf::DtProfiler::collectTracyStats() && (makVrf::DtProfiler::tracyModuleLevel(moduleName) >= level)));
75 #define DtPROFILELEVELC(name, color, moduleName, level) ZoneNamedNC( ___tracy_scoped_zone, name, color, (makVrf::DtProfiler::collectTracyStats() && (makVrf::DtProfiler::tracyModuleLevel(moduleName) >= level)));
76 #define DtPROFILE_SECTION(name) {ZoneNamedN( ___tracy_scoped_zone, name, makVrf::DtProfiler::collectTracyStats());
77 #define DtPROFILE_ZONE_TEXT(text) DtZoneSetText(___tracy_scoped_zone, text)
78 #define DtPROFILE_SECTION_END }
79 #define DtPROFILE_ZONE_TEXT(text) DtZoneSetText(___tracy_scoped_zone, text)
80 #define DtVRF_PROFILE(name) DtPROFILE(name)
81 #define DtVRF_PROFILE_FILE(name) DtPROFILE(name)
82 //#define DtPROFILE(name) ZoneScopedNS(name, 4); DtPROFILE_X(name, __LINE__);
84 #define DtProfilerFrameMark if(makVrf::DtProfiler::collectTracyStats()) { FrameMark; }
85 #define DtProfilerPlot(x,y) TracyPlot(x,y)
86 #define DtProfilerThreadName(name) tracy::SetThreadName(name );
87 #define DtProfilerMessage(str, stringLen) TracyMessage(str, stringLen)
88 #else
89 #define DtProfilerFrameMark
90 #define DtPROFILEzone
91 #define DtPROFILE(name)
92 #define DtPROFILEC(name, color)
93 #define DtPROFILE_SECTION(name)
94 #define DtPROFILE_SECTION_END
95 #define DtVRF_PROFILE(name)
96 #define DtVRF_PROFILE_FILE(name)
97 #endif
98 #endif
void DtZoneSetText(tracy::ScopedZone &zone, const char *text)
Definition: profiler.h:62
static size_t theVrfUtilModuleName
Definition: profiler.h:43
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:42

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)