DebuggerComponent.GraphicsInformationWindow.cs 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //------------------------------------------------------------
  2. // Game Framework v3.x
  3. // Copyright © 2013-2017 Jiang Yin. All rights reserved.
  4. // Homepage: http://gameframework.cn/
  5. // Feedback: mailto:jiangyin@gameframework.cn
  6. //------------------------------------------------------------
  7. using UnityEngine;
  8. namespace UnityGameFramework.Runtime
  9. {
  10. public partial class DebuggerComponent
  11. {
  12. private sealed class GraphicsInformationWindow : ScrollableDebuggerWindowBase
  13. {
  14. protected override void OnDrawScrollableWindow()
  15. {
  16. GUILayout.Label("<b>Graphics Information</b>");
  17. GUILayout.BeginVertical("box");
  18. {
  19. DrawItem("Device ID:", SystemInfo.graphicsDeviceID.ToString());
  20. DrawItem("Device Name:", SystemInfo.graphicsDeviceName);
  21. DrawItem("Device Vendor ID:", SystemInfo.graphicsDeviceVendorID.ToString());
  22. DrawItem("Device Vendor:", SystemInfo.graphicsDeviceVendor);
  23. DrawItem("Device Type:", SystemInfo.graphicsDeviceType.ToString());
  24. DrawItem("Device Version:", SystemInfo.graphicsDeviceVersion);
  25. DrawItem("Memory Size:", string.Format("{0} MB", SystemInfo.graphicsMemorySize.ToString()));
  26. DrawItem("Multi Threaded:", SystemInfo.graphicsMultiThreaded.ToString());
  27. DrawItem("Shader Level:", GetShaderLevelString(SystemInfo.graphicsShaderLevel));
  28. DrawItem("NPOT Support:", SystemInfo.npotSupport.ToString());
  29. DrawItem("Max Texture Size:", SystemInfo.maxTextureSize.ToString());
  30. #if UNITY_5_6_OR_NEWER
  31. DrawItem("Max Cubemap Size:", SystemInfo.maxCubemapSize.ToString());
  32. #endif
  33. #if UNITY_5_4_OR_NEWER
  34. DrawItem("Copy Texture Support:", SystemInfo.copyTextureSupport.ToString());
  35. #endif
  36. DrawItem("Supported Render Target Count:", SystemInfo.supportedRenderTargetCount.ToString());
  37. #if UNITY_5_3 || UNITY_5_4
  38. DrawItem("Supports Stencil:", SystemInfo.supportsStencil.ToString());
  39. DrawItem("Supports Render Textures:", SystemInfo.supportsRenderTextures.ToString());
  40. #endif
  41. DrawItem("Supports Sparse Textures:", SystemInfo.supportsSparseTextures.ToString());
  42. DrawItem("Supports 3D Textures:", SystemInfo.supports3DTextures.ToString());
  43. #if UNITY_5_6_OR_NEWER
  44. DrawItem("Supports 3D Render Textures:", SystemInfo.supports3DRenderTextures.ToString());
  45. #endif
  46. #if UNITY_5_4_OR_NEWER
  47. DrawItem("Supports 2D Array Textures:", SystemInfo.supports2DArrayTextures.ToString());
  48. #endif
  49. DrawItem("Supports Shadows:", SystemInfo.supportsShadows.ToString());
  50. DrawItem("Supports Raw Shadow Depth Sampling:", SystemInfo.supportsRawShadowDepthSampling.ToString());
  51. DrawItem("Supports Render To Cubemap:", SystemInfo.supportsRenderToCubemap.ToString());
  52. DrawItem("Supports Compute Shader:", SystemInfo.supportsComputeShaders.ToString());
  53. DrawItem("Supports Instancing:", SystemInfo.supportsInstancing.ToString());
  54. DrawItem("Supports Image Effects:", SystemInfo.supportsImageEffects.ToString());
  55. #if UNITY_5_5_OR_NEWER
  56. DrawItem("Supports Cubemap Array Textures:", SystemInfo.supportsCubemapArrayTextures.ToString());
  57. #endif
  58. #if UNITY_5_4_OR_NEWER
  59. DrawItem("Supports Motion Vectors:", SystemInfo.supportsMotionVectors.ToString());
  60. #endif
  61. #if UNITY_5_6_OR_NEWER
  62. DrawItem("Graphics UV Starts At Top:", SystemInfo.graphicsUVStartsAtTop.ToString());
  63. #endif
  64. #if UNITY_5_5_OR_NEWER
  65. DrawItem("Uses Reversed ZBuffer:", SystemInfo.usesReversedZBuffer.ToString());
  66. #endif
  67. }
  68. GUILayout.EndVertical();
  69. }
  70. private string GetShaderLevelString(int shaderLevel)
  71. {
  72. return string.Format("Shader Model {0}.{1}", (shaderLevel / 10).ToString(), (shaderLevel % 10).ToString());
  73. }
  74. }
  75. }
  76. }