RenderDebugFeatureProcessor.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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/Feature/Debug/RenderDebugFeatureProcessorInterface.h>
  10. #include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
  11. #include <AtomCore/Instance/Instance.h>
  12. #include <Debug/RenderDebugSettings.h>
  13. namespace AZ::Render
  14. {
  15. class RenderDebugFeatureProcessor final
  16. : public AZ::Render::RenderDebugFeatureProcessorInterface
  17. {
  18. public:
  19. AZ_CLASS_ALLOCATOR(RenderDebugFeatureProcessor, AZ::SystemAllocator)
  20. AZ_RTTI(AZ::Render::RenderDebugFeatureProcessor, "{1F14912D-43E1-4992-9822-BE8967E59EA3}", AZ::Render::RenderDebugFeatureProcessorInterface);
  21. static void Reflect(AZ::ReflectContext* context);
  22. RenderDebugFeatureProcessor();
  23. virtual ~RenderDebugFeatureProcessor() = default;
  24. //! RenderDebugFeatureProcessorInterface overrides...
  25. RenderDebugSettingsInterface* GetSettingsInterface() override;
  26. void OnRenderDebugComponentAdded() override;
  27. void OnRenderDebugComponentRemoved() override;
  28. // FeatureProcessor overrides ...
  29. void Activate() override;
  30. void Deactivate() override;
  31. void Simulate(const RPI::FeatureProcessor::SimulatePacket& packet) override;
  32. void Render(const RPI::FeatureProcessor::RenderPacket& packet) override;
  33. private:
  34. static constexpr const char* FeatureProcessorName = "RenderDebugFeatureProcessor";
  35. RenderDebugFeatureProcessor(const RenderDebugFeatureProcessor&) = delete;
  36. AZStd::unique_ptr<RenderDebugSettings> m_settings = nullptr;
  37. // Scene and View SRG
  38. Data::Instance<RPI::ShaderResourceGroup> m_sceneSrg = nullptr;
  39. Data::Instance<RPI::ShaderResourceGroup> m_viewSrg = nullptr;
  40. // View SRG members
  41. RHI::ShaderInputNameIndex m_renderDebugOptionsIndex = "m_renderDebugOptions";
  42. RHI::ShaderInputNameIndex m_renderDebugViewModeIndex = "m_renderDebugViewMode";
  43. // Scene SRG members
  44. RHI::ShaderInputNameIndex m_debuggingEnabledIndex = "m_debuggingEnabled";
  45. RHI::ShaderInputNameIndex m_debugOverrideBaseColorIndex = "m_debugOverrideBaseColor";
  46. RHI::ShaderInputNameIndex m_debugOverrideRoughnessIndex = "m_debugOverrideRoughness";
  47. RHI::ShaderInputNameIndex m_debugOverrideMetallicIndex = "m_debugOverrideMetallic";
  48. RHI::ShaderInputNameIndex m_debugLightingDirectionIndex = "m_debugLightingDirection";
  49. RHI::ShaderInputNameIndex m_debugLightingIntensityIndex = "m_debugLightingIntensity";
  50. RHI::ShaderInputNameIndex m_customDebugFloatIndex01 = "m_customDebugFloat01";
  51. RHI::ShaderInputNameIndex m_customDebugFloatIndex02 = "m_customDebugFloat02";
  52. RHI::ShaderInputNameIndex m_customDebugFloatIndex03 = "m_customDebugFloat03";
  53. RHI::ShaderInputNameIndex m_customDebugFloatIndex04 = "m_customDebugFloat04";
  54. RHI::ShaderInputNameIndex m_customDebugFloatIndex05 = "m_customDebugFloat05";
  55. RHI::ShaderInputNameIndex m_customDebugFloatIndex06 = "m_customDebugFloat06";
  56. RHI::ShaderInputNameIndex m_customDebugFloatIndex07 = "m_customDebugFloat07";
  57. RHI::ShaderInputNameIndex m_customDebugFloatIndex08 = "m_customDebugFloat08";
  58. RHI::ShaderInputNameIndex m_customDebugFloatIndex09 = "m_customDebugFloat09";
  59. Name m_shaderDebugEnableOptionName = Name("o_shader_debugging_enabled");
  60. u32 m_debugComponentCount = 0;
  61. };
  62. }