MSAAResolveFullScreenPass.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #include <Atom/RPI.Public/Pass/Specific/MSAAResolveFullScreenPass.h>
  9. #include <Atom/RPI.Public/Pass/Pass.h>
  10. #include <Atom/RPI.Public/RenderPipeline.h>
  11. namespace AZ
  12. {
  13. namespace RPI
  14. {
  15. RPI::Ptr<MSAAResolveFullScreenPass> MSAAResolveFullScreenPass::Create(const RPI::PassDescriptor& descriptor)
  16. {
  17. RPI::Ptr<MSAAResolveFullScreenPass> pass = aznew MSAAResolveFullScreenPass(descriptor);
  18. return AZStd::move(pass);
  19. }
  20. MSAAResolveFullScreenPass::MSAAResolveFullScreenPass(const RPI::PassDescriptor& descriptor)
  21. : RPI::FullscreenTrianglePass(descriptor)
  22. {
  23. }
  24. bool MSAAResolveFullScreenPass::IsEnabled() const
  25. {
  26. // check Pass base class first to see if the Pass is explicitly disabled
  27. if (!Pass::IsEnabled())
  28. {
  29. return false;
  30. }
  31. // check render pipeline MSAA sample count
  32. return (m_pipeline->GetRenderSettings().m_multisampleState.m_samples > 1);
  33. }
  34. } // namespace RPI
  35. } // namespace AZ