BVB Source Codes

CRYENGINE Show ParticleProfiler.h Source code

Return Download CRYENGINE: download ParticleProfiler.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #pragma once
  4.  
  5. #include "ParticleCommon.h"
  6.  
  7. namespace pfx2
  8. {
  9.  
  10. class CParticleProfiler;
  11. class CParticleComponentRuntime;
  12.  
  13. enum EProfileStat
  14. {
  15.         EPS_Jobs,
  16.         EPS_AllocatedParticles,
  17.         EPS_ActiveParticles,
  18.         EPS_RendereredParticles,
  19.         EPS_NewBornTime,
  20.         EPS_UpdateTime,
  21.         EPS_ComputeVerticesTime,
  22.         EPS_TotalTiming,
  23.  
  24.         EPST_Count,
  25. };
  26.  
  27. class CTimeProfiler
  28. {
  29. public:
  30.         CTimeProfiler(CParticleProfiler& profiler, CParticleComponentRuntime* pRuntime, EProfileStat stat);
  31.         ~CTimeProfiler();
  32.  
  33. private:
  34.         CParticleProfiler&         m_profiler;
  35.         CParticleComponentRuntime* m_pRuntime;
  36.         int64                      m_startTicks;
  37.         EProfileStat               m_stat;
  38. };
  39.  
  40. struct SStatistics
  41. {
  42.         SStatistics();
  43.         uint m_values[EPST_Count];
  44. };
  45.  
  46. class CParticleProfiler
  47. {
  48. public:
  49.         class CCSVFileOutput;
  50.         class CStatisticsDisplay;
  51.  
  52.         struct SEntry
  53.         {
  54.                 CParticleComponentRuntime* m_pRuntime;
  55.                 EProfileStat               m_type;
  56.                 uint                       m_value;
  57.         };
  58.         typedef std::vector<SEntry> TEntries;
  59.  
  60. public:
  61.         CParticleProfiler();
  62.  
  63.         void Reset();
  64.         void Display();
  65.         void SaveToFile();
  66.  
  67.         void AddEntry(CParticleComponentRuntime* pRuntime, EProfileStat type, uint value = 1);
  68.  
  69. private:
  70.         void SortEntries();
  71.         void WriteEntries(CCSVFileOutput& output) const;
  72.  
  73.         void DrawStats();
  74.         void DrawStatsCounts(CStatisticsDisplay& output, Vec2 pos, uint budget);
  75.         void DrawStats(CStatisticsDisplay& output, Vec2 pos, EProfileStat stat, uint budget, cstr statName);
  76.  
  77.         std::vector<TEntries> m_entries;
  78. };
  79.  
  80. }
  81.  
  82. #include "ParticleProfilerImpl.h"
  83.  
downloadParticleProfiler.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top