3
0

ShaderVariantStatisticData.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  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<Data/ShaderVariantStatisticData.h>
  9. namespace ShaderManagementConsole
  10. {
  11. void ShaderVariantStatisticData::Reflect(AZ::ReflectContext* context)
  12. {
  13. if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
  14. {
  15. serializeContext->Class<ShaderVariantStatisticData>()
  16. ->Version(1)
  17. ->Field("OptionUsage", &ShaderVariantStatisticData::m_shaderOptionUsage)
  18. ->Field("VariantUsage", &ShaderVariantStatisticData::m_shaderVariantUsage)
  19. ;
  20. }
  21. if (auto behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
  22. {
  23. behaviorContext->Class<ShaderVariantStatisticData>("ShaderVariantStatisticData")
  24. ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation)
  25. ->Attribute(AZ::Script::Attributes::Category, "Shader")
  26. ->Attribute(AZ::Script::Attributes::Module, "shader")
  27. ->Property("shaderOptionUsage", BehaviorValueGetter(&ShaderVariantStatisticData::m_shaderOptionUsage), BehaviorValueSetter(&ShaderVariantStatisticData::m_shaderOptionUsage))
  28. ->Property("shaderVariantUsage", BehaviorValueGetter(&ShaderVariantStatisticData::m_shaderVariantUsage), BehaviorValueSetter(&ShaderVariantStatisticData::m_shaderVariantUsage))
  29. ;
  30. }
  31. }
  32. }