VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtProfileManager.h
Go to the documentation of this file.
1 /*********************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************************/
5 
10 
11 #pragma once
12 
13 #include <vrvUtil/vrvUtil.h>
14 
15 #include <string>
16 
17 namespace makVrv
18 {
20  typedef unsigned long long DtUInt64;
21 
23  struct DtThreadProfileData;
24  class DtProfileIterator;
25  class DtProfileNode;
26 
30  {
31  public:
33  {
34  F3_STATS_OVERLAY = 0x00000001,
35  IMGUI_OVERLAY = 0x00000010,
36  };
37 
39  static void init();
40 
48  static void addClientFlag(int flag);
49  static void removeClientFlag(int flag);
50  static int clientFlags();
52 
54  static void startProfile(const char* name);
56  static void stopProfile();
57 
59  static void startPerformanceStat(const char* name);
61  static void stopPerformanceStat();
62 
64  static void getTime(DtUInt64& time);
65 
67  static void reset();
70  static void incrementFrameCounter();
72  static int frameCountSinceReset() {return theFrameCounter; }
74  static DtUInt64 timeSinceReset();
76  static DtUInt64 ticksPerSecond();
77 
79  static double averageFps();
81  static double instantFps();
83  static double lowestFps();
84 
86  static double instantFrameTime();
87  static double averageFrameTime();
88  static double highestFrameTime();
89 
91  static DtProfileIterator* profileIterator();
92 
94  static DtProfileNode* theRootNode() { return &theRoot; }
95 
97  static DtProfileIterator* statIterator();
98 
100  static void releaseIterator(DtProfileIterator* iterator );
101 
103  static bool collectTracyStats() {return theCollectTracyStats;}
104  static bool collectTracyGpuStats() { return theCollectGpuTracyStats; }
106  static void setCollectTracyStats(bool val) {
107  theCollectTracyStats = val;
108  if (!theCollectTracyStats)
109  {
110  theCollectGpuTracyStats = false;
111  }
112  }
113  static void setCollectTracyGpuStats(bool val) { theCollectGpuTracyStats = val; }
114  static void setTracyProfilerInitialized(bool val) { theTracyProfilerInitialized = val; }
115  static bool tracyProfilerInitialized() { return theTracyProfilerInitialized ; }
116 
117  static int threadCount();
118  static DtThreadProfileData* threadData(int i);
119 
120  private:
125  {
126  public:
127  Initializer();
128  };
129  friend class Initializer;
131 
133  static DtThreadProfileData* getCurrentProfileNode();
134  static DtThreadProfileData* getCurrentPerformanceStatNode();
135 
138 
139  static bool theShouldReset;
140  static int theFrameCounter;
143 
146  static int theFrameTimeIndex;
147 
150  static int theClientFlags;
151  static bool theCollectTracyStats;
154  };
155 }
156 
157 
Profile node class stores timing data for a profiled section.
Definition: DtProfileNode.h:22
DT_DLL_EXAMPLESCENEROOTPLUGIN void init(DtDe &anIG)
static int theFrameCounter
Definition: DtProfileManager.h:140
this is a static constructor used to create and initialize this class and the clock at startup by cal...
Definition: DtProfileManager.h:124
#define DT_DLL_VRVUTIL
Definition: vrvUtil.h:34
static bool theCollectGpuTracyStats
Definition: DtProfileManager.h:152
static Initializer theInitializer
Definition: DtProfileManager.h:130
An Iterator for navigating through the function call tree.
Definition: DtProfileIterator.h:23
ClientFlags
Definition: DtProfileManager.h:32
static void setTracyProfilerInitialized(bool val)
Definition: DtProfileManager.h:114
static bool collectTracyGpuStats()
Definition: DtProfileManager.h:104
static bool theCollectTracyStats
Definition: DtProfileManager.h:151
static DtUInt64 * theFrameTimes
Definition: DtProfileManager.h:144
static DtProfileNode thePerformanceStatRoot
Definition: DtProfileManager.h:137
Contains DLL export macros.
static int theFrameTimeIndex
Definition: DtProfileManager.h:146
static void setCollectTracyGpuStats(bool val)
Definition: DtProfileManager.h:113
static bool theShouldReset
Definition: DtProfileManager.h:139
static bool theTracyProfilerInitialized
Definition: DtProfileManager.h:153
static int theClientFlags
Definition: DtProfileManager.h:150
static DtProfileNode theRoot
Definition: DtProfileManager.h:136
static DtUInt64 thePreviousFrame
Definition: DtProfileManager.h:142
static bool tracyProfilerInitialized()
Definition: DtProfileManager.h:115
static DtUInt64 theMaxFrameTime
Definition: DtProfileManager.h:145
static bool theInitializationDone
Definition: DtProfileManager.h:148
The profile manager responsible for all profiling.
Definition: DtProfileManager.h:29
static DtProfileNode * theRootNode()
tree root access for imgui
Definition: DtProfileManager.h:94
static void setCollectTracyStats(bool val)
set if stats are active
Definition: DtProfileManager.h:106
static int thePreInitClientFlags
Definition: DtProfileManager.h:149
static DtUInt64 theResetTime
Definition: DtProfileManager.h:141
static bool collectTracyStats()
are tracy stats active
Definition: DtProfileManager.h:103
static int frameCountSinceReset()
get the number of frames since reset
Definition: DtProfileManager.h:72
unsigned long long DtUInt64
unsigned 64 bit integer
Definition: DtProfileIterator.h:18

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)