AttachmentLoadStoreAction.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 <AzCore/Serialization/SerializeContext.h>
  9. #include <Atom/RHI.Reflect/AttachmentLoadStoreAction.h>
  10. namespace AZ::RHI
  11. {
  12. void AttachmentLoadStoreAction::Reflect(AZ::ReflectContext* context)
  13. {
  14. if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
  15. {
  16. serializeContext->Class<AttachmentLoadStoreAction>()
  17. ->Version(1)
  18. ->Field("ClearValue", &AttachmentLoadStoreAction::m_clearValue)
  19. ->Field("LoadAction", &AttachmentLoadStoreAction::m_loadAction)
  20. ->Field("StoreAction", &AttachmentLoadStoreAction::m_storeAction)
  21. ->Field("LoadActionStencil", &AttachmentLoadStoreAction::m_loadActionStencil)
  22. ->Field("StoreActionStencil", &AttachmentLoadStoreAction::m_storeActionStencil)
  23. ;
  24. }
  25. }
  26. AttachmentLoadStoreAction::AttachmentLoadStoreAction(
  27. const ClearValue& clearValue,
  28. AttachmentLoadAction loadAction,
  29. AttachmentStoreAction storeAction,
  30. AttachmentLoadAction loadActionStencil,
  31. AttachmentStoreAction storeActionStencil)
  32. : m_clearValue{ clearValue }
  33. , m_loadAction{ loadAction }
  34. , m_storeAction{ storeAction }
  35. , m_loadActionStencil{ loadActionStencil }
  36. , m_storeActionStencil{ storeActionStencil }
  37. {}
  38. bool AttachmentLoadStoreAction::operator==(const AttachmentLoadStoreAction& other) const
  39. {
  40. return
  41. m_clearValue == other.m_clearValue &&
  42. m_loadAction == other.m_loadAction &&
  43. m_storeAction == other.m_storeAction &&
  44. m_loadActionStencil == other.m_loadActionStencil &&
  45. m_storeActionStencil == other.m_storeActionStencil;
  46. }
  47. }