MemoryUsage.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <Atom/RHI.Reflect/MemoryUsage.h>
  9. namespace AZ::RHI
  10. {
  11. HeapMemoryTransfer::HeapMemoryTransfer(const HeapMemoryTransfer& rhs)
  12. {
  13. *this = rhs;
  14. }
  15. HeapMemoryTransfer& HeapMemoryTransfer::operator=(const HeapMemoryTransfer& rhs)
  16. {
  17. m_bytesPerFrame = rhs.m_bytesPerFrame.load();
  18. m_accumulatedInBytes = rhs.m_accumulatedInBytes;
  19. return *this;
  20. }
  21. HeapMemoryUsage::HeapMemoryUsage(const HeapMemoryUsage& rhs)
  22. {
  23. *this = rhs;
  24. }
  25. HeapMemoryUsage& HeapMemoryUsage::operator=(const HeapMemoryUsage& rhs)
  26. {
  27. m_budgetInBytes = rhs.m_budgetInBytes;
  28. m_totalResidentInBytes = rhs.m_totalResidentInBytes.load();
  29. m_usedResidentInBytes = rhs.m_usedResidentInBytes.load();
  30. m_uniqueAllocationBytes = rhs.m_uniqueAllocationBytes.load();
  31. m_fragmentation = rhs.m_fragmentation;
  32. return *this;
  33. }
  34. }