VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
profiler.h
Go to the documentation of this file.
1 /*********************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************************/
5 
6 #pragma once
7 
9 
10 //easy to use macro to profile a section
15 
16 namespace makVrf
17 {
19  {
20  public:
21  static void initializeConsoleCommands();
22  static void setCollectTracyStats(bool);
23  static bool collectTracyStats();
24  };
25 }
26 
28 //tracy
29 #ifdef TRACY_ENABLE
30 #define TRACY_ON_DEMAND
31 #define TRACY_DELAYED_INIT
32 //#define TRACY_NO_BROADCAST
34 #include <TracyClient/Tracy.hpp>
35 //#pragma comment(lib, "TracyClient.lib")
36 
37 inline void DtZoneSetText(tracy::ScopedZone& zone, const char* text) {
38  zone.Text(text, strlen(text));
39 }
40 inline void DtZoneSetText(tracy::ScopedZone& zone, const std::string& text) {
41  zone.Text(text.c_str(), text.size());
42 }
43 
44 #define ZoneScopedNA( name, active ) ZoneNamedN( ___tracy_scoped_zone, name, active )
45 #define ZoneScopedNCA( name, color, active ) ZoneNamedNC( ___tracy_scoped_zone, name, color, active )
46 
48 #define DtPROFILEzone ZoneNamed(___tracy_scoped_zone, makVrf::DtProfiler::collectTracyStats());
49 #define DtPROFILE(name) ZoneScopedNA(name, makVrf::DtProfiler::collectTracyStats());
50 #define DtPROFILEC(name, color) ZoneScopedNCA(name, color, makVrf::DtProfiler::collectTracyStats());
51 #define DtPROFILE_SECTION(name) {ZoneScopedNA(name, makVrf::DtProfiler::collectTracyStats());
52 #define DtPROFILE_SECTION_END }
53 #define DtPROFILE_ZONE_TEXT(text) DtZoneSetText(___tracy_scoped_zone, text)
54 #define DtVRF_PROFILE(name) DtPROFILE(name)
55 #define DtVRF_PROFILE_FILE(name) DtPROFILE(name)
56 //#define DtPROFILE(name) ZoneScopedNS(name, 4); DtPROFILE_X(name, __LINE__);
58 #define DtProfilerFrameMark if(makVrf::DtProfiler::collectTracyStats()) { FrameMark; }
59 #define DtProfilerPlot(x,y) TracyPlot(x,y)
60 #define DtProfilerThreadName(name) tracy::SetThreadName(name );
61 #define DtProfilerMessage(str, stringLen) TracyMessage(str, stringLen)
62 #else
63 #define DtProfilerFrameMark
64 #define DtPROFILEzone
65 #define DtPROFILE(name)
66 #define DtPROFILEC(name, color)
67 #define DtPROFILE_SECTION(name)
68 #define DtPROFILE_SECTION_END
69 #define DtVRF_PROFILE(name)
70 #define DtVRF_PROFILE_FILE(name)
71 #endif
Definition: profiler.h:18
#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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)