MaliHwCounters.h 958 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <AnKi/Core/Common.h>
  7. #include <AnKi/Util/MemoryPool.h>
  8. namespace anki {
  9. /// @addtogroup core
  10. /// @{
  11. /// The HW counters.
  12. /// @memberof MaliHwCounters
  13. class MaliHwCountersOut
  14. {
  15. public:
  16. U64 m_gpuActive = 0;
  17. PtrSize m_readBandwidth = 0; ///< In bytes.
  18. PtrSize m_writeBandwidth = 0; ///< In bytes.
  19. };
  20. /// Sample HW counters for Mali GPUs.
  21. class MaliHwCounters : public MakeSingleton<MaliHwCounters>
  22. {
  23. template<typename>
  24. friend class MakeSingleton;
  25. public:
  26. MaliHwCounters(const MaliHwCounters&) = delete; // Non-copyable
  27. MaliHwCounters& operator=(const MaliHwCounters&) = delete; // Non-copyable
  28. void sample(MaliHwCountersOut& out);
  29. private:
  30. void* m_impl = nullptr;
  31. MaliHwCounters();
  32. ~MaliHwCounters();
  33. };
  34. /// @}
  35. } // end namespace anki