DebuggerComponent.GraphicsInformationWindow.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. //------------------------------------------------------------
  2. // Game Framework
  3. // Copyright © 2013-2021 loyalsoft. All rights reserved.
  4. // Homepage: http://www.game7000.com/
  5. // Feedback: http://www.game7000.com/
  6. //------------------------------------------------------------
  7. using GameFramework;
  8. using UnityEngine;
  9. namespace UnityGameFramework.Runtime
  10. {
  11. public sealed partial class DebuggerComponent : GameFrameworkComponent
  12. {
  13. private sealed class GraphicsInformationWindow : ScrollableDebuggerWindowBase
  14. {
  15. protected override void OnDrawScrollableWindow()
  16. {
  17. GUILayout.Label("<b>Graphics Information</b>");
  18. GUILayout.BeginVertical("box");
  19. {
  20. DrawItem("Device ID", SystemInfo.graphicsDeviceID.ToString());
  21. DrawItem("Device Name", SystemInfo.graphicsDeviceName);
  22. DrawItem("Device Vendor ID", SystemInfo.graphicsDeviceVendorID.ToString());
  23. DrawItem("Device Vendor", SystemInfo.graphicsDeviceVendor);
  24. DrawItem("Device Type", SystemInfo.graphicsDeviceType.ToString());
  25. DrawItem("Device Version", SystemInfo.graphicsDeviceVersion);
  26. DrawItem("Memory Size", Utility.Text.Format("{0} MB", SystemInfo.graphicsMemorySize.ToString()));
  27. DrawItem("Multi Threaded", SystemInfo.graphicsMultiThreaded.ToString());
  28. #if UNITY_2019_3_OR_NEWER
  29. DrawItem("Rendering Threading Mode", SystemInfo.renderingThreadingMode.ToString());
  30. #endif
  31. #if UNITY_2020_1_OR_NEWER
  32. DrawItem("HRD Display Support Flags", SystemInfo.hdrDisplaySupportFlags.ToString());
  33. #endif
  34. DrawItem("Shader Level", GetShaderLevelString(SystemInfo.graphicsShaderLevel));
  35. DrawItem("Global Maximum LOD", Shader.globalMaximumLOD.ToString());
  36. #if UNITY_5_6_OR_NEWER
  37. DrawItem("Global Render Pipeline", Shader.globalRenderPipeline);
  38. #endif
  39. #if UNITY_2020_2_OR_NEWER
  40. DrawItem("Min OpenGLES Version", Graphics.minOpenGLESVersion.ToString());
  41. #endif
  42. #if UNITY_5_5_OR_NEWER
  43. DrawItem("Active Tier", Graphics.activeTier.ToString());
  44. #endif
  45. #if UNITY_2017_2_OR_NEWER
  46. DrawItem("Active Color Gamut", Graphics.activeColorGamut.ToString());
  47. #endif
  48. #if UNITY_2019_2_OR_NEWER
  49. DrawItem("Preserve Frame Buffer Alpha", Graphics.preserveFramebufferAlpha.ToString());
  50. #endif
  51. DrawItem("NPOT Support", SystemInfo.npotSupport.ToString());
  52. DrawItem("Max Texture Size", SystemInfo.maxTextureSize.ToString());
  53. DrawItem("Supported Render Target Count", SystemInfo.supportedRenderTargetCount.ToString());
  54. #if UNITY_2019_3_OR_NEWER
  55. DrawItem("Supported Random Write Target Count", SystemInfo.supportedRandomWriteTargetCount.ToString());
  56. #endif
  57. #if UNITY_5_4_OR_NEWER
  58. DrawItem("Copy Texture Support", SystemInfo.copyTextureSupport.ToString());
  59. #endif
  60. #if UNITY_5_5_OR_NEWER
  61. DrawItem("Uses Reversed ZBuffer", SystemInfo.usesReversedZBuffer.ToString());
  62. #endif
  63. #if UNITY_5_6_OR_NEWER
  64. DrawItem("Max Cubemap Size", SystemInfo.maxCubemapSize.ToString());
  65. DrawItem("Graphics UV Starts At Top", SystemInfo.graphicsUVStartsAtTop.ToString());
  66. #endif
  67. #if UNITY_2020_2_OR_NEWER
  68. DrawItem("Constant Buffer Offset Alignment", SystemInfo.constantBufferOffsetAlignment.ToString());
  69. #elif UNITY_2019_1_OR_NEWER
  70. DrawItem("Min Constant Buffer Offset Alignment", SystemInfo.minConstantBufferOffsetAlignment.ToString());
  71. #endif
  72. #if UNITY_2018_3_OR_NEWER
  73. DrawItem("Has Hidden Surface Removal On GPU", SystemInfo.hasHiddenSurfaceRemovalOnGPU.ToString());
  74. DrawItem("Has Dynamic Uniform Array Indexing In Fragment Shaders", SystemInfo.hasDynamicUniformArrayIndexingInFragmentShaders.ToString());
  75. #endif
  76. #if UNITY_2019_2_OR_NEWER
  77. DrawItem("Has Mip Max Level", SystemInfo.hasMipMaxLevel.ToString());
  78. #endif
  79. #if UNITY_2019_3_OR_NEWER
  80. DrawItem("Uses Load Store Actions", SystemInfo.usesLoadStoreActions.ToString());
  81. DrawItem("Max Compute Buffer Inputs Compute", SystemInfo.maxComputeBufferInputsCompute.ToString());
  82. DrawItem("Max Compute Buffer Inputs Domain", SystemInfo.maxComputeBufferInputsDomain.ToString());
  83. DrawItem("Max Compute Buffer Inputs Fragment", SystemInfo.maxComputeBufferInputsFragment.ToString());
  84. DrawItem("Max Compute Buffer Inputs Geometry", SystemInfo.maxComputeBufferInputsGeometry.ToString());
  85. DrawItem("Max Compute Buffer Inputs Hull", SystemInfo.maxComputeBufferInputsHull.ToString());
  86. DrawItem("Max Compute Buffer Inputs Vertex", SystemInfo.maxComputeBufferInputsVertex.ToString());
  87. DrawItem("Max Compute Work Group Size", SystemInfo.maxComputeWorkGroupSize.ToString());
  88. DrawItem("Max Compute Work Group Size X", SystemInfo.maxComputeWorkGroupSizeX.ToString());
  89. DrawItem("Max Compute Work Group Size Y", SystemInfo.maxComputeWorkGroupSizeY.ToString());
  90. DrawItem("Max Compute Work Group Size Z", SystemInfo.maxComputeWorkGroupSizeZ.ToString());
  91. #endif
  92. #if UNITY_5_3 || UNITY_5_4
  93. DrawItem("Supports Stencil", SystemInfo.supportsStencil.ToString());
  94. DrawItem("Supports Render Textures", SystemInfo.supportsRenderTextures.ToString());
  95. #endif
  96. DrawItem("Supports Sparse Textures", SystemInfo.supportsSparseTextures.ToString());
  97. DrawItem("Supports 3D Textures", SystemInfo.supports3DTextures.ToString());
  98. DrawItem("Supports Shadows", SystemInfo.supportsShadows.ToString());
  99. DrawItem("Supports Raw Shadow Depth Sampling", SystemInfo.supportsRawShadowDepthSampling.ToString());
  100. #if !UNITY_2019_1_OR_NEWER
  101. DrawItem("Supports Render To Cubemap", SystemInfo.supportsRenderToCubemap.ToString());
  102. DrawItem("Supports Image Effects", SystemInfo.supportsImageEffects.ToString());
  103. #endif
  104. DrawItem("Supports Compute Shader", SystemInfo.supportsComputeShaders.ToString());
  105. DrawItem("Supports Instancing", SystemInfo.supportsInstancing.ToString());
  106. #if UNITY_5_4_OR_NEWER
  107. DrawItem("Supports 2D Array Textures", SystemInfo.supports2DArrayTextures.ToString());
  108. DrawItem("Supports Motion Vectors", SystemInfo.supportsMotionVectors.ToString());
  109. #endif
  110. #if UNITY_5_5_OR_NEWER
  111. DrawItem("Supports Cubemap Array Textures", SystemInfo.supportsCubemapArrayTextures.ToString());
  112. #endif
  113. #if UNITY_5_6_OR_NEWER
  114. DrawItem("Supports 3D Render Textures", SystemInfo.supports3DRenderTextures.ToString());
  115. #endif
  116. #if UNITY_2017_2_OR_NEWER && !UNITY_2017_2_0 || UNITY_2017_1_4
  117. DrawItem("Supports Texture Wrap Mirror Once", SystemInfo.supportsTextureWrapMirrorOnce.ToString());
  118. #endif
  119. #if UNITY_2019_1_OR_NEWER
  120. DrawItem("Supports Graphics Fence", SystemInfo.supportsGraphicsFence.ToString());
  121. #elif UNITY_2017_3_OR_NEWER
  122. DrawItem("Supports GPU Fence", SystemInfo.supportsGPUFence.ToString());
  123. #endif
  124. #if UNITY_2017_3_OR_NEWER
  125. DrawItem("Supports Async Compute", SystemInfo.supportsAsyncCompute.ToString());
  126. DrawItem("Supports Multi-sampled Textures", SystemInfo.supportsMultisampledTextures.ToString());
  127. #endif
  128. #if UNITY_2018_1_OR_NEWER
  129. DrawItem("Supports Async GPU Readback", SystemInfo.supportsAsyncGPUReadback.ToString());
  130. DrawItem("Supports 32bits Index Buffer", SystemInfo.supports32bitsIndexBuffer.ToString());
  131. DrawItem("Supports Hardware Quad Topology", SystemInfo.supportsHardwareQuadTopology.ToString());
  132. #endif
  133. #if UNITY_2018_2_OR_NEWER
  134. DrawItem("Supports Mip Streaming", SystemInfo.supportsMipStreaming.ToString());
  135. DrawItem("Supports Multi-sample Auto Resolve", SystemInfo.supportsMultisampleAutoResolve.ToString());
  136. #endif
  137. #if UNITY_2018_3_OR_NEWER
  138. DrawItem("Supports Separated Render Targets Blend", SystemInfo.supportsSeparatedRenderTargetsBlend.ToString());
  139. #endif
  140. #if UNITY_2019_1_OR_NEWER
  141. DrawItem("Supports Set Constant Buffer", SystemInfo.supportsSetConstantBuffer.ToString());
  142. #endif
  143. #if UNITY_2019_3_OR_NEWER
  144. DrawItem("Supports Geometry Shaders", SystemInfo.supportsGeometryShaders.ToString());
  145. DrawItem("Supports Ray Tracing", SystemInfo.supportsRayTracing.ToString());
  146. DrawItem("Supports Tessellation Shaders", SystemInfo.supportsTessellationShaders.ToString());
  147. #endif
  148. #if UNITY_2020_1_OR_NEWER
  149. DrawItem("Supports Compressed 3D Textures", SystemInfo.supportsCompressed3DTextures.ToString());
  150. DrawItem("Supports Conservative Raster", SystemInfo.supportsConservativeRaster.ToString());
  151. DrawItem("Supports GPU Recorder", SystemInfo.supportsGpuRecorder.ToString());
  152. #endif
  153. #if UNITY_2020_2_OR_NEWER
  154. DrawItem("Supports Multi-sampled 2D Array Textures", SystemInfo.supportsMultisampled2DArrayTextures.ToString());
  155. DrawItem("Supports Multiview", SystemInfo.supportsMultiview.ToString());
  156. DrawItem("Supports Render Target Array Index From Vertex Shader", SystemInfo.supportsRenderTargetArrayIndexFromVertexShader.ToString());
  157. #endif
  158. }
  159. GUILayout.EndVertical();
  160. }
  161. private string GetShaderLevelString(int shaderLevel)
  162. {
  163. return Utility.Text.Format("Shader Model {0}.{1}", (shaderLevel / 10).ToString(), (shaderLevel % 10).ToString());
  164. }
  165. }
  166. }
  167. }