DiffuseProbeGridPreparePass.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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/RPI.Public/Pass/RenderPass.h>
  10. #include <Atom/RPI.Public/Shader/Shader.h>
  11. #include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
  12. #include <Render/DiffuseProbeGrid.h>
  13. #include <Render/DiffuseProbeGridFeatureProcessor.h>
  14. namespace AZ
  15. {
  16. namespace Render
  17. {
  18. //! Compute shader that updates grid data for DiffuseProbeGrids
  19. class DiffuseProbeGridPreparePass final
  20. : public RPI::RenderPass
  21. {
  22. public:
  23. AZ_RPI_PASS(DiffuseProbeGridPreparePass);
  24. AZ_RTTI(AZ::Render::DiffuseProbeGridPreparePass, "{5934A485-2550-4100-852C-04A375BCE44E}", RPI::RenderPass);
  25. AZ_CLASS_ALLOCATOR(DiffuseProbeGridPreparePass, SystemAllocator);
  26. virtual ~DiffuseProbeGridPreparePass() = default;
  27. static RPI::Ptr<DiffuseProbeGridPreparePass> Create(const RPI::PassDescriptor& descriptor);
  28. private:
  29. DiffuseProbeGridPreparePass(const RPI::PassDescriptor& descriptor);
  30. void LoadShader();
  31. // Pass overrides
  32. bool IsEnabled() const override;
  33. void SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) override;
  34. void CompileResources(const RHI::FrameGraphCompileContext& context) override;
  35. void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override;
  36. // shader
  37. Data::Instance<RPI::Shader> m_shader;
  38. const RHI::PipelineState* m_pipelineState = nullptr;
  39. RHI::Ptr<RHI::ShaderResourceGroupLayout> m_srgLayout;
  40. RHI::DispatchDirect m_dispatchArgs;
  41. };
  42. } // namespace Render
  43. } // namespace AZ