TransientImageDescriptor.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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/TransientImageDescriptor.h>
  9. #include <AzCore/Utils/TypeHash.h>
  10. namespace AZ::RHI
  11. {
  12. TransientImageDescriptor::TransientImageDescriptor(
  13. const AttachmentId& attachmentId,
  14. const ImageDescriptor& imageDescriptor,
  15. HardwareQueueClassMask supportedQueueMask,
  16. const ClearValue* optimizedClearValue)
  17. : m_attachmentId{attachmentId}
  18. , m_imageDescriptor{imageDescriptor}
  19. , m_supportedQueueMask{supportedQueueMask}
  20. , m_optimizedClearValue{optimizedClearValue}
  21. {}
  22. HashValue64 TransientImageDescriptor::GetHash(HashValue64 seed) const
  23. {
  24. seed = TypeHash64(m_attachmentId.GetHash(), seed);
  25. seed = m_imageDescriptor.GetHash(seed);
  26. seed = TypeHash64(m_supportedQueueMask, seed);
  27. if (m_optimizedClearValue)
  28. {
  29. seed = TypeHash64(m_optimizedClearValue->GetHash(seed), seed);
  30. }
  31. return seed;
  32. }
  33. }