SkinnedMeshComputePass.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 <SkinnedMesh/SkinnedMeshShaderOptionsCache.h>
  10. #include <Atom/RPI.Public/Pass/ComputePass.h>
  11. #include <Atom/RHI.Reflect/Base.h>
  12. namespace AZ
  13. {
  14. namespace Render
  15. {
  16. class SkinnedMeshFeatureProcessor;
  17. //! The skinned mesh compute pass submits dispatch items for skinning. The dispatch items are cleared every frame, so it needs to be re-populated.
  18. class SkinnedMeshComputePass
  19. : public RPI::ComputePass
  20. {
  21. AZ_RPI_PASS(SkinnedMeshComputePass);
  22. public:
  23. AZ_RTTI(AZ::Render::SkinnedMeshComputePass, "{CE046FFC-B870-40EE-872A-DB0958B97CC3}", RPI::ComputePass);
  24. AZ_CLASS_ALLOCATOR(SkinnedMeshComputePass, SystemAllocator);
  25. SkinnedMeshComputePass(const RPI::PassDescriptor& descriptor);
  26. static RPI::Ptr<SkinnedMeshComputePass> Create(const RPI::PassDescriptor& descriptor);
  27. Data::Instance<RPI::Shader> GetShader() const;
  28. void SetFeatureProcessor(SkinnedMeshFeatureProcessor* m_skinnedMeshFeatureProcessor);
  29. private:
  30. void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override;
  31. void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override;
  32. // ShaderReloadNotificationBus::Handler overrides...
  33. void OnShaderReinitialized(const RPI::Shader& shader) override;
  34. void OnShaderVariantReinitialized(const RPI::ShaderVariant& shaderVariant) override;
  35. SkinnedMeshFeatureProcessor* m_skinnedMeshFeatureProcessor = nullptr;
  36. };
  37. }
  38. }