3
0

SkinJointIdPaddingTests.cpp 824 B

1234567891011121314151617181920212223
  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 <AzTest/AzTest.h>
  9. #include <Atom/RPI.Reflect/Model/SkinJointIdPadding.h>
  10. namespace UnitTest
  11. {
  12. TEST(SkinJointIdPaddingTest, CalculateJointIdPaddingCount_Is16ByteAligned)
  13. {
  14. for (uint32_t jointIdCount = 1; jointIdCount <= 32; ++jointIdCount)
  15. {
  16. uint32_t byteSize = (AZ::RPI::CalculateJointIdPaddingCount(jointIdCount) + jointIdCount) * sizeof(uint16_t);
  17. // Validate that the size in bytes of a given number of joints plus their padding will always be 16-byte aligned
  18. EXPECT_EQ(byteSize % 16, 0);
  19. }
  20. }
  21. } // namespace UnitTest