GpuVisibleTransientMemoryPool.cpp 704 B

1234567891011121314151617181920212223242526
  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. #include <AnKi/Core/GpuMemory/GpuVisibleTransientMemoryPool.h>
  6. #include <AnKi/Core/StatsSet.h>
  7. namespace anki {
  8. static StatCounter g_gpuVisibleTransientMemoryStatVar(StatCategory::kGpuMem, "GPU visible transient mem",
  9. StatFlag::kBytes | StatFlag::kMainThreadUpdates);
  10. void GpuVisibleTransientMemoryPool::endFrame()
  11. {
  12. g_gpuVisibleTransientMemoryStatVar.set(m_pool.getAllocatedMemory());
  13. if(m_frame == 0)
  14. {
  15. m_pool.reset();
  16. }
  17. m_frame = (m_frame + 1) % kMaxFramesInFlight;
  18. }
  19. } // end namespace anki