diff --git a/Assets/Sentry/Scripts/Sentry.cs b/Assets/Sentry/Scripts/Sentry.cs index ffcb03c6f..247d1d1bb 100644 --- a/Assets/Sentry/Scripts/Sentry.cs +++ b/Assets/Sentry/Scripts/Sentry.cs @@ -4,6 +4,88 @@ namespace Sentry { + /// + /// Graphics device unit + /// + /// + /// The value types are not made nullable due to limitation of + /// + /// + [Serializable] + public class Gpu + { + /// + /// The name of the graphics device + /// + /// + /// iPod touch: Apple A8 GPU + /// Samsung S7: Mali-T880 + /// + public string name; + + /// + /// The PCI Id of the graphics device + /// + /// + /// Combined with uniquely identifies the GPU + /// + public int id; + + /// + /// The PCI vendor Id of the graphics device + /// + /// + /// Combined with uniquely identifies the GPU + /// + /// + /// + public int vendor_id; + + /// + /// The vendor name reported by the graphic device + /// + /// + /// Apple, ARM, WebKit + /// + public string vendor_name; + + /// + /// Total GPU memory available in mega-bytes. + /// + public int memory_size; + + /// + /// Device type + /// + /// The low level API used + /// Metal, Direct3D11, OpenGLES3, PlayStation4, XboxOne + public string api_type; + + /// + /// Whether the GPU is multi-threaded rendering or not. + /// + /// Type hre should be Nullable{bool} which isn't supported by JsonUtility> + public bool multi_threaded_rendering; + + /// + /// The Version of the API of the graphics device + /// + /// + /// iPod touch: Metal + /// Android: OpenGL ES 3.2 v1.r22p0-01rel0.f294e54ceb2cb2d81039204fa4b0402e + /// WebGL Windows: OpenGL ES 3.0 (WebGL 2.0 (OpenGL ES 3.0 Chromium)) + /// OpenGL 2.0, Direct3D 9.0c + /// + public string version; + + /// + /// The Non-Power-Of-Two support level + /// + /// + /// Full + /// + public string npot_support; + } [Serializable] public class SdkVersion { @@ -32,14 +114,11 @@ public class Context public ContextPair device_model; public ContextPair device_name; public ContextPair device_type; - public ContextPair gpu_name; - public ContextPair gpu_id; - public ContextPair gpu_type; - public ContextPair gpu_vendor; - public ContextPair gpu_vendor_id; public ContextPair app_build; public ContextPair app_version; + public Gpu gpu; + public Context(string app_version) { os = new ContextPair("os", SystemInfo.operatingSystem); @@ -47,17 +126,25 @@ public Context(string app_version) device_model = new ContextPair("device_model", SystemInfo.deviceModel); device_name = new ContextPair("device_name", SystemInfo.deviceName); device_type = new ContextPair("device_type", SystemInfo.deviceType.ToString()); - gpu_name = new ContextPair("gpu_name", SystemInfo.graphicsDeviceName); - gpu_id = new ContextPair("gpu_id", SystemInfo.graphicsDeviceID.ToString()); - gpu_type = new ContextPair("gpu_name", SystemInfo.graphicsDeviceName); - gpu_vendor = new ContextPair("gpu_id", SystemInfo.graphicsDeviceVendor); - gpu_vendor_id = new ContextPair("gpu_name", SystemInfo.graphicsDeviceVendorID.ToString()); #if UNITY_EDITOR app_build = new ContextPair("app_build", "editor"); #else app_build = new _ContextPair("app_build", "build"); #endif this.app_version = new ContextPair("app_version", app_version); + + gpu = new Gpu + { + id = SystemInfo.graphicsDeviceID, + name = SystemInfo.graphicsDeviceName, + vendor_id = SystemInfo.graphicsDeviceVendorID, + vendor_name = SystemInfo.graphicsDeviceVendor, + memory_size = SystemInfo.graphicsMemorySize, + multi_threaded_rendering = SystemInfo.graphicsMultiThreaded, + npot_support = SystemInfo.npotSupport.ToString(), + version = SystemInfo.graphicsDeviceVersion, + api_type = SystemInfo.graphicsDeviceType.ToString() + }; } } @@ -206,4 +293,4 @@ public Dsn(string dsn) callUri = builder.Uri; } } -} \ No newline at end of file +}