Module.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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/ReflectSystemComponent.h>
  9. #include <RHI.Private/FactoryManagerSystemComponent.h>
  10. #include <RHI.Private/FactoryRegistrationFinalizerSystemComponent.h>
  11. #include <RHI.Profiler/GraphicsProfilerSystemComponent.h>
  12. #include <AzCore/Module/Module.h>
  13. namespace AZ::RHI
  14. {
  15. //! This module is in charge of loading the RHI reflection descriptor and the
  16. //! system components in charge of managing the different factory backends.
  17. class PlatformModule
  18. : public AZ::Module
  19. {
  20. public:
  21. AZ_RTTI(PlatformModule, "{C34AA64E-0983-4D30-A33C-0D7C7676A20E}", Module);
  22. PlatformModule()
  23. {
  24. m_descriptors.insert(m_descriptors.end(), {
  25. ReflectSystemComponent::CreateDescriptor(),
  26. FactoryManagerSystemComponent::CreateDescriptor(),
  27. FactoryRegistrationFinalizerSystemComponent::CreateDescriptor(),
  28. GraphicsProfilerSystemComponent::CreateDescriptor()
  29. });
  30. }
  31. ~PlatformModule() override = default;
  32. AZ::ComponentTypeList GetRequiredSystemComponents() const override
  33. {
  34. return AZ::ComponentTypeList
  35. {
  36. azrtti_typeid<FactoryManagerSystemComponent>(),
  37. azrtti_typeid<FactoryRegistrationFinalizerSystemComponent>()
  38. };
  39. }
  40. };
  41. }
  42. #if defined(O3DE_GEM_NAME)
  43. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME, _Private), AZ::RHI::PlatformModule)
  44. #else
  45. AZ_DECLARE_MODULE_CLASS(Gem_Atom_RHI_Private, AZ::RHI::PlatformModule)
  46. #endif