FrameGraph.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #pragma once
  9. #include <Atom/RHI/FrameGraphCompiler.h>
  10. #include <Atom/RHI/FrameGraphExecuter.h>
  11. #include <Atom/RHI/FrameGraphExecuteGroup.h>
  12. #include <Atom/RHI/FrameGraph.h>
  13. #include <Atom/RHI/Scope.h>
  14. #include <AzCore/std/containers/unordered_set.h>
  15. namespace UnitTest
  16. {
  17. class FrameGraphCompiler
  18. : public AZ::RHI::FrameGraphCompiler
  19. {
  20. public:
  21. AZ_CLASS_ALLOCATOR(FrameGraphCompiler, AZ::SystemAllocator);
  22. private:
  23. AZ::RHI::ResultCode InitInternal() override;
  24. void ShutdownInternal() override;
  25. AZ::RHI::MessageOutcome CompileInternal(const AZ::RHI::FrameGraphCompileRequest& request) override;
  26. };
  27. class FrameGraphExecuteGroup
  28. : public AZ::RHI::FrameGraphExecuteGroup
  29. {
  30. using Base = AZ::RHI::FrameGraphExecuteGroup;
  31. public:
  32. AZ_CLASS_ALLOCATOR(FrameGraphExecuteGroup, AZ::SystemAllocator);
  33. void Init(const AZ::RHI::ScopeId& scopeId);
  34. const AZ::RHI::ScopeId& GetId() const;
  35. private:
  36. AZ::RHI::ScopeId m_scopeId;
  37. AZ::RHI::CommandList* m_commandList = nullptr;
  38. };
  39. class FrameGraphExecuter
  40. : public AZ::RHI::FrameGraphExecuter
  41. {
  42. public:
  43. AZ_CLASS_ALLOCATOR(FrameGraphExecuter, AZ::SystemAllocator);
  44. private:
  45. AZ::RHI::ResultCode InitInternal(const AZ::RHI::FrameGraphExecuterDescriptor&) override;
  46. void ShutdownInternal() override;
  47. void BeginInternal(const AZ::RHI::FrameGraph&) override;
  48. void ExecuteGroupInternal(AZ::RHI::FrameGraphExecuteGroup& group) override;
  49. void EndInternal() override;
  50. AZStd::unordered_set<AZ::RHI::ScopeId> m_scopeIds;
  51. };
  52. }