SilhouetteCompositePass.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 <AzCore/Memory/SystemAllocator.h>
  10. #include <Atom/RPI.Public/Pass/FullscreenTrianglePass.h>
  11. namespace AZ::Render
  12. {
  13. class SilhouetteFeatureProcessor;
  14. // Wrapper on top of the RPI::FullscreenTrianglePass to skip the submit of the draw item
  15. // if there's no objects that draw into the silhouette gather pass.
  16. // We don't enable/disable the pass because that causes render pass rebuilding when using subpass merging.
  17. class SilhouetteCompositePass final
  18. : public RPI::FullscreenTrianglePass
  19. {
  20. AZ_RPI_PASS(SilhouetteCompositePass);
  21. public:
  22. AZ_RTTI(SilhouetteCompositePass, "{D5185238-790C-4B1D-A12E-8193EA25EF76}", RPI::FullscreenTrianglePass);
  23. AZ_CLASS_ALLOCATOR(SilhouetteCompositePass, SystemAllocator);
  24. ~SilhouetteCompositePass() = default;
  25. static RPI::Ptr<SilhouetteCompositePass> Create(const RPI::PassDescriptor& descriptor);
  26. protected:
  27. SilhouetteCompositePass(const RPI::PassDescriptor& descriptor);
  28. // Pass behavior overrides...
  29. void InitializeInternal() override;
  30. // Scope producer functions...
  31. void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override;
  32. void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override;
  33. const SilhouetteFeatureProcessor* m_featureProcessor = nullptr;
  34. };
  35. } // namespace AZ::Render