-
-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathMainThreadData.cs
More file actions
116 lines (80 loc) · 4.37 KB
/
Copy pathMainThreadData.cs
File metadata and controls
116 lines (80 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
using System;
using System.Threading;
using Unity.Jobs.LowLevel.Unsafe;
using UnityEngine;
namespace Sentry.Unity;
internal static class MainThreadData
{
internal static int? MainThreadId { get; set; }
public static string? OperatingSystem { get; set; }
public static int? ProcessorCount { get; set; }
public static bool? SupportsVibration { get; set; }
public static string? DeviceType { get; set; }
public static string? CpuDescription { get; set; }
public static string? DeviceName { get; set; }
public static string? DeviceUniqueIdentifier { get; set; }
public static string? DeviceModel { get; set; }
public static int? SystemMemorySize { get; set; }
public static int? GraphicsDeviceId { get; set; }
public static string? GraphicsDeviceName { get; set; }
public static string? GraphicsDeviceVendorId { get; set; }
public static string? GraphicsDeviceVendor { get; set; }
public static int? GraphicsMemorySize { get; set; }
public static bool? GraphicsMultiThreaded { get; set; }
public static string? NpotSupport { get; set; }
public static string? GraphicsDeviceVersion { get; set; }
public static string? GraphicsDeviceType { get; set; }
public static int? MaxTextureSize { get; set; }
public static bool? SupportsDrawCallInstancing { get; set; }
public static bool? SupportsRayTracing { get; set; }
public static bool? SupportsComputeShaders { get; set; }
public static bool? SupportsGeometryShaders { get; set; }
public static int? GraphicsShaderLevel { get; set; }
public static bool? IsDebugBuild { get; set; }
public static string? EditorVersion { get; set; }
public static string? InstallMode { get; set; }
public static string? TargetFrameRate { get; set; }
public static string? CopyTextureSupport { get; set; }
public static string? RenderingThreadingMode { get; set; }
public static DateTimeOffset? StartTime { get; set; }
public static bool IsMainThread()
=> !JobsUtility.IsExecutingJob && MainThreadId.HasValue && Thread.CurrentThread.ManagedThreadId == MainThreadId;
// For testing
internal static ISentrySystemInfo? SentrySystemInfo { get; set; }
public static void CollectData()
{
var sentrySystemInfo = SentrySystemInfo ?? SentrySystemInfoAdapter.Instance;
MainThreadId = sentrySystemInfo.MainThreadId;
ProcessorCount = sentrySystemInfo.ProcessorCount;
OperatingSystem = sentrySystemInfo.OperatingSystem;
CpuDescription = sentrySystemInfo.CpuDescription;
SupportsVibration = sentrySystemInfo.SupportsVibration;
DeviceName = sentrySystemInfo.DeviceName;
SystemMemorySize = sentrySystemInfo.SystemMemorySize;
GraphicsDeviceId = sentrySystemInfo.GraphicsDeviceId;
GraphicsDeviceName = sentrySystemInfo.GraphicsDeviceName;
GraphicsDeviceVendor = sentrySystemInfo.GraphicsDeviceVendor;
GraphicsMemorySize = sentrySystemInfo.GraphicsMemorySize;
NpotSupport = sentrySystemInfo.NpotSupport;
GraphicsDeviceVersion = sentrySystemInfo.GraphicsDeviceVersion;
GraphicsDeviceType = sentrySystemInfo.GraphicsDeviceType;
MaxTextureSize = sentrySystemInfo.MaxTextureSize;
SupportsDrawCallInstancing = sentrySystemInfo.SupportsDrawCallInstancing;
SupportsRayTracing = sentrySystemInfo.SupportsRayTracing;
SupportsComputeShaders = sentrySystemInfo.SupportsComputeShaders;
SupportsGeometryShaders = sentrySystemInfo.SupportsGeometryShaders;
GraphicsShaderLevel = sentrySystemInfo.GraphicsShaderLevel;
EditorVersion = sentrySystemInfo.EditorVersion;
InstallMode = sentrySystemInfo.InstallMode;
DeviceType = sentrySystemInfo.DeviceType?.Value;
DeviceUniqueIdentifier = sentrySystemInfo.DeviceUniqueIdentifier?.Value;
DeviceModel = sentrySystemInfo.DeviceModel?.Value;
GraphicsDeviceVendorId = sentrySystemInfo.GraphicsDeviceVendorId?.Value;
GraphicsMultiThreaded = sentrySystemInfo.GraphicsMultiThreaded?.Value;
IsDebugBuild = sentrySystemInfo.IsDebugBuild?.Value;
TargetFrameRate = sentrySystemInfo.TargetFrameRate?.Value;
CopyTextureSupport = sentrySystemInfo.CopyTextureSupport?.Value;
RenderingThreadingMode = sentrySystemInfo.RenderingThreadingMode?.Value;
StartTime = sentrySystemInfo.StartTime?.Value;
}
}