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.

34 lines
1.2 KiB

  1. //===== Copyright � 1996-2007, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose: tracks VB allocations (and compressed/uncompressed vertex memory usage)
  4. //
  5. //===========================================================================//
  6. #ifndef IVBALLOCTRACKER_H
  7. #define IVBALLOCTRACKER_H
  8. #include "materialsystem/imaterialsystem.h"
  9. // By default, only enable this alloc tracking for a debug shaderapidx*.dll
  10. // (it uses about 0.25MB to track ~7000 allocations)
  11. #if defined(_DEBUG)
  12. #define ENABLE_VB_ALLOC_TRACKER 1
  13. #else
  14. #define ENABLE_VB_ALLOC_TRACKER 0
  15. #endif
  16. // This interface is actually exported by the shader API DLL.
  17. // Interface to the VB mem alloc tracker
  18. abstract_class IVBAllocTracker
  19. {
  20. public:
  21. // This should be called wherever VertexBuffers are allocated
  22. virtual void CountVB( void * buffer, bool isDynamic, int bufferSize, int vertexSize, VertexFormat_t fmt ) = 0;
  23. // This should be called wherever VertexBuffers are freed
  24. virtual void UnCountVB( void * buffer ) = 0;
  25. // Track mesh allocations (set this before an allocation, clear it after)
  26. virtual bool TrackMeshAllocations( const char * allocatorName ) = 0;
  27. };
  28. #endif // IVBALLOCTRACKER_H