MultisampleState.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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/MultisampleState.h>
  9. namespace AZ::RHI
  10. {
  11. SamplePosition::SamplePosition(uint8_t x, uint8_t y)
  12. : m_x(x)
  13. , m_y(y)
  14. {
  15. AZ_Assert(
  16. m_x < Limits::Pipeline::MultiSampleCustomLocationGridSize && m_y < Limits::Pipeline::MultiSampleCustomLocationGridSize,
  17. "Invalid sample custom position (%d, %d)", m_x, m_y);
  18. }
  19. bool SamplePosition::operator != (const SamplePosition& other) const
  20. {
  21. return !(*this == other);
  22. }
  23. bool SamplePosition::operator == (const SamplePosition& other) const
  24. {
  25. return m_x == other.m_x && m_y == other.m_y;
  26. }
  27. MultisampleState::MultisampleState(uint16_t samples, uint16_t quality)
  28. : m_samples{samples}
  29. , m_quality{quality}
  30. {}
  31. bool MultisampleState::operator == (const MultisampleState& other) const
  32. {
  33. return m_customPositions == other.m_customPositions &&
  34. m_customPositionsCount == other.m_customPositionsCount &&
  35. m_samples == other.m_samples &&
  36. m_quality == other.m_quality;
  37. }
  38. bool MultisampleState::operator != (const MultisampleState& other) const
  39. {
  40. return !(*this == other);
  41. }
  42. }