GpuVisibleTransientMemoryPool.cpp 663 B

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