3
0

ReflectionScreenSpaceDownsampleDepthLinearChildPass.h 2.2 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/FullscreenTrianglePass.h>
  10. namespace AZ
  11. {
  12. namespace Render
  13. {
  14. //! Child pass for downsampling DepthLinear mips
  15. class ReflectionScreenSpaceDownsampleDepthLinearChildPass
  16. : public RPI::FullscreenTrianglePass
  17. {
  18. AZ_RPI_PASS(ReflectionScreenSpaceDownsampleDepthLinearChildPass);
  19. public:
  20. AZ_RTTI(Render::ReflectionScreenSpaceDownsampleDepthLinearChildPass, "{3863028B-3CA9-4F45-A7CC-EA2885593F83}", FullscreenTrianglePass);
  21. AZ_CLASS_ALLOCATOR(Render::ReflectionScreenSpaceDownsampleDepthLinearChildPass, SystemAllocator);
  22. //! Creates a new pass without a PassTemplate
  23. static RPI::Ptr<ReflectionScreenSpaceDownsampleDepthLinearChildPass> Create(const RPI::PassDescriptor& descriptor);
  24. void SetMipLevel(uint32_t mipLevel) { m_mipLevel = mipLevel; }
  25. private:
  26. explicit ReflectionScreenSpaceDownsampleDepthLinearChildPass(const RPI::PassDescriptor& descriptor);
  27. // Pass Overrides...
  28. void FrameBeginInternal(FramePrepareParams params) override;
  29. void CompileResources(const RHI::FrameGraphCompileContext& context) override;
  30. RHI::ShaderInputNameIndex m_invOutputScaleNameIndex = "m_invOutputScale";
  31. RHI::ShaderInputNameIndex m_mipLevelNameIndex = "m_mipLevel";
  32. RHI::ShaderInputNameIndex m_halfResolutionNameIndex = "m_halfResolution";
  33. RHI::ShaderInputNameIndex m_previousMipLevelNameIndex = "m_previousMipLevel";
  34. RHI::ShaderInputNameIndex m_previousMipWidthNameIndex = "m_previousMipWidth";
  35. RHI::ShaderInputNameIndex m_previousMipHeightNameIndex = "m_previousMipHeight";
  36. bool m_updateSrg = false;
  37. float m_invOutputScale = 1.0f;
  38. uint32_t m_mipLevel = 0;
  39. RHI::Size m_imageSize;
  40. bool m_halfResolution = false;
  41. };
  42. } // namespace RPI
  43. } // namespace AZ