3
0

SkinJointIdPadding.cpp 790 B

123456789101112131415161718192021222324
  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/RPI.Reflect/Model/SkinJointIdPadding.h>
  9. #include <AzCore/base.h>
  10. namespace AZ
  11. {
  12. namespace RPI
  13. {
  14. uint32_t CalculateJointIdPaddingCount(uint32_t realJointIdCount)
  15. {
  16. // Raw buffer views must begin on 16-byte aligned boundaries.
  17. // For a two byte unit16_t joint id, we need to round up to a multiple of 8 elements
  18. uint32_t paddedNewJointIdCount = AZ::SizeAlignUp(realJointIdCount, 8);
  19. return paddedNewJointIdCount - realJointIdCount;
  20. }
  21. } //namespace RPI
  22. } // namespace AZ