3
0

PrecompiledShaderAssetSourceData.cpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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/Shader/PrecompiledShaderAssetSourceData.h>
  9. #include <AzCore/RTTI/ReflectContext.h>
  10. #include <AzCore/Serialization/SerializeContext.h>
  11. namespace AZ
  12. {
  13. namespace RPI
  14. {
  15. void PrecompiledRootShaderVariantAssetSourceData::Reflect(ReflectContext* context)
  16. {
  17. if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
  18. {
  19. serializeContext->Class<PrecompiledRootShaderVariantAssetSourceData>()
  20. ->Version(0)
  21. ->Field("APIName", &PrecompiledRootShaderVariantAssetSourceData::m_apiName)
  22. ->Field("RootShaderVariantAssetFileName", &PrecompiledRootShaderVariantAssetSourceData::m_rootShaderVariantAssetFileName)
  23. ;
  24. }
  25. }
  26. void PrecompiledSupervariantSourceData::Reflect(ReflectContext* context)
  27. {
  28. PrecompiledRootShaderVariantAssetSourceData::Reflect(context);
  29. if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
  30. {
  31. serializeContext->Class<PrecompiledSupervariantSourceData>()
  32. ->Version(0)
  33. ->Field("Name", &PrecompiledSupervariantSourceData::m_name)
  34. ->Field("RootShaderVariantAssets", &PrecompiledSupervariantSourceData::m_rootShaderVariantAssets)
  35. ;
  36. }
  37. }
  38. void PrecompiledShaderAssetSourceData::Reflect(ReflectContext* context)
  39. {
  40. PrecompiledSupervariantSourceData::Reflect(context);
  41. if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
  42. {
  43. serializeContext->Class<PrecompiledShaderAssetSourceData>()
  44. ->Version(2) // ATOM-15740
  45. ->Field("ShaderAssetFileName", &PrecompiledShaderAssetSourceData::m_shaderAssetFileName)
  46. ->Field("PlatformIdentifiers", &PrecompiledShaderAssetSourceData::m_platformIdentifiers)
  47. ->Field("Supervariants", &PrecompiledShaderAssetSourceData::m_supervariants)
  48. ;
  49. }
  50. }
  51. } // namespace RPI
  52. } // namespace AZ