@grepp/detect-gpu 5.0.91 → 5.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/benchmarks/d-amd.json +30 -27
- package/dist/benchmarks/d-geforce.json +15 -15
- package/dist/benchmarks/d-intel.json +2 -7
- package/dist/benchmarks/d-nvidia.json +28 -15
- package/dist/benchmarks/d-radeon.json +20 -27
- package/dist/benchmarks/m-adreno.json +6 -6
- package/dist/benchmarks/m-apple-ipad.json +7 -1
- package/dist/benchmarks/m-apple.json +2 -8
- package/dist/detect-gpu.esm.js +1 -1
- package/dist/detect-gpu.umd.js +1 -1
- package/package.json +1 -1
|
@@ -1073,10 +1073,20 @@
|
|
|
1073
1073
|
1152,
|
|
1074
1074
|
59
|
|
1075
1075
|
],
|
|
1076
|
+
[
|
|
1077
|
+
2560,
|
|
1078
|
+
1080,
|
|
1079
|
+
60
|
|
1080
|
+
],
|
|
1076
1081
|
[
|
|
1077
1082
|
2560,
|
|
1078
1083
|
1440,
|
|
1079
1084
|
59
|
|
1085
|
+
],
|
|
1086
|
+
[
|
|
1087
|
+
3440,
|
|
1088
|
+
1440,
|
|
1089
|
+
60
|
|
1080
1090
|
]
|
|
1081
1091
|
]
|
|
1082
1092
|
],
|
|
@@ -2951,6 +2961,19 @@
|
|
|
2951
2961
|
]
|
|
2952
2962
|
]
|
|
2953
2963
|
],
|
|
2964
|
+
[
|
|
2965
|
+
"amd radeon 840m",
|
|
2966
|
+
"840",
|
|
2967
|
+
"840m amd radeon",
|
|
2968
|
+
0,
|
|
2969
|
+
[
|
|
2970
|
+
[
|
|
2971
|
+
1920,
|
|
2972
|
+
1080,
|
|
2973
|
+
206
|
|
2974
|
+
]
|
|
2975
|
+
]
|
|
2976
|
+
],
|
|
2954
2977
|
[
|
|
2955
2978
|
"amd radeon 860m",
|
|
2956
2979
|
"860",
|
|
@@ -7511,7 +7534,7 @@
|
|
|
7511
7534
|
[
|
|
7512
7535
|
3584,
|
|
7513
7536
|
2240,
|
|
7514
|
-
|
|
7537
|
+
139
|
|
7515
7538
|
]
|
|
7516
7539
|
]
|
|
7517
7540
|
],
|
|
@@ -11260,7 +11283,7 @@
|
|
|
11260
11283
|
[
|
|
11261
11284
|
1920,
|
|
11262
11285
|
1080,
|
|
11263
|
-
|
|
11286
|
+
59
|
|
11264
11287
|
],
|
|
11265
11288
|
[
|
|
11266
11289
|
2560,
|
|
@@ -11781,11 +11804,6 @@
|
|
|
11781
11804
|
"6800 amd radeon rx",
|
|
11782
11805
|
0,
|
|
11783
11806
|
[
|
|
11784
|
-
[
|
|
11785
|
-
1920,
|
|
11786
|
-
1080,
|
|
11787
|
-
180
|
|
11788
|
-
],
|
|
11789
11807
|
[
|
|
11790
11808
|
2560,
|
|
11791
11809
|
1440,
|
|
@@ -12053,11 +12071,6 @@
|
|
|
12053
12071
|
1920,
|
|
12054
12072
|
1080,
|
|
12055
12073
|
180
|
|
12056
|
-
],
|
|
12057
|
-
[
|
|
12058
|
-
2560,
|
|
12059
|
-
1440,
|
|
12060
|
-
1063
|
|
12061
12074
|
]
|
|
12062
12075
|
]
|
|
12063
12076
|
],
|
|
@@ -12127,7 +12140,7 @@
|
|
|
12127
12140
|
[
|
|
12128
12141
|
1920,
|
|
12129
12142
|
1080,
|
|
12130
|
-
|
|
12143
|
+
1429
|
|
12131
12144
|
],
|
|
12132
12145
|
[
|
|
12133
12146
|
3840,
|
|
@@ -12143,9 +12156,9 @@
|
|
|
12143
12156
|
0,
|
|
12144
12157
|
[
|
|
12145
12158
|
[
|
|
12146
|
-
|
|
12147
|
-
|
|
12148
|
-
|
|
12159
|
+
2560,
|
|
12160
|
+
1440,
|
|
12161
|
+
1410
|
|
12149
12162
|
]
|
|
12150
12163
|
]
|
|
12151
12164
|
],
|
|
@@ -12158,12 +12171,7 @@
|
|
|
12158
12171
|
[
|
|
12159
12172
|
1920,
|
|
12160
12173
|
1080,
|
|
12161
|
-
|
|
12162
|
-
],
|
|
12163
|
-
[
|
|
12164
|
-
3440,
|
|
12165
|
-
1440,
|
|
12166
|
-
144
|
|
12174
|
+
60
|
|
12167
12175
|
]
|
|
12168
12176
|
]
|
|
12169
12177
|
],
|
|
@@ -12186,11 +12194,6 @@
|
|
|
12186
12194
|
"amd radeon rx vega",
|
|
12187
12195
|
0,
|
|
12188
12196
|
[
|
|
12189
|
-
[
|
|
12190
|
-
1440,
|
|
12191
|
-
900,
|
|
12192
|
-
75
|
|
12193
|
-
],
|
|
12194
12197
|
[
|
|
12195
12198
|
1920,
|
|
12196
12199
|
1080,
|
|
@@ -2632,11 +2632,6 @@
|
|
|
2632
2632
|
2560,
|
|
2633
2633
|
1440,
|
|
2634
2634
|
102
|
|
2635
|
-
],
|
|
2636
|
-
[
|
|
2637
|
-
3840,
|
|
2638
|
-
2160,
|
|
2639
|
-
60
|
|
2640
2635
|
]
|
|
2641
2636
|
]
|
|
2642
2637
|
],
|
|
@@ -2664,11 +2659,6 @@
|
|
|
2664
2659
|
"1060 geforce gtx nvidia",
|
|
2665
2660
|
0,
|
|
2666
2661
|
[
|
|
2667
|
-
[
|
|
2668
|
-
1280,
|
|
2669
|
-
720,
|
|
2670
|
-
60
|
|
2671
|
-
],
|
|
2672
2662
|
[
|
|
2673
2663
|
1920,
|
|
2674
2664
|
1080,
|
|
@@ -5637,6 +5627,11 @@
|
|
|
5637
5627
|
1920,
|
|
5638
5628
|
1080,
|
|
5639
5629
|
120
|
|
5630
|
+
],
|
|
5631
|
+
[
|
|
5632
|
+
2560,
|
|
5633
|
+
1440,
|
|
5634
|
+
164
|
|
5640
5635
|
]
|
|
5641
5636
|
]
|
|
5642
5637
|
],
|
|
@@ -5877,7 +5872,7 @@
|
|
|
5877
5872
|
[
|
|
5878
5873
|
1920,
|
|
5879
5874
|
1080,
|
|
5880
|
-
|
|
5875
|
+
613
|
|
5881
5876
|
],
|
|
5882
5877
|
[
|
|
5883
5878
|
2560,
|
|
@@ -6155,6 +6150,11 @@
|
|
|
6155
6150
|
1920,
|
|
6156
6151
|
1080,
|
|
6157
6152
|
144
|
|
6153
|
+
],
|
|
6154
|
+
[
|
|
6155
|
+
2560,
|
|
6156
|
+
1600,
|
|
6157
|
+
240
|
|
6158
6158
|
]
|
|
6159
6159
|
]
|
|
6160
6160
|
],
|
|
@@ -6190,7 +6190,7 @@
|
|
|
6190
6190
|
[
|
|
6191
6191
|
2560,
|
|
6192
6192
|
1440,
|
|
6193
|
-
|
|
6193
|
+
180
|
|
6194
6194
|
]
|
|
6195
6195
|
]
|
|
6196
6196
|
],
|
|
@@ -6214,9 +6214,9 @@
|
|
|
6214
6214
|
0,
|
|
6215
6215
|
[
|
|
6216
6216
|
[
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6217
|
+
1920,
|
|
6218
|
+
1080,
|
|
6219
|
+
60
|
|
6220
6220
|
],
|
|
6221
6221
|
[
|
|
6222
6222
|
3840,
|
|
@@ -1918,7 +1918,7 @@
|
|
|
1918
1918
|
[
|
|
1919
1919
|
2560,
|
|
1920
1920
|
1600,
|
|
1921
|
-
|
|
1921
|
+
21
|
|
1922
1922
|
],
|
|
1923
1923
|
[
|
|
1924
1924
|
2736,
|
|
@@ -2537,11 +2537,6 @@
|
|
|
2537
2537
|
1080,
|
|
2538
2538
|
58
|
|
2539
2539
|
],
|
|
2540
|
-
[
|
|
2541
|
-
2560,
|
|
2542
|
-
1440,
|
|
2543
|
-
85
|
|
2544
|
-
],
|
|
2545
2540
|
[
|
|
2546
2541
|
2880,
|
|
2547
2542
|
1800,
|
|
@@ -3457,7 +3452,7 @@
|
|
|
3457
3452
|
[
|
|
3458
3453
|
3584,
|
|
3459
3454
|
2240,
|
|
3460
|
-
|
|
3455
|
+
137
|
|
3461
3456
|
],
|
|
3462
3457
|
[
|
|
3463
3458
|
3840,
|
|
@@ -2871,11 +2871,6 @@
|
|
|
2871
2871
|
2560,
|
|
2872
2872
|
1440,
|
|
2873
2873
|
102
|
|
2874
|
-
],
|
|
2875
|
-
[
|
|
2876
|
-
3840,
|
|
2877
|
-
2160,
|
|
2878
|
-
60
|
|
2879
2874
|
]
|
|
2880
2875
|
]
|
|
2881
2876
|
],
|
|
@@ -2903,11 +2898,6 @@
|
|
|
2903
2898
|
"1060 geforce gtx nvidia",
|
|
2904
2899
|
0,
|
|
2905
2900
|
[
|
|
2906
|
-
[
|
|
2907
|
-
1280,
|
|
2908
|
-
720,
|
|
2909
|
-
60
|
|
2910
|
-
],
|
|
2911
2901
|
[
|
|
2912
2902
|
1920,
|
|
2913
2903
|
1080,
|
|
@@ -5876,6 +5866,11 @@
|
|
|
5876
5866
|
1920,
|
|
5877
5867
|
1080,
|
|
5878
5868
|
120
|
|
5869
|
+
],
|
|
5870
|
+
[
|
|
5871
|
+
2560,
|
|
5872
|
+
1440,
|
|
5873
|
+
164
|
|
5879
5874
|
]
|
|
5880
5875
|
]
|
|
5881
5876
|
],
|
|
@@ -6116,7 +6111,7 @@
|
|
|
6116
6111
|
[
|
|
6117
6112
|
1920,
|
|
6118
6113
|
1080,
|
|
6119
|
-
|
|
6114
|
+
613
|
|
6120
6115
|
],
|
|
6121
6116
|
[
|
|
6122
6117
|
2560,
|
|
@@ -6394,6 +6389,11 @@
|
|
|
6394
6389
|
1920,
|
|
6395
6390
|
1080,
|
|
6396
6391
|
144
|
|
6392
|
+
],
|
|
6393
|
+
[
|
|
6394
|
+
2560,
|
|
6395
|
+
1600,
|
|
6396
|
+
240
|
|
6397
6397
|
]
|
|
6398
6398
|
]
|
|
6399
6399
|
],
|
|
@@ -6429,7 +6429,7 @@
|
|
|
6429
6429
|
[
|
|
6430
6430
|
2560,
|
|
6431
6431
|
1440,
|
|
6432
|
-
|
|
6432
|
+
180
|
|
6433
6433
|
]
|
|
6434
6434
|
]
|
|
6435
6435
|
],
|
|
@@ -6453,9 +6453,9 @@
|
|
|
6453
6453
|
0,
|
|
6454
6454
|
[
|
|
6455
6455
|
[
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6456
|
+
1920,
|
|
6457
|
+
1080,
|
|
6458
|
+
60
|
|
6459
6459
|
],
|
|
6460
6460
|
[
|
|
6461
6461
|
3840,
|
|
@@ -11210,6 +11210,19 @@
|
|
|
11210
11210
|
]
|
|
11211
11211
|
]
|
|
11212
11212
|
],
|
|
11213
|
+
[
|
|
11214
|
+
"nvidia rtx pro 500 blackwell generation laptop gpu",
|
|
11215
|
+
"500",
|
|
11216
|
+
"500 blackwell generation gpu laptop nvidia pro rtx",
|
|
11217
|
+
0,
|
|
11218
|
+
[
|
|
11219
|
+
[
|
|
11220
|
+
3072,
|
|
11221
|
+
1920,
|
|
11222
|
+
60
|
|
11223
|
+
]
|
|
11224
|
+
]
|
|
11225
|
+
],
|
|
11213
11226
|
[
|
|
11214
11227
|
"nvidia rtxa5000-1q",
|
|
11215
11228
|
"5000",
|
|
@@ -989,6 +989,19 @@
|
|
|
989
989
|
]
|
|
990
990
|
]
|
|
991
991
|
],
|
|
992
|
+
[
|
|
993
|
+
"amd radeon 840m",
|
|
994
|
+
"840",
|
|
995
|
+
"840m amd radeon",
|
|
996
|
+
0,
|
|
997
|
+
[
|
|
998
|
+
[
|
|
999
|
+
1920,
|
|
1000
|
+
1080,
|
|
1001
|
+
206
|
|
1002
|
+
]
|
|
1003
|
+
]
|
|
1004
|
+
],
|
|
992
1005
|
[
|
|
993
1006
|
"amd radeon 860m",
|
|
994
1007
|
"860",
|
|
@@ -5549,7 +5562,7 @@
|
|
|
5549
5562
|
[
|
|
5550
5563
|
3584,
|
|
5551
5564
|
2240,
|
|
5552
|
-
|
|
5565
|
+
139
|
|
5553
5566
|
]
|
|
5554
5567
|
]
|
|
5555
5568
|
],
|
|
@@ -9298,7 +9311,7 @@
|
|
|
9298
9311
|
[
|
|
9299
9312
|
1920,
|
|
9300
9313
|
1080,
|
|
9301
|
-
|
|
9314
|
+
59
|
|
9302
9315
|
],
|
|
9303
9316
|
[
|
|
9304
9317
|
2560,
|
|
@@ -9819,11 +9832,6 @@
|
|
|
9819
9832
|
"6800 amd radeon rx",
|
|
9820
9833
|
0,
|
|
9821
9834
|
[
|
|
9822
|
-
[
|
|
9823
|
-
1920,
|
|
9824
|
-
1080,
|
|
9825
|
-
180
|
|
9826
|
-
],
|
|
9827
9835
|
[
|
|
9828
9836
|
2560,
|
|
9829
9837
|
1440,
|
|
@@ -10091,11 +10099,6 @@
|
|
|
10091
10099
|
1920,
|
|
10092
10100
|
1080,
|
|
10093
10101
|
180
|
|
10094
|
-
],
|
|
10095
|
-
[
|
|
10096
|
-
2560,
|
|
10097
|
-
1440,
|
|
10098
|
-
1063
|
|
10099
10102
|
]
|
|
10100
10103
|
]
|
|
10101
10104
|
],
|
|
@@ -10165,7 +10168,7 @@
|
|
|
10165
10168
|
[
|
|
10166
10169
|
1920,
|
|
10167
10170
|
1080,
|
|
10168
|
-
|
|
10171
|
+
1429
|
|
10169
10172
|
],
|
|
10170
10173
|
[
|
|
10171
10174
|
3840,
|
|
@@ -10181,9 +10184,9 @@
|
|
|
10181
10184
|
0,
|
|
10182
10185
|
[
|
|
10183
10186
|
[
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
+
2560,
|
|
10188
|
+
1440,
|
|
10189
|
+
1410
|
|
10187
10190
|
]
|
|
10188
10191
|
]
|
|
10189
10192
|
],
|
|
@@ -10196,12 +10199,7 @@
|
|
|
10196
10199
|
[
|
|
10197
10200
|
1920,
|
|
10198
10201
|
1080,
|
|
10199
|
-
|
|
10200
|
-
],
|
|
10201
|
-
[
|
|
10202
|
-
3440,
|
|
10203
|
-
1440,
|
|
10204
|
-
144
|
|
10202
|
+
60
|
|
10205
10203
|
]
|
|
10206
10204
|
]
|
|
10207
10205
|
],
|
|
@@ -10224,11 +10222,6 @@
|
|
|
10224
10222
|
"amd radeon rx vega",
|
|
10225
10223
|
0,
|
|
10226
10224
|
[
|
|
10227
|
-
[
|
|
10228
|
-
1440,
|
|
10229
|
-
900,
|
|
10230
|
-
75
|
|
10231
|
-
],
|
|
10232
10225
|
[
|
|
10233
10226
|
1920,
|
|
10234
10227
|
1080,
|
|
@@ -2504,17 +2504,17 @@
|
|
|
2504
2504
|
120,
|
|
2505
2505
|
"samsung galaxy s25 ultra"
|
|
2506
2506
|
],
|
|
2507
|
+
[
|
|
2508
|
+
2273,
|
|
2509
|
+
1035,
|
|
2510
|
+
60,
|
|
2511
|
+
"xiaomi 15 pro"
|
|
2512
|
+
],
|
|
2507
2513
|
[
|
|
2508
2514
|
2340,
|
|
2509
2515
|
1080,
|
|
2510
2516
|
120,
|
|
2511
2517
|
"samsung galaxy s25+"
|
|
2512
|
-
],
|
|
2513
|
-
[
|
|
2514
|
-
3200,
|
|
2515
|
-
1440,
|
|
2516
|
-
60,
|
|
2517
|
-
"xiaomi 15 pro"
|
|
2518
2518
|
]
|
|
2519
2519
|
]
|
|
2520
2520
|
]
|
|
@@ -288,6 +288,12 @@
|
|
|
288
288
|
120,
|
|
289
289
|
"apple ipad pro (11-inch) (3rd generation)"
|
|
290
290
|
],
|
|
291
|
+
[
|
|
292
|
+
2730,
|
|
293
|
+
2048,
|
|
294
|
+
114,
|
|
295
|
+
"apple ipad pro (12.9-inch) (5th generation)"
|
|
296
|
+
],
|
|
291
297
|
[
|
|
292
298
|
2732,
|
|
293
299
|
2048,
|
|
@@ -357,7 +363,7 @@
|
|
|
357
363
|
[
|
|
358
364
|
2420,
|
|
359
365
|
1668,
|
|
360
|
-
|
|
366
|
+
60,
|
|
361
367
|
"apple ipad pro 11 inch 5th gen"
|
|
362
368
|
],
|
|
363
369
|
[
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
[
|
|
158
158
|
2338,
|
|
159
159
|
1080,
|
|
160
|
-
|
|
160
|
+
60,
|
|
161
161
|
"apple iphone 13 mini"
|
|
162
162
|
],
|
|
163
163
|
[
|
|
@@ -171,12 +171,6 @@
|
|
|
171
171
|
1284,
|
|
172
172
|
60,
|
|
173
173
|
"apple iphone 13 pro max"
|
|
174
|
-
],
|
|
175
|
-
[
|
|
176
|
-
2780,
|
|
177
|
-
1284,
|
|
178
|
-
54,
|
|
179
|
-
"apple iphone 13 pro max"
|
|
180
174
|
]
|
|
181
175
|
]
|
|
182
176
|
],
|
|
@@ -189,7 +183,7 @@
|
|
|
189
183
|
[
|
|
190
184
|
2532,
|
|
191
185
|
1170,
|
|
192
|
-
|
|
186
|
+
59,
|
|
193
187
|
"apple iphone 14 pro"
|
|
194
188
|
],
|
|
195
189
|
[
|
package/dist/detect-gpu.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function e(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{d(n.next(e))}catch(e){a(e)}}function c(e){try{d(n.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,c)}d((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const t=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function r(e){return e=e.toLowerCase().replace(/.*angle ?\((.+)\)(?: on vulkan [0-9.]+)?$/i,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const n=34962,o="undefined"==typeof window,a=(()=>{if(o)return;const{userAgent:e,platform:t,maxTouchPoints:r}=window.navigator,n=/(iphone|ipod|ipad)/i.test(e),a="iPad"===t||"MacIntel"===t&&r>0&&!window.MSStream;return{isIpad:a,isMobile:/android/i.test(e)||n||a,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e)}})();function i(e,t,r){if(!r)return[t];const o=function(e){const t="\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n ",r="\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n ",o=e.createShader(35633),a=e.createShader(35632),i=e.createProgram();if(!(a&&o&&i))return;e.shaderSource(o,t),e.shaderSource(a,r),e.compileShader(o),e.compileShader(a),e.attachShader(i,o),e.attachShader(i,a),e.linkProgram(i),e.detachShader(i,o),e.detachShader(i,a),e.deleteShader(o),e.deleteShader(a),e.useProgram(i);const c=e.createBuffer();e.bindBuffer(n,c),e.bufferData(n,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const d=e.getAttribLocation(i,"aPosition");e.vertexAttribPointer(d,3,5126,!1,0,0),e.enableVertexAttribArray(d),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);const l=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,l),e.deleteProgram(i),e.deleteBuffer(c),l.join("")}(e),i="801621810",c="8016218135",d="80162181161",l=(null==a?void 0:a.isIpad)?[["a7",d,12],["a8",c,15],["a8x",c,15],["a9",c,15],["a9x",c,15],["a10",c,15],["a10x",c,15],["a12",i,15],["a12x",i,15],["a12z",i,15],["a14",i,15],["a15",i,15],["m1",i,15],["m2",i,15]]:[["a7",d,12],["a8",c,12],["a9",c,15],["a10",c,15],["a11",i,15],["a12",i,15],["a13",i,15],["a14",i,15],["a15",i,15],["a16",i,15],["a17",i,15]];let s;"80162181255"===o?s=l.filter(([,,e])=>e>=14):(s=l.filter(([,e])=>e===o),s.length||(s=l));return s.map(([e])=>`apple ${e} gpu`)}class c extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const d=[],l=[];function s(e,t){if(e===t)return 0;const r=e;e.length>t.length&&(e=t,t=r);let n=e.length,o=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-o);)n--,o--;let a,i=0;for(;i<n&&e.charCodeAt(i)===t.charCodeAt(i);)i++;if(n-=i,o-=i,0===n)return o;let c,s,f=0,u=0,g=0;for(;u<n;)l[u]=e.charCodeAt(i+u),d[u]=++u;for(;g<o;)for(a=t.charCodeAt(i+g),c=g++,f=g,u=0;u<n;u++)s=a===l[u]?c:c+1,c=d[u],f=d[u]=c>f?s>f?f+1:s:s>c?c+1:s;return f}function f(e){return null!=e}const u=(...n)=>e(void 0,[...n],void 0,function*({mobileTiers:n=[0,15,30,60],desktopTiers:d=[0,15,30,60],override:l={},glContext:u,failIfMajorPerformanceCaveat:g=!1,benchmarksURL:h="https://unpkg.com/@grepp/detect-gpu@5.0.
|
|
1
|
+
function e(e,t,r,n){return new(r||(r=Promise))(function(o,a){function i(e){try{d(n.next(e))}catch(e){a(e)}}function c(e){try{d(n.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,c)}d((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const t=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function r(e){return e=e.toLowerCase().replace(/.*angle ?\((.+)\)(?: on vulkan [0-9.]+)?$/i,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const n=34962,o="undefined"==typeof window,a=(()=>{if(o)return;const{userAgent:e,platform:t,maxTouchPoints:r}=window.navigator,n=/(iphone|ipod|ipad)/i.test(e),a="iPad"===t||"MacIntel"===t&&r>0&&!window.MSStream;return{isIpad:a,isMobile:/android/i.test(e)||n||a,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e)}})();function i(e,t,r){if(!r)return[t];const o=function(e){const t="\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n ",r="\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n ",o=e.createShader(35633),a=e.createShader(35632),i=e.createProgram();if(!(a&&o&&i))return;e.shaderSource(o,t),e.shaderSource(a,r),e.compileShader(o),e.compileShader(a),e.attachShader(i,o),e.attachShader(i,a),e.linkProgram(i),e.detachShader(i,o),e.detachShader(i,a),e.deleteShader(o),e.deleteShader(a),e.useProgram(i);const c=e.createBuffer();e.bindBuffer(n,c),e.bufferData(n,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const d=e.getAttribLocation(i,"aPosition");e.vertexAttribPointer(d,3,5126,!1,0,0),e.enableVertexAttribArray(d),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);const l=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,l),e.deleteProgram(i),e.deleteBuffer(c),l.join("")}(e),i="801621810",c="8016218135",d="80162181161",l=(null==a?void 0:a.isIpad)?[["a7",d,12],["a8",c,15],["a8x",c,15],["a9",c,15],["a9x",c,15],["a10",c,15],["a10x",c,15],["a12",i,15],["a12x",i,15],["a12z",i,15],["a14",i,15],["a15",i,15],["m1",i,15],["m2",i,15]]:[["a7",d,12],["a8",c,12],["a9",c,15],["a10",c,15],["a11",i,15],["a12",i,15],["a13",i,15],["a14",i,15],["a15",i,15],["a16",i,15],["a17",i,15]];let s;"80162181255"===o?s=l.filter(([,,e])=>e>=14):(s=l.filter(([,e])=>e===o),s.length||(s=l));return s.map(([e])=>`apple ${e} gpu`)}class c extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}const d=[],l=[];function s(e,t){if(e===t)return 0;const r=e;e.length>t.length&&(e=t,t=r);let n=e.length,o=t.length;for(;n>0&&e.charCodeAt(~-n)===t.charCodeAt(~-o);)n--,o--;let a,i=0;for(;i<n&&e.charCodeAt(i)===t.charCodeAt(i);)i++;if(n-=i,o-=i,0===n)return o;let c,s,f=0,u=0,g=0;for(;u<n;)l[u]=e.charCodeAt(i+u),d[u]=++u;for(;g<o;)for(a=t.charCodeAt(i+g),c=g++,f=g,u=0;u<n;u++)s=a===l[u]?c:c+1,c=d[u],f=d[u]=c>f?s>f?f+1:s:s>c?c+1:s;return f}function f(e){return null!=e}const u=(...n)=>e(void 0,[...n],void 0,function*({mobileTiers:n=[0,15,30,60],desktopTiers:d=[0,15,30,60],override:l={},glContext:u,failIfMajorPerformanceCaveat:g=!1,benchmarksURL:h="https://unpkg.com/@grepp/detect-gpu@5.0.93/dist/benchmarks"}={}){const p={};if(o)return{tier:0,type:"SSR"};const{isIpad:m=!!(null==a?void 0:a.isIpad),isMobile:v=!!(null==a?void 0:a.isMobile),screenSize:w=window.screen,loadBenchmarks:x=t=>e(void 0,void 0,void 0,function*(){const e=h.endsWith("/")?h:`${h}/`,r=yield fetch(`${e}${t}`).then(e=>e.json());if(parseInt(r.shift().split(".")[0],10)<4)throw new c("Detect GPU benchmark data is out of date. Please update to version 4x");return r})}=l;let{renderer:A}=l;const P=(e,t,r,n,o)=>({device:o,fps:n,gpu:r,isMobile:v,tier:e,type:t});let S,b="";if(A)A=r(A),S=[A];else{const e=u||function(e,t=!1){const r={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:t,powerPreference:"high-performance",stencil:!1};e&&delete r.powerPreference;const n=window.document.createElement("canvas"),o=n.getContext("webgl",r)||n.getContext("experimental-webgl",r);return null!=o?o:void 0}(null==a?void 0:a.isSafari12,g);if(!e)return P(0,"WEBGL_UNSUPPORTED");const t=(null==a?void 0:a.isFirefox)?null:e.getExtension("WEBGL_debug_renderer_info");if(A=t?e.getParameter(t.UNMASKED_RENDERER_WEBGL):e.getParameter(e.RENDERER),!A)return P(1,"FALLBACK");b=A,A=r(A),S=function(e,t,r){return"apple gpu"===t?i(e,t,r):[t]}(e,A,v)}const E=(yield Promise.all(S.map(function(t){return e(this,void 0,void 0,function*(){var e;const r=(e=>{const t=v?["adreno","apple","mali-t","mali","nvidia","powervr","samsung"]:["intel","apple","amd","radeon","nvidia","geforce","adreno"];for(const r of t)if(e.includes(r))return r})(t);if(!r)return;const n=`${v?"m":"d"}-${r}${m?"-ipad":""}.json`,o=p[n]=null!==(e=p[n])&&void 0!==e?e:x(n);let a;try{a=yield o}catch(e){if(e instanceof c)throw e;return}const i=function(e){var t;const r=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(t=null==r?void 0:r.join("").replace(/\W|amd/g,""))&&void 0!==t?t:""}(t);let d=a.filter(([,e])=>e===i);d.length||(d=a.filter(([e])=>e.includes(t)));const l=d.length;if(0===l)return;const f=t.split(/[.,()\[\]/\s]/g).sort().filter((e,t,r)=>0===t||e!==r[t-1]).join(" ");let u,[g,,,,h]=l>1?d.map(e=>[e,s(f,e[2])]).sort(([,e],[,t])=>e-t)[0][0]:d[0],A=Number.MAX_VALUE;const{devicePixelRatio:P}=window,S=w.width*P*w.height*P;for(const e of h){const[t,r]=e,n=t*r,o=Math.abs(S-n);o<A&&(A=o,u=e)}if(!u)return;const[,,b,E]=u;return[A,b,g,E]})}))).filter(f).sort(([e=Number.MAX_VALUE,t],[r=Number.MAX_VALUE,n])=>e===r?t-n:e-r);if(!E.length){const e=t.find(e=>A.includes(e));return e?P(0,"BLOCKLISTED",e):P(1,"FALLBACK",`${A} (${b})`)}const[,y,C,L]=E[0];if(-1===y)return P(0,"BLOCKLISTED",C,y,L);const $=v?n:d;let M=0;for(let e=0;e<$.length;e++)y>=$[e]&&(M=e);return P(M,"BENCHMARK",C,y,L)});export{u as getGPUTier};
|
|
2
2
|
//# sourceMappingURL=detect-gpu.esm.js.map
|
package/dist/detect-gpu.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).DetectGPU={})}(this,function(e){"use strict";var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},r(e,t)};function t(e,r,t,n){return new(t||(t=Promise))(function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function c(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(i,c)}u((n=n.apply(e,r||[])).next())})}function n(e,r){var t,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=c(0),i.throw=c(1),i.return=c(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(t=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=r.call(e,a)}catch(e){c=[6,e],n=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}"function"==typeof SuppressedError&&SuppressedError;var o=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function a(e){return e=e.toLowerCase().replace(/.*angle ?\((.+)\)(?: on vulkan [0-9.]+)?$/i,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const i=34962;var c="undefined"==typeof window,u=function(){if(!c){var e=window.navigator,r=e.userAgent,t=e.platform,n=e.maxTouchPoints,o=/(iphone|ipod|ipad)/i.test(r),a="iPad"===t||"MacIntel"===t&&n>0&&!window.MSStream;return{isIpad:a,isMobile:/android/i.test(r)||o||a,isSafari12:/Version\/12.+Safari/.test(r),isFirefox:/Firefox/.test(r)}}}();function l(e,r,t){if(!t)return[r];var n,o=function(e){var r="\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n ",t="\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n ",n=e.createShader(35633),o=e.createShader(35632),a=e.createProgram();if(!(o&&n&&a))return;e.shaderSource(n,r),e.shaderSource(o,t),e.compileShader(n),e.compileShader(o),e.attachShader(a,n),e.attachShader(a,o),e.linkProgram(a),e.detachShader(a,n),e.detachShader(a,o),e.deleteShader(n),e.deleteShader(o),e.useProgram(a);var c=e.createBuffer();e.bindBuffer(i,c),e.bufferData(i,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);var u=e.getAttribLocation(a,"aPosition");e.vertexAttribPointer(u,3,5126,!1,0,0),e.enableVertexAttribArray(u),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);var l=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,l),e.deleteProgram(a),e.deleteBuffer(c),l.join("")}(e),a="801621810",c="8016218135",l="80162181161",f=(null==u?void 0:u.isIpad)?[["a7",l,12],["a8",c,15],["a8x",c,15],["a9",c,15],["a9x",c,15],["a10",c,15],["a10x",c,15],["a12",a,15],["a12x",a,15],["a12z",a,15],["a14",a,15],["a15",a,15],["m1",a,15],["m2",a,15]]:[["a7",l,12],["a8",c,12],["a9",c,15],["a10",c,15],["a11",a,15],["a12",a,15],["a13",a,15],["a14",a,15],["a15",a,15],["a16",a,15],["a17",a,15]];return"80162181255"===o?n=f.filter(function(e){return e[2]>=14}):(n=f.filter(function(e){return e[1]===o})).length||(n=f),n.map(function(e){var r=e[0];return"apple ".concat(r," gpu")})}var f=function(e){function t(r){var t=this.constructor,n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error);var d=[],s=[];function h(e,r){if(e===r)return 0;var t=e;e.length>r.length&&(e=r,r=t);for(var n=e.length,o=r.length;n>0&&e.charCodeAt(~-n)===r.charCodeAt(~-o);)n--,o--;for(var a,i=0;i<n&&e.charCodeAt(i)===r.charCodeAt(i);)i++;if(o-=i,0===(n-=i))return o;for(var c,u,l=0,f=0,h=0;f<n;)s[f]=e.charCodeAt(i+f),d[f]=++f;for(;h<o;)for(a=r.charCodeAt(i+h),c=h++,l=h,f=0;f<n;f++)u=a===s[f]?c:c+1,c=d[f],l=d[f]=c>l?u>l?l+1:u:u>c?c+1:u;return l}function p(e){return null!=e}e.getGPUTier=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(void 0,function(e,r,t){if(t||2===arguments.length)for(var n,o=0,a=r.length;o<a;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}([],e,!0),void 0,function(e){function r(e){return t(this,void 0,void 0,function(){var r,t,o,a,c,u,l,d,p,v,m,y,x,P,S,E,C,_,L,j,M,k,B,I,O,R,T;return n(this,function(n){switch(n.label){case 0:if(!(r=A(e)))return[2];t="".concat(g?"m":"d","-").concat(r).concat(s?"-ipad":"",".json"),o=i[t]=null!==(T=i[t])&&void 0!==T?T:w(t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,o];case 2:return a=n.sent(),[3,4];case 3:if((c=n.sent())instanceof f)throw c;return[2];case 4:if(u=function(e){var r,t=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(r=null==t?void 0:t.join("").replace(/\W|amd/g,""))&&void 0!==r?r:""}(e),l=a.filter(function(e){return e[1]===u}),l.length||(l=a.filter(function(r){return r[0].includes(e)})),0===(d=l.length))return[2];for(p=e.split(/[.,()\[\]/\s]/g).sort().filter(function(e,r,t){return 0===r||e!==t[r-1]}).join(" "),v=d>1?l.map(function(e){return[e,h(p,e[2])]}).sort(function(e,r){return e[1]-r[1]})[0][0]:l[0],m=v[0],y=v[4],x=Number.MAX_VALUE,S=window.devicePixelRatio,E=b.width*S*b.height*S,C=0,_=y;C<_.length;C++)L=_[C],j=L[0],M=L[1],k=j*M,(B=Math.abs(E-k))<x&&(x=B,P=L);return P?(O=(I=P)[2],R=I[3],[2,[x,O,m,R]]):[2]}})})}var i,d,s,v,g,m,b,y,w,x,A,P,S,E,C,_,L,j,M,k,B,I,O,R,T,U=void 0===e?{}:e,D=U.mobileTiers,N=void 0===D?[0,15,30,60]:D,F=U.desktopTiers,G=void 0===F?[0,15,30,60]:F,W=U.override,K=void 0===W?{}:W,$=U.glContext,V=U.failIfMajorPerformanceCaveat,q=void 0!==V&&V,z=U.benchmarksURL,X=void 0===z?"https://unpkg.com/@grepp/detect-gpu@".concat("5.0.
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).DetectGPU={})}(this,function(e){"use strict";var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])},r(e,t)};function t(e,r,t,n){return new(t||(t=Promise))(function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function c(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(i,c)}u((n=n.apply(e,r||[])).next())})}function n(e,r){var t,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=c(0),i.throw=c(1),i.return=c(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(u){return function(c){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(a=0)),a;)try{if(t=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,n=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=r.call(e,a)}catch(e){c=[6,e],n=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}"function"==typeof SuppressedError&&SuppressedError;var o=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function a(e){return e=e.toLowerCase().replace(/.*angle ?\((.+)\)(?: on vulkan [0-9.]+)?$/i,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const i=34962;var c="undefined"==typeof window,u=function(){if(!c){var e=window.navigator,r=e.userAgent,t=e.platform,n=e.maxTouchPoints,o=/(iphone|ipod|ipad)/i.test(r),a="iPad"===t||"MacIntel"===t&&n>0&&!window.MSStream;return{isIpad:a,isMobile:/android/i.test(r)||o||a,isSafari12:/Version\/12.+Safari/.test(r),isFirefox:/Firefox/.test(r)}}}();function l(e,r,t){if(!t)return[r];var n,o=function(e){var r="\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n ",t="\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n ",n=e.createShader(35633),o=e.createShader(35632),a=e.createProgram();if(!(o&&n&&a))return;e.shaderSource(n,r),e.shaderSource(o,t),e.compileShader(n),e.compileShader(o),e.attachShader(a,n),e.attachShader(a,o),e.linkProgram(a),e.detachShader(a,n),e.detachShader(a,o),e.deleteShader(n),e.deleteShader(o),e.useProgram(a);var c=e.createBuffer();e.bindBuffer(i,c),e.bufferData(i,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);var u=e.getAttribLocation(a,"aPosition");e.vertexAttribPointer(u,3,5126,!1,0,0),e.enableVertexAttribArray(u),e.clearColor(1,1,1,1),e.clear(16384),e.viewport(0,0,1,1),e.drawArrays(4,0,3);var l=new Uint8Array(4);return e.readPixels(0,0,1,1,6408,5121,l),e.deleteProgram(a),e.deleteBuffer(c),l.join("")}(e),a="801621810",c="8016218135",l="80162181161",f=(null==u?void 0:u.isIpad)?[["a7",l,12],["a8",c,15],["a8x",c,15],["a9",c,15],["a9x",c,15],["a10",c,15],["a10x",c,15],["a12",a,15],["a12x",a,15],["a12z",a,15],["a14",a,15],["a15",a,15],["m1",a,15],["m2",a,15]]:[["a7",l,12],["a8",c,12],["a9",c,15],["a10",c,15],["a11",a,15],["a12",a,15],["a13",a,15],["a14",a,15],["a15",a,15],["a16",a,15],["a17",a,15]];return"80162181255"===o?n=f.filter(function(e){return e[2]>=14}):(n=f.filter(function(e){return e[1]===o})).length||(n=f),n.map(function(e){var r=e[0];return"apple ".concat(r," gpu")})}var f=function(e){function t(r){var t=this.constructor,n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error);var d=[],s=[];function h(e,r){if(e===r)return 0;var t=e;e.length>r.length&&(e=r,r=t);for(var n=e.length,o=r.length;n>0&&e.charCodeAt(~-n)===r.charCodeAt(~-o);)n--,o--;for(var a,i=0;i<n&&e.charCodeAt(i)===r.charCodeAt(i);)i++;if(o-=i,0===(n-=i))return o;for(var c,u,l=0,f=0,h=0;f<n;)s[f]=e.charCodeAt(i+f),d[f]=++f;for(;h<o;)for(a=r.charCodeAt(i+h),c=h++,l=h,f=0;f<n;f++)u=a===s[f]?c:c+1,c=d[f],l=d[f]=c>l?u>l?l+1:u:u>c?c+1:u;return l}function p(e){return null!=e}e.getGPUTier=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(void 0,function(e,r,t){if(t||2===arguments.length)for(var n,o=0,a=r.length;o<a;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}([],e,!0),void 0,function(e){function r(e){return t(this,void 0,void 0,function(){var r,t,o,a,c,u,l,d,p,v,m,y,x,P,S,E,C,_,L,j,M,k,B,I,O,R,T;return n(this,function(n){switch(n.label){case 0:if(!(r=A(e)))return[2];t="".concat(g?"m":"d","-").concat(r).concat(s?"-ipad":"",".json"),o=i[t]=null!==(T=i[t])&&void 0!==T?T:w(t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,o];case 2:return a=n.sent(),[3,4];case 3:if((c=n.sent())instanceof f)throw c;return[2];case 4:if(u=function(e){var r,t=(e=e.replace(/\([^)]+\)/,"")).match(/\d+/)||e.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(r=null==t?void 0:t.join("").replace(/\W|amd/g,""))&&void 0!==r?r:""}(e),l=a.filter(function(e){return e[1]===u}),l.length||(l=a.filter(function(r){return r[0].includes(e)})),0===(d=l.length))return[2];for(p=e.split(/[.,()\[\]/\s]/g).sort().filter(function(e,r,t){return 0===r||e!==t[r-1]}).join(" "),v=d>1?l.map(function(e){return[e,h(p,e[2])]}).sort(function(e,r){return e[1]-r[1]})[0][0]:l[0],m=v[0],y=v[4],x=Number.MAX_VALUE,S=window.devicePixelRatio,E=b.width*S*b.height*S,C=0,_=y;C<_.length;C++)L=_[C],j=L[0],M=L[1],k=j*M,(B=Math.abs(E-k))<x&&(x=B,P=L);return P?(O=(I=P)[2],R=I[3],[2,[x,O,m,R]]):[2]}})})}var i,d,s,v,g,m,b,y,w,x,A,P,S,E,C,_,L,j,M,k,B,I,O,R,T,U=void 0===e?{}:e,D=U.mobileTiers,N=void 0===D?[0,15,30,60]:D,F=U.desktopTiers,G=void 0===F?[0,15,30,60]:F,W=U.override,K=void 0===W?{}:W,$=U.glContext,V=U.failIfMajorPerformanceCaveat,q=void 0!==V&&V,z=U.benchmarksURL,X=void 0===z?"https://unpkg.com/@grepp/detect-gpu@".concat("5.0.93","/dist/benchmarks"):z;return n(this,function(e){switch(e.label){case 0:if(i={},c)return[2,{tier:0,type:"SSR"}];if(d=K.isIpad,s=void 0===d?!!(null==u?void 0:u.isIpad):d,v=K.isMobile,g=void 0===v?!!(null==u?void 0:u.isMobile):v,m=K.screenSize,b=void 0===m?window.screen:m,y=K.loadBenchmarks,w=void 0===y?function(e){return t(void 0,void 0,void 0,function(){var r,t;return n(this,function(n){switch(n.label){case 0:return r=X.endsWith("/")?X:"".concat(X,"/"),[4,fetch("".concat(r).concat(e)).then(function(e){return e.json()})];case 1:if(t=n.sent(),parseInt(t.shift().split(".")[0],10)<4)throw new f("Detect GPU benchmark data is out of date. Please update to version 4x");return[2,t]}})})}:y,x=K.renderer,A=function(e){for(var r=0,t=g?["adreno","apple","mali-t","mali","nvidia","powervr","samsung"]:["intel","apple","amd","radeon","nvidia","geforce","adreno"];r<t.length;r++){var n=t[r];if(e.includes(n))return n}},P=function(e,r,t,n,o){return{device:o,fps:n,gpu:t,isMobile:g,tier:e,type:r}},E="",x)x=a(x),S=[x];else{if(C=$||function(e,r){void 0===r&&(r=!1);var t={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:r,powerPreference:"high-performance",stencil:!1};e&&delete t.powerPreference;var n=window.document.createElement("canvas"),o=n.getContext("webgl",t)||n.getContext("experimental-webgl",t);return null!=o?o:void 0}(null==u?void 0:u.isSafari12,q),!C)return[2,P(0,"WEBGL_UNSUPPORTED")];if(_=(null==u?void 0:u.isFirefox)?null:C.getExtension("WEBGL_debug_renderer_info"),!(x=_?C.getParameter(_.UNMASKED_RENDERER_WEBGL):C.getParameter(C.RENDERER)))return[2,P(1,"FALLBACK")];E=x,x=a(x),S=function(e,r,t){return"apple gpu"===r?l(e,r,t):[r]}(C,x,g)}return[4,Promise.all(S.map(r))];case 1:if(L=e.sent().filter(p).sort(function(e,r){var t=e[0],n=void 0===t?Number.MAX_VALUE:t,o=e[1],a=r[0],i=void 0===a?Number.MAX_VALUE:a,c=r[1];return n===i?o-c:n-i}),!L.length)return[2,(j=o.find(function(e){return x.includes(e)}))?P(0,"BLOCKLISTED",j):P(1,"FALLBACK","".concat(x," (").concat(E,")"))];if(M=L[0],k=M[1],B=M[2],I=M[3],-1===k)return[2,P(0,"BLOCKLISTED",B,k,I)];for(O=g?N:G,R=0,T=0;T<O.length;T++)k>=O[T]&&(R=T);return[2,P(R,"BENCHMARK",B,k,I)]}})})}});
|
|
2
2
|
//# sourceMappingURL=detect-gpu.umd.js.map
|
package/package.json
CHANGED