4
4
5
5
namespace Sentry
6
6
{
7
+ /// <summary>
8
+ /// Graphics device unit
9
+ /// </summary>
10
+ /// <remarks>
11
+ /// The value types are not made nullable due to limitation of <see cref="JsonUtility"/>
12
+ /// </remarks>
13
+ /// <seealso href="https://feedback.unity3d.com/suggestions/add-support-for-nullable-types-to-jsonutility"/>
14
+ [ Serializable ]
15
+ public class Gpu
16
+ {
17
+ /// <summary>
18
+ /// The name of the graphics device
19
+ /// </summary>
20
+ /// <example>
21
+ /// iPod touch: Apple A8 GPU
22
+ /// Samsung S7: Mali-T880
23
+ /// </example>
24
+ public string name ;
25
+
26
+ /// <summary>
27
+ /// The PCI Id of the graphics device
28
+ /// </summary>
29
+ /// <remarks>
30
+ /// Combined with <see cref="vendor_id"/> uniquely identifies the GPU
31
+ /// </remarks>
32
+ public int id ;
33
+
34
+ /// <summary>
35
+ /// The PCI vendor Id of the graphics device
36
+ /// </summary>
37
+ /// <remarks>
38
+ /// Combined with <see cref="Id"/> uniquely identifies the GPU
39
+ /// </remarks>
40
+ /// <seealso href="https://docs.microsoft.com/en-us/windows-hardware/drivers/install/identifiers-for-pci-devices"/>
41
+ /// <seealso href="http://pci-ids.ucw.cz/read/PC/"/>
42
+ public int vendor_id ;
43
+
44
+ /// <summary>
45
+ /// The vendor name reported by the graphic device
46
+ /// </summary>
47
+ /// <example>
48
+ /// Apple, ARM, WebKit
49
+ /// </example>
50
+ public string vendor_name ;
51
+
52
+ /// <summary>
53
+ /// Total GPU memory available in mega-bytes.
54
+ /// </summary>
55
+ public int memory_size ;
56
+
57
+ /// <summary>
58
+ /// Device type
59
+ /// </summary>
60
+ /// <remarks>The low level API used</remarks>
61
+ /// <example>Metal, Direct3D11, OpenGLES3, PlayStation4, XboxOne</example>
62
+ public string api_type ;
63
+
64
+ /// <summary>
65
+ /// Whether the GPU is multi-threaded rendering or not.
66
+ /// </summary>
67
+ /// <remarks>Type hre should be Nullable{bool} which isn't supported by JsonUtility></remarks>
68
+ public bool multi_threaded_rendering ;
69
+
70
+ /// <summary>
71
+ /// The Version of the API of the graphics device
72
+ /// </summary>
73
+ /// <example>
74
+ /// iPod touch: Metal
75
+ /// Android: OpenGL ES 3.2 v1.r22p0-01rel0.f294e54ceb2cb2d81039204fa4b0402e
76
+ /// WebGL Windows: OpenGL ES 3.0 (WebGL 2.0 (OpenGL ES 3.0 Chromium))
77
+ /// OpenGL 2.0, Direct3D 9.0c
78
+ /// </example>
79
+ public string version ;
80
+
81
+ /// <summary>
82
+ /// The Non-Power-Of-Two support level
83
+ /// </summary>
84
+ /// <example>
85
+ /// Full
86
+ /// </example>
87
+ public string npot_support ;
88
+ }
7
89
[ Serializable ]
8
90
public class SdkVersion
9
91
{
@@ -32,32 +114,37 @@ public class Context
32
114
public ContextPair device_model ;
33
115
public ContextPair device_name ;
34
116
public ContextPair device_type ;
35
- public ContextPair gpu_name ;
36
- public ContextPair gpu_id ;
37
- public ContextPair gpu_type ;
38
- public ContextPair gpu_vendor ;
39
- public ContextPair gpu_vendor_id ;
40
117
public ContextPair app_build ;
41
118
public ContextPair app_version ;
42
119
120
+ public Gpu gpu ;
121
+
43
122
public Context ( string app_version )
44
123
{
45
124
os = new ContextPair ( "os" , SystemInfo . operatingSystem ) ;
46
125
os_family = new ContextPair ( "os_family" , SystemInfo . operatingSystemFamily . ToString ( ) ) ;
47
126
device_model = new ContextPair ( "device_model" , SystemInfo . deviceModel ) ;
48
127
device_name = new ContextPair ( "device_name" , SystemInfo . deviceName ) ;
49
128
device_type = new ContextPair ( "device_type" , SystemInfo . deviceType . ToString ( ) ) ;
50
- gpu_name = new ContextPair ( "gpu_name" , SystemInfo . graphicsDeviceName ) ;
51
- gpu_id = new ContextPair ( "gpu_id" , SystemInfo . graphicsDeviceID . ToString ( ) ) ;
52
- gpu_type = new ContextPair ( "gpu_name" , SystemInfo . graphicsDeviceName ) ;
53
- gpu_vendor = new ContextPair ( "gpu_id" , SystemInfo . graphicsDeviceVendor ) ;
54
- gpu_vendor_id = new ContextPair ( "gpu_name" , SystemInfo . graphicsDeviceVendorID . ToString ( ) ) ;
55
129
#if UNITY_EDITOR
56
130
app_build = new ContextPair ( "app_build" , "editor" ) ;
57
131
#else
58
132
app_build = new _ContextPair ( "app_build" , "build" ) ;
59
133
#endif
60
134
this . app_version = new ContextPair ( "app_version" , app_version ) ;
135
+
136
+ gpu = new Gpu
137
+ {
138
+ id = SystemInfo . graphicsDeviceID ,
139
+ name = SystemInfo . graphicsDeviceName ,
140
+ vendor_id = SystemInfo . graphicsDeviceVendorID ,
141
+ vendor_name = SystemInfo . graphicsDeviceVendor ,
142
+ memory_size = SystemInfo . graphicsMemorySize ,
143
+ multi_threaded_rendering = SystemInfo . graphicsMultiThreaded ,
144
+ npot_support = SystemInfo . npotSupport . ToString ( ) ,
145
+ version = SystemInfo . graphicsDeviceVersion ,
146
+ api_type = SystemInfo . graphicsDeviceType . ToString ( )
147
+ } ;
61
148
}
62
149
}
63
150
@@ -206,4 +293,4 @@ public Dsn(string dsn)
206
293
callUri = builder . Uri ;
207
294
}
208
295
}
209
- }
296
+ }
0 commit comments