LyShineDebug.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #ifndef _RELEASE
  10. #include <AzCore/std/containers/vector.h>
  11. #include <Atom/RPI.Reflect/Image/Image.h>
  12. #include <AtomCore/Instance/Instance.h>
  13. #endif
  14. #include <CryCommon/ISystem.h>
  15. ////////////////////////////////////////////////////////////////////////////////////////////////////
  16. //! Class for drawing test displays for testing the LyShine functionality
  17. //
  18. //! This is currently implemented as console variables and commands
  19. class LyShineDebug
  20. {
  21. public: // static member functions
  22. //! Initialize debug vars
  23. static void Initialize();
  24. //! This is called when the game terminates
  25. static void Reset();
  26. //! Do the debug render
  27. static void RenderDebug();
  28. DeclareStaticConstIntCVar(CV_r_DebugUIDraw2dFont, 0);
  29. DeclareStaticConstIntCVar(CV_r_DebugUIDraw2dImage, 0);
  30. DeclareStaticConstIntCVar(CV_r_DebugUIDraw2dLine, 0);
  31. DeclareStaticConstIntCVar(CV_r_DebugUIDraw2dDefer, 0);
  32. #ifndef _RELEASE
  33. //! Shared structures used for debug console commands
  34. struct DebugInfoRenderGraph
  35. {
  36. int m_numPrimitives;
  37. int m_numRenderNodes;
  38. int m_numTriangles;
  39. int m_numUniqueTextures;
  40. int m_numMasks;
  41. int m_numRTs;
  42. int m_numNodesDueToMask;
  43. int m_numNodesDueToRT;
  44. int m_numNodesDueToBlendMode;
  45. int m_numNodesDueToSrgb;
  46. int m_numNodesDueToMaxVerts;
  47. int m_numNodesDueToTextures;
  48. bool m_wasBuiltThisFrame;
  49. AZ::u64 m_timeGraphLastBuiltMs;
  50. bool m_isReusingRenderTargets;
  51. };
  52. struct DebugInfoTextureUsage
  53. {
  54. AZ::Data::Instance<AZ::RPI::Image> m_texture;
  55. bool m_isClampTextureUsage;
  56. int m_numCanvasesUsed;
  57. int m_numDrawCallsUsed;
  58. int m_numDrawCallsWhereExceedingMaxTextures;
  59. void* m_lastContextUsed;
  60. };
  61. struct DebugInfoDrawCallReport
  62. {
  63. AZStd::vector<DebugInfoTextureUsage> m_textures;
  64. };
  65. #endif
  66. };