MaliHwCounters.h 942 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (C) 2009-2022, 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/Allocator.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
  22. {
  23. public:
  24. MaliHwCounters(GenericMemoryPoolAllocator<U8> alloc);
  25. MaliHwCounters(const MaliHwCounters&) = delete; // Non-copyable
  26. ~MaliHwCounters();
  27. MaliHwCounters& operator=(const MaliHwCounters&) = delete; // Non-copyable
  28. void sample(MaliHwCountersOut& out);
  29. private:
  30. GenericMemoryPoolAllocator<U8> m_alloc;
  31. void* m_impl = nullptr;
  32. };
  33. /// @}
  34. } // end namespace anki