-
-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathNativeContextWriter.cs
More file actions
117 lines (113 loc) · 4.01 KB
/
Copy pathNativeContextWriter.cs
File metadata and controls
117 lines (113 loc) · 4.01 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
117
using System.Runtime.InteropServices;
namespace Sentry.Unity.iOS;
internal class NativeContextWriter : ContextWriter
{
protected override void WriteScope(
string? AppStartTime,
string? AppBuildType,
string? OperatingSystemRawDescription,
int? DeviceProcessorCount,
string? DeviceCpuDescription,
string? DeviceTimezone,
bool? DeviceSupportsVibration,
string? DeviceName,
bool? DeviceSimulator,
string? DeviceDeviceUniqueIdentifier,
string? DeviceDeviceType,
string? DeviceModel,
long? DeviceMemorySize,
int? GpuId,
string? GpuName,
string? GpuVendorName,
int? GpuMemorySize,
string? GpuNpotSupport,
string? GpuVersion,
string? GpuApiType,
int? GpuMaxTextureSize,
bool? GpuSupportsDrawCallInstancing,
bool? GpuSupportsRayTracing,
bool? GpuSupportsComputeShaders,
bool? GpuSupportsGeometryShaders,
string? GpuVendorId,
bool? GpuMultiThreadedRendering,
string? GpuGraphicsShaderLevel,
string? UnityEditorVersion,
string? UnityInstallMode,
string? UnityTargetFrameRate,
string? UnityCopyTextureSupport,
string? UnityRenderingThreadingMode
) => SentryNativeBridgeWriteScope(
// // AppStartTime,
// AppBuildType,
// // OperatingSystemRawDescription,
// DeviceProcessorCount ?? 0,
// DeviceCpuDescription,
// DeviceTimezone,
// marshallNullableBool(DeviceSupportsVibration),
// DeviceName,
// marshallNullableBool(DeviceSimulator),
// DeviceDeviceUniqueIdentifier,
// DeviceDeviceType,
// // DeviceModel,
// // DeviceMemorySize,
GpuId ?? 0,
GpuName,
GpuVendorName,
GpuMemorySize ?? 0,
GpuNpotSupport,
GpuVersion,
GpuApiType,
GpuMaxTextureSize ?? 0,
marshallNullableBool(GpuSupportsDrawCallInstancing),
marshallNullableBool(GpuSupportsRayTracing),
marshallNullableBool(GpuSupportsComputeShaders),
marshallNullableBool(GpuSupportsGeometryShaders),
GpuVendorId,
marshallNullableBool(GpuMultiThreadedRendering),
GpuGraphicsShaderLevel,
UnityEditorVersion,
UnityInstallMode,
UnityTargetFrameRate,
UnityCopyTextureSupport,
UnityRenderingThreadingMode
);
private static sbyte marshallNullableBool(bool? value) => (sbyte)(value.HasValue ? (value.Value ? 1 : 0) : -1);
// Note: we only forward information that's missing or significantly different in cocoa SDK events.
// Additionally, there's currently no way to update existing contexts, so no more Device info for now...
[DllImport("__Internal")]
private static extern void SentryNativeBridgeWriteScope(
// // string? AppStartTime,
// string? AppBuildType,
// // string? OperatingSystemRawDescription,
// int DeviceProcessorCount,
// string? DeviceCpuDescription,
// string? DeviceTimezone,
// sbyte DeviceSupportsVibration,
// string? DeviceName,
// sbyte DeviceSimulator,
// string? DeviceDeviceUniqueIdentifier,
// string? DeviceDeviceType,
// // string? DeviceModel,
// // long? DeviceMemorySize,
int GpuId,
string? GpuName,
string? GpuVendorName,
int GpuMemorySize,
string? GpuNpotSupport,
string? GpuVersion,
string? GpuApiType,
int GpuMaxTextureSize,
sbyte GpuSupportsDrawCallInstancing,
sbyte GpuSupportsRayTracing,
sbyte GpuSupportsComputeShaders,
sbyte GpuSupportsGeometryShaders,
string? GpuVendorId,
sbyte GpuMultiThreadedRendering,
string? GpuGraphicsShaderLevel,
string? UnityEditorVersion,
string? UnityInstallMode,
string? UnityTargetFrameRate,
string? UnityCopyTextureSupport,
string? UnityRenderingThreadingMode
);
}