Counter Strike : Global Offensive Source Code
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.

70 lines
2.4 KiB

  1. //========= Copyright � 1996-2005, 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. abstract_class IDebugTextureInfo
  14. {
  15. public:
  16. // Use this to turn on the mode where it builds the debug texture list.
  17. // At the end of the next frame, GetDebugTextureList() will return a valid list of the textures.
  18. virtual void EnableDebugTextureList( bool bEnable ) = 0;
  19. // If this is on, then it will return all textures that exist, not just the ones that were bound in the last frame.
  20. // It is required to enable debug texture list to get this.
  21. virtual void EnableGetAllTextures( bool bEnable ) = 0;
  22. // Use this to get the results of the texture list.
  23. // Do NOT release the KeyValues after using them.
  24. // There will be a bunch of subkeys, each with these values:
  25. // Name - the texture's filename
  26. // Binds - how many times the texture was bound
  27. // Format - ImageFormat of the texture
  28. // Width - Width of the texture
  29. // Height - Height of the texture
  30. // It is required to enable debug texture list to get this.
  31. // You MUST release the texture list after having copied it or whatever so that it can be updated again on a separate thread.
  32. virtual KeyValues* LockDebugTextureList( void ) = 0;
  33. virtual void UnlockDebugTextureList( void ) = 0;
  34. // Texture memory usage
  35. enum TextureMemoryType
  36. {
  37. MEMORY_RESERVED_MIN = 0,
  38. MEMORY_BOUND_LAST_FRAME, // sums up textures bound last frame
  39. MEMORY_TOTAL_LOADED, // total texture memory used
  40. MEMORY_ESTIMATE_PICMIP_1, // estimate of running with "picmip 1"
  41. MEMORY_ESTIMATE_PICMIP_2, // estimate of running with "picmip 2"
  42. MEMORY_RESERVED_MAX
  43. };
  44. // This returns how much memory was used.
  45. virtual int GetTextureMemoryUsed( TextureMemoryType eTextureMemory ) = 0;
  46. // Use this to determine if texture debug info was computed within last numFramesAllowed frames.
  47. virtual bool IsDebugTextureListFresh( int numFramesAllowed = 1 ) = 0;
  48. // Enable debug texture rendering when texture binds should not count towards textures
  49. // used during a frame. Returns the old state of debug texture rendering flag to use
  50. // it for restoring the mode.
  51. virtual bool SetDebugTextureRendering( bool bEnable ) = 0;
  52. };
  53. #endif // IDEBUGTEXTUREINFO_H