statistics.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef WW3D_STATISTICS_H
  19. #define WW3D_STATISTICS_H
  20. #if defined(_MSC_VER)
  21. #pragma once
  22. #endif
  23. #include "always.h"
  24. //#include "wwstring.h"
  25. class TextureClass;
  26. class StringClass;
  27. class ShaderClass;
  28. namespace Debug_Statistics
  29. {
  30. enum RecordTextureMode
  31. {
  32. RECORD_TEXTURE_NONE,
  33. RECORD_TEXTURE_SIMPLE,
  34. RECORD_TEXTURE_DETAILS
  35. };
  36. // Texture memory tracking system
  37. void Record_Texture_Mode(RecordTextureMode m);
  38. RecordTextureMode Get_Record_Texture_Mode();
  39. void Record_Texture(TextureClass* t);
  40. int Get_Record_Texture_Size(); // Return total size of textures used during latest frame, in bytes
  41. int Get_Record_Lightmap_Texture_Size(); // Return total size of lightmap textures used during latest frame, in bytes
  42. int Get_Record_Procedural_Texture_Size(); // Return total size of procedural textures used during latest frame, in bytes
  43. int Get_Record_Texture_Count(); // Return total number of textures used during latest frame
  44. int Get_Record_Texture_Change_Count();
  45. int Get_Record_Lightmap_Texture_Count(); // Return total number of lightmap textures used during latest frame
  46. int Get_Record_Procedural_Texture_Count(); // Return total number of procedutal textures used during latest frame
  47. const StringClass& Get_Record_Texture_String();
  48. void Record_DX8_Skin_Polys_And_Vertices(int pcount,int vcount);
  49. void Record_DX8_Polys_And_Vertices(int pcount,int vcount,const ShaderClass& shader);
  50. void Record_Sorting_Polys_And_Vertices(int pcount,int vcount);
  51. int Get_DX8_Polygons();
  52. int Get_DX8_Vertices();
  53. int Get_DX8_Skin_Renders();
  54. int Get_DX8_Skin_Polygons();
  55. int Get_DX8_Skin_Vertices();
  56. int Get_Sorting_Polygons();
  57. int Get_Sorting_Vertices();
  58. void Begin_Statistics();
  59. void End_Statistics();
  60. };
  61. #define ADD_STATISTICS_VERTEX_PROCESSOR_PUSH Debug_Statistics::Add_Vertex_Processor()
  62. #define DX8_RECORD_TEXTURE(t) Debug_Statistics::Record_Texture(t)
  63. #define DX8_RECORD_TEXTURE_ARRAY(t,c) Debug_Statistics::Record_Texture_Array(t,c)
  64. #define DX8_RECORD_RENDER(polys,verts,shader) Debug_Statistics::Record_DX8_Polys_And_Vertices(polys,verts,shader)
  65. #define DX8_RECORD_SORTING_RENDER(polys,verts) Debug_Statistics::Record_Sorting_Polys_And_Vertices(polys,verts)
  66. #define DX8_RECORD_SKIN_RENDER(polys,verts) Debug_Statistics::Record_DX8_Skin_Polys_And_Vertices(polys,verts)
  67. #endif