SkinnedMeshDebugDisplay.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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/Base.h>
  10. #include <AzFramework/Entity/EntityDebugDisplayBus.h>
  11. #include <CrySystemBus.h>
  12. #include <Atom/Bootstrap/BootstrapNotificationBus.h>
  13. namespace AZ
  14. {
  15. namespace Render
  16. {
  17. //! This class is responsible for displaying stats about Atom's SkinnedMesh feature
  18. class SkinnedMeshDebugDisplay
  19. : private AzFramework::ViewportDebugDisplayEventBus::Handler
  20. , private CrySystemEventBus::Handler
  21. , private AZ::Render::Bootstrap::NotificationBus::Handler
  22. {
  23. public:
  24. SkinnedMeshDebugDisplay();
  25. ~SkinnedMeshDebugDisplay();
  26. private:
  27. // CrySystemEventBus::Handler overrides
  28. // Register the r_skinnedMeshDisplaySceneStats cvar
  29. void OnCrySystemInitialized(ISystem&, const SSystemInitParams&) override;
  30. void OnCrySystemShutdown(ISystem&) override;
  31. void OnCryEditorInitialized() override;
  32. // AzFramework::ViewportDebugDisplayEventBus overrides
  33. // Display the debug text if r_skinnedMeshDisplaySceneStats = 1
  34. void DisplayViewport2d(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay) override;
  35. // Get the RPI::SceneId, which can be used to query scene stats
  36. void OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) override;
  37. void GetSceneId();
  38. // CVar for toggling the display of the scene stats
  39. int r_skinnedMeshDisplaySceneStats = 0;
  40. // SceneId to query for the stats
  41. RPI::SceneId m_sceneId;
  42. };
  43. }// namespace Render
  44. }// namespace AZ