13constexpr uint32_t kFrameHistorySize = 120;
16struct CustomProfilingStat
20 std::string mCategory;
22 float mMaxValue = 16.67f;
23 bool mShowAsBar =
true;
27struct CustomProfilingSection
31 void (*mDrawCallback)(
void*) =
nullptr;
32 void* mUserData =
nullptr;
43 void RegisterCustomStat(uint64_t hookId,
const char* name,
const char* category,
float maxValue,
bool showAsBar);
44 void UnregisterCustomStat(uint64_t hookId,
const char* name);
45 void SetCustomStatValue(
const char* name,
float value);
47 void RegisterCustomSection(uint64_t hookId,
const char* name,
void (*drawFunc)(
void*),
void* userData);
48 void UnregisterCustomSection(uint64_t hookId,
const char* name);
50 void RemoveAllHooks(uint64_t hookId);
54 bool mShowCpuStats =
true;
55 bool mShowGpuStats =
true;
56 bool mShowMemory =
true;
57 bool mShowFrameGraph =
true;
61 std::deque<float> mFrameTimeHistory;
64 float mSmoothedFPS = 60.0f;
65 float mSmoothedFrameTime = 16.67f;
66 float mMinFrameTime = 16.67f;
67 float mMaxFrameTime = 16.67f;
68 float mAvgFrameTime = 16.67f;
71 int mFrameGraphScaleIndex = 0;
74 std::vector<CustomProfilingStat> mCustomStats;
75 std::vector<CustomProfilingSection> mCustomSections;
78 void DrawFPSSection();
79 void DrawCpuStatsSection();
80 void DrawGpuStatsSection();
81 void DrawMemorySection();
82 void DrawFrameGraph();
83 void DrawCustomStatsSection();
84 void DrawCustomSections();
86 void DrawStatBar(
const char* name,
float value,
float maxValue,
const ImVec4& color);
87 void DrawMemoryBar(
const char* label, uint64_t used, uint64_t total,
const ImVec4& color);
89 uint64_t GetPlatformTotalMemoryBytes()
const;
90 const char* GetPlatformName()
const;
93 struct EstimatedMemory
95 uint64_t mTextures = 0;
97 uint64_t mSkeletalMeshes = 0;
99 uint64_t mRenderTargets = 0;
102 uint64_t Total()
const {
return mTextures + mMeshes + mSkeletalMeshes + mAudio + mRenderTargets + mOther; }
105 EstimatedMemory EstimateMemoryForPlatform(
Platform platform)
const;
106 uint64_t GetBytesPerPixelForPlatform(
Platform platform)
const;
107 uint32_t GetIndexSizeForPlatform(
Platform platform)
const;
110ProfilingWindow* GetProfilingWindow();
Platform
Definition EngineTypes.h:31
void Tick()
Definition HttpClient.cpp:202