SkinnedMeshComputePass.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. private:
  29. void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override;
  30. void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override;
  31. // ShaderReloadNotificationBus::Handler overrides...
  32. void OnShaderReinitialized(const RPI::Shader& shader) override;
  33. void OnShaderVariantReinitialized(const RPI::ShaderVariant& shaderVariant) override;
  34. SkinnedMeshFeatureProcessor* GetSkinnedMeshFeatureProcessor();
  35. };
  36. }
  37. }