Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef IDEBUGTEXTUREINFO_H
  7. #define IDEBUGTEXTUREINFO_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. class KeyValues;
  12. // This interface is actually exported by the shader API DLL.
  13. #define DEBUG_TEXTURE_INFO_VERSION "DebugTextureInfo001"
  14. abstract_class IDebugTextureInfo
  15. {
  16. public:
  17. // Use this to turn on the mode where it builds the debug texture list.
  18. // At the end of the next frame, GetDebugTextureList() will return a valid list of the textures.
  19. virtual void EnableDebugTextureList( bool bEnable ) = 0;
  20. // If this is on, then it will return all textures that exist, not just the ones that were bound in the last frame.
  21. // It is required to enable debug texture list to get this.
  22. virtual void EnableGetAllTextures( bool bEnable ) = 0;
  23. // Use this to get the results of the texture list.
  24. // Do NOT release the KeyValues after using them.
  25. // There will be a bunch of subkeys, each with these values:
  26. // Name - the texture's filename
  27. // Binds - how many times the texture was bound
  28. // Format - ImageFormat of the texture
  29. // Width - Width of the texture
  30. // Height - Height of the texture
  31. // It is required to enable debug texture list to get this.
  32. virtual KeyValues* GetDebugTextureList() = 0;
  33. // Texture memory usage
  34. enum TextureMemoryType
  35. {
  36. MEMORY_RESERVED_MIN = 0,
  37. MEMORY_BOUND_LAST_FRAME, // sums up textures bound last frame
  38. MEMORY_TOTAL_LOADED, // total texture memory used
  39. MEMORY_ESTIMATE_PICMIP_1, // estimate of running with "picmip 1"
  40. MEMORY_ESTIMATE_PICMIP_2, // estimate of running with "picmip 2"
  41. MEMORY_RESERVED_MAX
  42. };
  43. // This returns how much memory was used.
  44. virtual int GetTextureMemoryUsed( TextureMemoryType eTextureMemory ) = 0;
  45. // Use this to determine if texture debug info was computed within last numFramesAllowed frames.
  46. virtual bool IsDebugTextureListFresh( int numFramesAllowed = 1 ) = 0;
  47. // Enable debug texture rendering when texture binds should not count towards textures
  48. // used during a frame. Returns the old state of debug texture rendering flag to use
  49. // it for restoring the mode.
  50. virtual bool SetDebugTextureRendering( bool bEnable ) = 0;
  51. };
  52. #endif // IDEBUGTEXTUREINFO_H