@grepp/detect-gpu 5.0.80 → 5.0.82
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 +28 -23
- package/dist/benchmarks/d-geforce.json +12 -17
- package/dist/benchmarks/d-intel.json +32 -1
- package/dist/benchmarks/d-nvidia.json +30 -17
- package/dist/benchmarks/d-radeon.json +28 -23
- package/dist/benchmarks/m-adreno.json +1 -1
- package/dist/benchmarks/m-apple-ipad.json +5 -11
- package/dist/benchmarks/m-apple.json +47 -7
- package/dist/benchmarks/m-mali.json +12 -6
- package/dist/detect-gpu.esm.js +1 -1
- package/dist/detect-gpu.umd.js +1 -1
- package/package.json +1 -1
@@ -2546,7 +2546,7 @@
|
|
2546
2546
|
[
|
2547
2547
|
1920,
|
2548
2548
|
1080,
|
2549
|
-
|
2549
|
+
60
|
2550
2550
|
],
|
2551
2551
|
[
|
2552
2552
|
1920,
|
@@ -5555,6 +5555,11 @@
|
|
5555
5555
|
"7850 amd hd radeon",
|
5556
5556
|
0,
|
5557
5557
|
[
|
5558
|
+
[
|
5559
|
+
1680,
|
5560
|
+
1050,
|
5561
|
+
60
|
5562
|
+
],
|
5558
5563
|
[
|
5559
5564
|
1920,
|
5560
5565
|
1080,
|
@@ -6709,7 +6714,7 @@
|
|
6709
6714
|
[
|
6710
6715
|
1280,
|
6711
6716
|
1024,
|
6712
|
-
|
6717
|
+
31
|
6713
6718
|
],
|
6714
6719
|
[
|
6715
6720
|
1920,
|
@@ -7441,7 +7446,7 @@
|
|
7441
7446
|
[
|
7442
7447
|
3584,
|
7443
7448
|
2240,
|
7444
|
-
|
7449
|
+
60
|
7445
7450
|
]
|
7446
7451
|
]
|
7447
7452
|
],
|
@@ -7485,11 +7490,6 @@
|
|
7485
7490
|
[
|
7486
7491
|
3584,
|
7487
7492
|
2240,
|
7488
|
-
139
|
7489
|
-
],
|
7490
|
-
[
|
7491
|
-
4096,
|
7492
|
-
2560,
|
7493
7493
|
60
|
7494
7494
|
]
|
7495
7495
|
]
|
@@ -11280,6 +11280,11 @@
|
|
11280
11280
|
1080,
|
11281
11281
|
350
|
11282
11282
|
],
|
11283
|
+
[
|
11284
|
+
2560,
|
11285
|
+
1440,
|
11286
|
+
75
|
11287
|
+
],
|
11283
11288
|
[
|
11284
11289
|
3840,
|
11285
11290
|
2160,
|
@@ -11491,6 +11496,11 @@
|
|
11491
11496
|
"6500 amd radeon rx xt",
|
11492
11497
|
0,
|
11493
11498
|
[
|
11499
|
+
[
|
11500
|
+
1680,
|
11501
|
+
1050,
|
11502
|
+
60
|
11503
|
+
],
|
11494
11504
|
[
|
11495
11505
|
1920,
|
11496
11506
|
1080,
|
@@ -11939,14 +11949,14 @@
|
|
11939
11949
|
0,
|
11940
11950
|
[
|
11941
11951
|
[
|
11942
|
-
|
11943
|
-
|
11944
|
-
|
11952
|
+
1920,
|
11953
|
+
1080,
|
11954
|
+
1093
|
11945
11955
|
],
|
11946
11956
|
[
|
11947
|
-
|
11957
|
+
3840,
|
11948
11958
|
2160,
|
11949
|
-
|
11959
|
+
60
|
11950
11960
|
]
|
11951
11961
|
]
|
11952
11962
|
],
|
@@ -11956,6 +11966,11 @@
|
|
11956
11966
|
"7600m amd radeon rx xt",
|
11957
11967
|
0,
|
11958
11968
|
[
|
11969
|
+
[
|
11970
|
+
1920,
|
11971
|
+
1080,
|
11972
|
+
731
|
11973
|
+
],
|
11959
11974
|
[
|
11960
11975
|
2560,
|
11961
11976
|
1600,
|
@@ -11965,11 +11980,6 @@
|
|
11965
11980
|
3440,
|
11966
11981
|
1440,
|
11967
11982
|
60
|
11968
|
-
],
|
11969
|
-
[
|
11970
|
-
3840,
|
11971
|
-
2160,
|
11972
|
-
71
|
11973
11983
|
]
|
11974
11984
|
]
|
11975
11985
|
],
|
@@ -12195,11 +12205,6 @@
|
|
12195
12205
|
3440,
|
12196
12206
|
1440,
|
12197
12207
|
60
|
12198
|
-
],
|
12199
|
-
[
|
12200
|
-
3360,
|
12201
|
-
2100,
|
12202
|
-
60
|
12203
12208
|
]
|
12204
12209
|
]
|
12205
12210
|
],
|
@@ -2737,7 +2737,7 @@
|
|
2737
2737
|
[
|
2738
2738
|
1920,
|
2739
2739
|
1080,
|
2740
|
-
|
2740
|
+
119
|
2741
2741
|
]
|
2742
2742
|
]
|
2743
2743
|
],
|
@@ -5631,11 +5631,6 @@
|
|
5631
5631
|
[
|
5632
5632
|
1920,
|
5633
5633
|
1080,
|
5634
|
-
144
|
5635
|
-
],
|
5636
|
-
[
|
5637
|
-
2880,
|
5638
|
-
1620,
|
5639
5634
|
120
|
5640
5635
|
]
|
5641
5636
|
]
|
@@ -5675,7 +5670,7 @@
|
|
5675
5670
|
[
|
5676
5671
|
1920,
|
5677
5672
|
1080,
|
5678
|
-
|
5673
|
+
165
|
5679
5674
|
]
|
5680
5675
|
]
|
5681
5676
|
],
|
@@ -5934,7 +5929,7 @@
|
|
5934
5929
|
[
|
5935
5930
|
1920,
|
5936
5931
|
1080,
|
5937
|
-
|
5932
|
+
165
|
5938
5933
|
]
|
5939
5934
|
]
|
5940
5935
|
],
|
@@ -5947,7 +5942,7 @@
|
|
5947
5942
|
[
|
5948
5943
|
1920,
|
5949
5944
|
1080,
|
5950
|
-
|
5945
|
+
970
|
5951
5946
|
]
|
5952
5947
|
]
|
5953
5948
|
],
|
@@ -6117,6 +6112,11 @@
|
|
6117
6112
|
"5060 geforce nvidia rtx",
|
6118
6113
|
0,
|
6119
6114
|
[
|
6115
|
+
[
|
6116
|
+
1360,
|
6117
|
+
768,
|
6118
|
+
60
|
6119
|
+
],
|
6120
6120
|
[
|
6121
6121
|
2560,
|
6122
6122
|
1440,
|
@@ -6130,15 +6130,10 @@
|
|
6130
6130
|
"5060 geforce gpu laptop nvidia rtx",
|
6131
6131
|
0,
|
6132
6132
|
[
|
6133
|
-
[
|
6134
|
-
1920,
|
6135
|
-
1080,
|
6136
|
-
60
|
6137
|
-
],
|
6138
6133
|
[
|
6139
6134
|
2560,
|
6140
6135
|
1600,
|
6141
|
-
|
6136
|
+
165
|
6142
6137
|
]
|
6143
6138
|
]
|
6144
6139
|
],
|
@@ -6187,7 +6182,7 @@
|
|
6187
6182
|
[
|
6188
6183
|
2560,
|
6189
6184
|
1600,
|
6190
|
-
|
6185
|
+
165
|
6191
6186
|
]
|
6192
6187
|
]
|
6193
6188
|
],
|
@@ -6231,7 +6226,7 @@
|
|
6231
6226
|
[
|
6232
6227
|
1920,
|
6233
6228
|
1080,
|
6234
|
-
|
6229
|
+
240
|
6235
6230
|
],
|
6236
6231
|
[
|
6237
6232
|
3840,
|
@@ -49,6 +49,19 @@
|
|
49
49
|
]
|
50
50
|
]
|
51
51
|
],
|
52
|
+
[
|
53
|
+
"intel arc [3] gpu ri",
|
54
|
+
"3",
|
55
|
+
" 3 arc gpu intel ri",
|
56
|
+
0,
|
57
|
+
[
|
58
|
+
[
|
59
|
+
2880,
|
60
|
+
1800,
|
61
|
+
188
|
62
|
+
]
|
63
|
+
]
|
64
|
+
],
|
52
65
|
[
|
53
66
|
"intel arc 130v gpu",
|
54
67
|
"130",
|
@@ -421,6 +434,19 @@
|
|
421
434
|
]
|
422
435
|
]
|
423
436
|
],
|
437
|
+
[
|
438
|
+
"intel arc pro b50",
|
439
|
+
"50",
|
440
|
+
"arc b50 intel pro",
|
441
|
+
0,
|
442
|
+
[
|
443
|
+
[
|
444
|
+
3840,
|
445
|
+
2160,
|
446
|
+
256
|
447
|
+
]
|
448
|
+
]
|
449
|
+
],
|
424
450
|
[
|
425
451
|
"intel broxton-p hd",
|
426
452
|
"p",
|
@@ -1371,7 +1397,7 @@
|
|
1371
1397
|
[
|
1372
1398
|
1280,
|
1373
1399
|
800,
|
1374
|
-
|
1400
|
+
32
|
1375
1401
|
],
|
1376
1402
|
[
|
1377
1403
|
1366,
|
@@ -3178,6 +3204,11 @@
|
|
3178
3204
|
1080,
|
3179
3205
|
58
|
3180
3206
|
],
|
3207
|
+
[
|
3208
|
+
1920,
|
3209
|
+
1200,
|
3210
|
+
60
|
3211
|
+
],
|
3181
3212
|
[
|
3182
3213
|
2560,
|
3183
3214
|
1600,
|
@@ -2976,7 +2976,7 @@
|
|
2976
2976
|
[
|
2977
2977
|
1920,
|
2978
2978
|
1080,
|
2979
|
-
|
2979
|
+
119
|
2980
2980
|
]
|
2981
2981
|
]
|
2982
2982
|
],
|
@@ -5870,11 +5870,6 @@
|
|
5870
5870
|
[
|
5871
5871
|
1920,
|
5872
5872
|
1080,
|
5873
|
-
144
|
5874
|
-
],
|
5875
|
-
[
|
5876
|
-
2880,
|
5877
|
-
1620,
|
5878
5873
|
120
|
5879
5874
|
]
|
5880
5875
|
]
|
@@ -5914,7 +5909,7 @@
|
|
5914
5909
|
[
|
5915
5910
|
1920,
|
5916
5911
|
1080,
|
5917
|
-
|
5912
|
+
165
|
5918
5913
|
]
|
5919
5914
|
]
|
5920
5915
|
],
|
@@ -6173,7 +6168,7 @@
|
|
6173
6168
|
[
|
6174
6169
|
1920,
|
6175
6170
|
1080,
|
6176
|
-
|
6171
|
+
165
|
6177
6172
|
]
|
6178
6173
|
]
|
6179
6174
|
],
|
@@ -6186,7 +6181,7 @@
|
|
6186
6181
|
[
|
6187
6182
|
1920,
|
6188
6183
|
1080,
|
6189
|
-
|
6184
|
+
970
|
6190
6185
|
]
|
6191
6186
|
]
|
6192
6187
|
],
|
@@ -6356,6 +6351,11 @@
|
|
6356
6351
|
"5060 geforce nvidia rtx",
|
6357
6352
|
0,
|
6358
6353
|
[
|
6354
|
+
[
|
6355
|
+
1360,
|
6356
|
+
768,
|
6357
|
+
60
|
6358
|
+
],
|
6359
6359
|
[
|
6360
6360
|
2560,
|
6361
6361
|
1440,
|
@@ -6369,15 +6369,10 @@
|
|
6369
6369
|
"5060 geforce gpu laptop nvidia rtx",
|
6370
6370
|
0,
|
6371
6371
|
[
|
6372
|
-
[
|
6373
|
-
1920,
|
6374
|
-
1080,
|
6375
|
-
60
|
6376
|
-
],
|
6377
6372
|
[
|
6378
6373
|
2560,
|
6379
6374
|
1600,
|
6380
|
-
|
6375
|
+
165
|
6381
6376
|
]
|
6382
6377
|
]
|
6383
6378
|
],
|
@@ -6426,7 +6421,7 @@
|
|
6426
6421
|
[
|
6427
6422
|
2560,
|
6428
6423
|
1600,
|
6429
|
-
|
6424
|
+
165
|
6430
6425
|
]
|
6431
6426
|
]
|
6432
6427
|
],
|
@@ -6470,7 +6465,7 @@
|
|
6470
6465
|
[
|
6471
6466
|
1920,
|
6472
6467
|
1080,
|
6473
|
-
|
6468
|
+
240
|
6474
6469
|
],
|
6475
6470
|
[
|
6476
6471
|
3840,
|
@@ -10772,6 +10767,19 @@
|
|
10772
10767
|
]
|
10773
10768
|
]
|
10774
10769
|
],
|
10770
|
+
[
|
10771
|
+
"nvidia rtx 1000 ada generation laptop gpu",
|
10772
|
+
"1000",
|
10773
|
+
"1000 ada generation gpu laptop nvidia rtx",
|
10774
|
+
0,
|
10775
|
+
[
|
10776
|
+
[
|
10777
|
+
2560,
|
10778
|
+
1600,
|
10779
|
+
164
|
10780
|
+
]
|
10781
|
+
]
|
10782
|
+
],
|
10775
10783
|
[
|
10776
10784
|
"nvidia rtx 2000 ada generation",
|
10777
10785
|
"2000",
|
@@ -10972,6 +10980,11 @@
|
|
10972
10980
|
1080,
|
10973
10981
|
60
|
10974
10982
|
],
|
10983
|
+
[
|
10984
|
+
1920,
|
10985
|
+
1200,
|
10986
|
+
60
|
10987
|
+
],
|
10975
10988
|
[
|
10976
10989
|
3840,
|
10977
10990
|
2160,
|
@@ -584,7 +584,7 @@
|
|
584
584
|
[
|
585
585
|
1920,
|
586
586
|
1080,
|
587
|
-
|
587
|
+
60
|
588
588
|
],
|
589
589
|
[
|
590
590
|
1920,
|
@@ -3593,6 +3593,11 @@
|
|
3593
3593
|
"7850 amd hd radeon",
|
3594
3594
|
0,
|
3595
3595
|
[
|
3596
|
+
[
|
3597
|
+
1680,
|
3598
|
+
1050,
|
3599
|
+
60
|
3600
|
+
],
|
3596
3601
|
[
|
3597
3602
|
1920,
|
3598
3603
|
1080,
|
@@ -4747,7 +4752,7 @@
|
|
4747
4752
|
[
|
4748
4753
|
1280,
|
4749
4754
|
1024,
|
4750
|
-
|
4755
|
+
31
|
4751
4756
|
],
|
4752
4757
|
[
|
4753
4758
|
1920,
|
@@ -5479,7 +5484,7 @@
|
|
5479
5484
|
[
|
5480
5485
|
3584,
|
5481
5486
|
2240,
|
5482
|
-
|
5487
|
+
60
|
5483
5488
|
]
|
5484
5489
|
]
|
5485
5490
|
],
|
@@ -5523,11 +5528,6 @@
|
|
5523
5528
|
[
|
5524
5529
|
3584,
|
5525
5530
|
2240,
|
5526
|
-
139
|
5527
|
-
],
|
5528
|
-
[
|
5529
|
-
4096,
|
5530
|
-
2560,
|
5531
5531
|
60
|
5532
5532
|
]
|
5533
5533
|
]
|
@@ -9318,6 +9318,11 @@
|
|
9318
9318
|
1080,
|
9319
9319
|
350
|
9320
9320
|
],
|
9321
|
+
[
|
9322
|
+
2560,
|
9323
|
+
1440,
|
9324
|
+
75
|
9325
|
+
],
|
9321
9326
|
[
|
9322
9327
|
3840,
|
9323
9328
|
2160,
|
@@ -9529,6 +9534,11 @@
|
|
9529
9534
|
"6500 amd radeon rx xt",
|
9530
9535
|
0,
|
9531
9536
|
[
|
9537
|
+
[
|
9538
|
+
1680,
|
9539
|
+
1050,
|
9540
|
+
60
|
9541
|
+
],
|
9532
9542
|
[
|
9533
9543
|
1920,
|
9534
9544
|
1080,
|
@@ -9977,14 +9987,14 @@
|
|
9977
9987
|
0,
|
9978
9988
|
[
|
9979
9989
|
[
|
9980
|
-
|
9981
|
-
|
9982
|
-
|
9990
|
+
1920,
|
9991
|
+
1080,
|
9992
|
+
1093
|
9983
9993
|
],
|
9984
9994
|
[
|
9985
|
-
|
9995
|
+
3840,
|
9986
9996
|
2160,
|
9987
|
-
|
9997
|
+
60
|
9988
9998
|
]
|
9989
9999
|
]
|
9990
10000
|
],
|
@@ -9994,6 +10004,11 @@
|
|
9994
10004
|
"7600m amd radeon rx xt",
|
9995
10005
|
0,
|
9996
10006
|
[
|
10007
|
+
[
|
10008
|
+
1920,
|
10009
|
+
1080,
|
10010
|
+
731
|
10011
|
+
],
|
9997
10012
|
[
|
9998
10013
|
2560,
|
9999
10014
|
1600,
|
@@ -10003,11 +10018,6 @@
|
|
10003
10018
|
3440,
|
10004
10019
|
1440,
|
10005
10020
|
60
|
10006
|
-
],
|
10007
|
-
[
|
10008
|
-
3840,
|
10009
|
-
2160,
|
10010
|
-
71
|
10011
10021
|
]
|
10012
10022
|
]
|
10013
10023
|
],
|
@@ -10233,11 +10243,6 @@
|
|
10233
10243
|
3440,
|
10234
10244
|
1440,
|
10235
10245
|
60
|
10236
|
-
],
|
10237
|
-
[
|
10238
|
-
3360,
|
10239
|
-
2100,
|
10240
|
-
60
|
10241
10246
|
]
|
10242
10247
|
]
|
10243
10248
|
],
|
@@ -61,7 +61,7 @@
|
|
61
61
|
[
|
62
62
|
2160,
|
63
63
|
1620,
|
64
|
-
|
64
|
+
57,
|
65
65
|
"apple ipad 8th gen (wifi+cellular)"
|
66
66
|
],
|
67
67
|
[
|
@@ -190,7 +190,7 @@
|
|
190
190
|
2266,
|
191
191
|
1488,
|
192
192
|
60,
|
193
|
-
"apple ipad mini
|
193
|
+
"apple ipad mini (a17)"
|
194
194
|
]
|
195
195
|
]
|
196
196
|
],
|
@@ -311,14 +311,8 @@
|
|
311
311
|
[
|
312
312
|
2388,
|
313
313
|
1668,
|
314
|
-
|
315
|
-
"apple ipad
|
316
|
-
],
|
317
|
-
[
|
318
|
-
2730,
|
319
|
-
2048,
|
320
|
-
120,
|
321
|
-
"apple ipad pro 12.9-inch (6th generation)"
|
314
|
+
60,
|
315
|
+
"apple ipad air 6th gen (m2)"
|
322
316
|
],
|
323
317
|
[
|
324
318
|
2732,
|
@@ -369,7 +363,7 @@
|
|
369
363
|
[
|
370
364
|
2752,
|
371
365
|
2064,
|
372
|
-
|
366
|
+
121,
|
373
367
|
"apple ipad pro 12.9 inch 7th gen"
|
374
368
|
]
|
375
369
|
]
|
@@ -61,14 +61,14 @@
|
|
61
61
|
[
|
62
62
|
1792,
|
63
63
|
828,
|
64
|
-
|
64
|
+
60,
|
65
65
|
"apple iphone xr"
|
66
66
|
],
|
67
67
|
[
|
68
68
|
2436,
|
69
69
|
1125,
|
70
|
-
|
71
|
-
"apple iphone xs
|
70
|
+
58,
|
71
|
+
"apple iphone xs"
|
72
72
|
],
|
73
73
|
[
|
74
74
|
2208,
|
@@ -105,7 +105,7 @@
|
|
105
105
|
[
|
106
106
|
2688,
|
107
107
|
1242,
|
108
|
-
|
108
|
+
70,
|
109
109
|
"apple iphone 11 pro max"
|
110
110
|
]
|
111
111
|
]
|
@@ -151,7 +151,7 @@
|
|
151
151
|
[
|
152
152
|
1334,
|
153
153
|
750,
|
154
|
-
|
154
|
+
60,
|
155
155
|
"apple iphone se (2022)"
|
156
156
|
],
|
157
157
|
[
|
@@ -190,7 +190,7 @@
|
|
190
190
|
2778,
|
191
191
|
1284,
|
192
192
|
60,
|
193
|
-
"apple iphone
|
193
|
+
"apple iphone 15 plus"
|
194
194
|
]
|
195
195
|
]
|
196
196
|
],
|
@@ -223,7 +223,7 @@
|
|
223
223
|
[
|
224
224
|
2532,
|
225
225
|
1170,
|
226
|
-
|
226
|
+
41,
|
227
227
|
"apple iphone 16 (iphone17,5)"
|
228
228
|
],
|
229
229
|
[
|
@@ -254,6 +254,46 @@
|
|
254
254
|
]
|
255
255
|
]
|
256
256
|
],
|
257
|
+
[
|
258
|
+
"apple a19 gpu",
|
259
|
+
"19",
|
260
|
+
"a19 apple gpu",
|
261
|
+
0,
|
262
|
+
[
|
263
|
+
[
|
264
|
+
2532,
|
265
|
+
1170,
|
266
|
+
60,
|
267
|
+
"apple iphone 17"
|
268
|
+
]
|
269
|
+
]
|
270
|
+
],
|
271
|
+
[
|
272
|
+
"apple a19 pro gpu",
|
273
|
+
"19",
|
274
|
+
"a19 apple gpu pro",
|
275
|
+
0,
|
276
|
+
[
|
277
|
+
[
|
278
|
+
2532,
|
279
|
+
1170,
|
280
|
+
60,
|
281
|
+
"apple iphone 17 pro"
|
282
|
+
],
|
283
|
+
[
|
284
|
+
2688,
|
285
|
+
1242,
|
286
|
+
60,
|
287
|
+
"apple iphone air"
|
288
|
+
],
|
289
|
+
[
|
290
|
+
2778,
|
291
|
+
1284,
|
292
|
+
60,
|
293
|
+
"apple iphone 17 pro max"
|
294
|
+
]
|
295
|
+
]
|
296
|
+
],
|
257
297
|
[
|
258
298
|
"apple a7 gpu",
|
259
299
|
"7",
|
@@ -150,6 +150,12 @@
|
|
150
150
|
36,
|
151
151
|
"samsung galaxy a15"
|
152
152
|
],
|
153
|
+
[
|
154
|
+
2174,
|
155
|
+
1080,
|
156
|
+
39,
|
157
|
+
"poco m4 pro 5g (21091116ag)"
|
158
|
+
],
|
153
159
|
[
|
154
160
|
2177,
|
155
161
|
1080,
|
@@ -161,12 +167,6 @@
|
|
161
167
|
1080,
|
162
168
|
35,
|
163
169
|
"samsung galaxy a22 5g"
|
164
|
-
],
|
165
|
-
[
|
166
|
-
2304,
|
167
|
-
1080,
|
168
|
-
34,
|
169
|
-
"poco m4 pro 5g (21091116ag)"
|
170
170
|
]
|
171
171
|
]
|
172
172
|
],
|
@@ -680,6 +680,12 @@
|
|
680
680
|
"arm mali-g925-immortalis mc12",
|
681
681
|
0,
|
682
682
|
[
|
683
|
+
[
|
684
|
+
2376,
|
685
|
+
1080,
|
686
|
+
60,
|
687
|
+
"oppo find x8 pro"
|
688
|
+
],
|
683
689
|
[
|
684
690
|
2800,
|
685
691
|
1260,
|
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.82/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=yield fetch(`${h}/${t}`).then(e=>e.json());if(parseInt(e.shift().split(".")[0],10)<4)throw new c("Detect GPU benchmark data is out of date. Please update to version 4x");return e})}=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 M=v?n:d;let $=0;for(let e=0;e<M.length;e++)y>=M[e]&&($=e);return P($,"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,K=U.override,W=void 0===K?{}:K,$=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,K=U.override,W=void 0===K?{}:K,$=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.82","/dist/benchmarks"):z;return n(this,function(e){switch(e.label){case 0:if(i={},c)return[2,{tier:0,type:"SSR"}];if(d=W.isIpad,s=void 0===d?!!(null==u?void 0:u.isIpad):d,v=W.isMobile,g=void 0===v?!!(null==u?void 0:u.isMobile):v,m=W.screenSize,b=void 0===m?window.screen:m,y=W.loadBenchmarks,w=void 0===y?function(e){return t(void 0,void 0,void 0,function(){var r;return n(this,function(t){switch(t.label){case 0:return[4,fetch("".concat(X,"/").concat(e)).then(function(e){return e.json()})];case 1:if(r=t.sent(),parseInt(r.shift().split(".")[0],10)<4)throw new f("Detect GPU benchmark data is out of date. Please update to version 4x");return[2,r]}})})}:y,x=W.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