@grepp/detect-gpu 5.0.84 → 5.0.86
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 +24 -24
- package/dist/benchmarks/d-geforce.json +22 -9
- package/dist/benchmarks/d-intel.json +2 -2
- package/dist/benchmarks/d-nvidia.json +22 -9
- package/dist/benchmarks/d-radeon.json +24 -24
- package/dist/benchmarks/m-apple-ipad.json +8 -8
- package/dist/benchmarks/m-apple.json +3 -9
- package/dist/detect-gpu.esm.js +1 -1
- package/dist/detect-gpu.umd.js +1 -1
- package/package.json +1 -1
|
@@ -2954,11 +2954,6 @@
|
|
|
2954
2954
|
"8060s amd radeon",
|
|
2955
2955
|
0,
|
|
2956
2956
|
[
|
|
2957
|
-
[
|
|
2958
|
-
1920,
|
|
2959
|
-
1080,
|
|
2960
|
-
60
|
|
2961
|
-
],
|
|
2962
2957
|
[
|
|
2963
2958
|
3840,
|
|
2964
2959
|
2160,
|
|
@@ -7482,7 +7477,7 @@
|
|
|
7482
7477
|
[
|
|
7483
7478
|
3584,
|
|
7484
7479
|
2240,
|
|
7485
|
-
|
|
7480
|
+
130
|
|
7486
7481
|
]
|
|
7487
7482
|
]
|
|
7488
7483
|
],
|
|
@@ -7750,6 +7745,11 @@
|
|
|
7750
7745
|
"580 amd pro radeon",
|
|
7751
7746
|
0,
|
|
7752
7747
|
[
|
|
7748
|
+
[
|
|
7749
|
+
3840,
|
|
7750
|
+
2160,
|
|
7751
|
+
60
|
|
7752
|
+
],
|
|
7753
7753
|
[
|
|
7754
7754
|
5120,
|
|
7755
7755
|
2880,
|
|
@@ -8473,7 +8473,7 @@
|
|
|
8473
8473
|
[
|
|
8474
8474
|
1920,
|
|
8475
8475
|
1080,
|
|
8476
|
-
|
|
8476
|
+
60
|
|
8477
8477
|
],
|
|
8478
8478
|
[
|
|
8479
8479
|
2560,
|
|
@@ -11505,11 +11505,6 @@
|
|
|
11505
11505
|
2560,
|
|
11506
11506
|
1440,
|
|
11507
11507
|
165
|
|
11508
|
-
],
|
|
11509
|
-
[
|
|
11510
|
-
4608,
|
|
11511
|
-
2592,
|
|
11512
|
-
46
|
|
11513
11508
|
]
|
|
11514
11509
|
]
|
|
11515
11510
|
],
|
|
@@ -11550,15 +11545,15 @@
|
|
|
11550
11545
|
"6500 amd radeon rx xt",
|
|
11551
11546
|
0,
|
|
11552
11547
|
[
|
|
11553
|
-
[
|
|
11554
|
-
1680,
|
|
11555
|
-
1050,
|
|
11556
|
-
60
|
|
11557
|
-
],
|
|
11558
11548
|
[
|
|
11559
11549
|
1920,
|
|
11560
11550
|
1080,
|
|
11561
11551
|
75
|
|
11552
|
+
],
|
|
11553
|
+
[
|
|
11554
|
+
3840,
|
|
11555
|
+
2160,
|
|
11556
|
+
59
|
|
11562
11557
|
]
|
|
11563
11558
|
]
|
|
11564
11559
|
],
|
|
@@ -11844,11 +11839,6 @@
|
|
|
11844
11839
|
2160,
|
|
11845
11840
|
144
|
|
11846
11841
|
],
|
|
11847
|
-
[
|
|
11848
|
-
5120,
|
|
11849
|
-
2880,
|
|
11850
|
-
59
|
|
11851
|
-
],
|
|
11852
11842
|
[
|
|
11853
11843
|
6400,
|
|
11854
11844
|
2666,
|
|
@@ -12077,7 +12067,12 @@
|
|
|
12077
12067
|
[
|
|
12078
12068
|
1920,
|
|
12079
12069
|
1080,
|
|
12080
|
-
|
|
12070
|
+
180
|
|
12071
|
+
],
|
|
12072
|
+
[
|
|
12073
|
+
2560,
|
|
12074
|
+
1440,
|
|
12075
|
+
1063
|
|
12081
12076
|
]
|
|
12082
12077
|
]
|
|
12083
12078
|
],
|
|
@@ -12121,7 +12116,7 @@
|
|
|
12121
12116
|
[
|
|
12122
12117
|
2560,
|
|
12123
12118
|
1440,
|
|
12124
|
-
|
|
12119
|
+
260
|
|
12125
12120
|
],
|
|
12126
12121
|
[
|
|
12127
12122
|
3840,
|
|
@@ -12152,6 +12147,11 @@
|
|
|
12152
12147
|
[
|
|
12153
12148
|
1920,
|
|
12154
12149
|
1080,
|
|
12150
|
+
1247
|
|
12151
|
+
],
|
|
12152
|
+
[
|
|
12153
|
+
3840,
|
|
12154
|
+
2160,
|
|
12155
12155
|
60
|
|
12156
12156
|
]
|
|
12157
12157
|
]
|
|
@@ -5361,7 +5361,7 @@
|
|
|
5361
5361
|
[
|
|
5362
5362
|
2560,
|
|
5363
5363
|
1440,
|
|
5364
|
-
|
|
5364
|
+
75
|
|
5365
5365
|
]
|
|
5366
5366
|
]
|
|
5367
5367
|
],
|
|
@@ -5658,11 +5658,6 @@
|
|
|
5658
5658
|
1920,
|
|
5659
5659
|
1080,
|
|
5660
5660
|
693
|
|
5661
|
-
],
|
|
5662
|
-
[
|
|
5663
|
-
2560,
|
|
5664
|
-
1440,
|
|
5665
|
-
180
|
|
5666
5661
|
]
|
|
5667
5662
|
]
|
|
5668
5663
|
],
|
|
@@ -5675,7 +5670,7 @@
|
|
|
5675
5670
|
[
|
|
5676
5671
|
1920,
|
|
5677
5672
|
1080,
|
|
5678
|
-
|
|
5673
|
+
587
|
|
5679
5674
|
]
|
|
5680
5675
|
]
|
|
5681
5676
|
],
|
|
@@ -5714,7 +5709,7 @@
|
|
|
5714
5709
|
[
|
|
5715
5710
|
1920,
|
|
5716
5711
|
1080,
|
|
5717
|
-
|
|
5712
|
+
60
|
|
5718
5713
|
]
|
|
5719
5714
|
]
|
|
5720
5715
|
],
|
|
@@ -5986,7 +5981,7 @@
|
|
|
5986
5981
|
[
|
|
5987
5982
|
1920,
|
|
5988
5983
|
1080,
|
|
5989
|
-
|
|
5984
|
+
164
|
|
5990
5985
|
]
|
|
5991
5986
|
]
|
|
5992
5987
|
],
|
|
@@ -6119,6 +6114,19 @@
|
|
|
6119
6114
|
]
|
|
6120
6115
|
]
|
|
6121
6116
|
],
|
|
6117
|
+
[
|
|
6118
|
+
"nvidia geforce rtx 5050 laptop gpu",
|
|
6119
|
+
"5050",
|
|
6120
|
+
"5050 geforce gpu laptop nvidia rtx",
|
|
6121
|
+
0,
|
|
6122
|
+
[
|
|
6123
|
+
[
|
|
6124
|
+
1920,
|
|
6125
|
+
1080,
|
|
6126
|
+
60
|
|
6127
|
+
]
|
|
6128
|
+
]
|
|
6129
|
+
],
|
|
6122
6130
|
[
|
|
6123
6131
|
"nvidia geforce rtx 5060",
|
|
6124
6132
|
"5060",
|
|
@@ -6138,6 +6146,11 @@
|
|
|
6138
6146
|
"5060 geforce gpu laptop nvidia rtx",
|
|
6139
6147
|
0,
|
|
6140
6148
|
[
|
|
6149
|
+
[
|
|
6150
|
+
1920,
|
|
6151
|
+
1080,
|
|
6152
|
+
240
|
|
6153
|
+
],
|
|
6141
6154
|
[
|
|
6142
6155
|
2560,
|
|
6143
6156
|
1600,
|
|
@@ -5600,7 +5600,7 @@
|
|
|
5600
5600
|
[
|
|
5601
5601
|
2560,
|
|
5602
5602
|
1440,
|
|
5603
|
-
|
|
5603
|
+
75
|
|
5604
5604
|
]
|
|
5605
5605
|
]
|
|
5606
5606
|
],
|
|
@@ -5897,11 +5897,6 @@
|
|
|
5897
5897
|
1920,
|
|
5898
5898
|
1080,
|
|
5899
5899
|
693
|
|
5900
|
-
],
|
|
5901
|
-
[
|
|
5902
|
-
2560,
|
|
5903
|
-
1440,
|
|
5904
|
-
180
|
|
5905
5900
|
]
|
|
5906
5901
|
]
|
|
5907
5902
|
],
|
|
@@ -5914,7 +5909,7 @@
|
|
|
5914
5909
|
[
|
|
5915
5910
|
1920,
|
|
5916
5911
|
1080,
|
|
5917
|
-
|
|
5912
|
+
587
|
|
5918
5913
|
]
|
|
5919
5914
|
]
|
|
5920
5915
|
],
|
|
@@ -5953,7 +5948,7 @@
|
|
|
5953
5948
|
[
|
|
5954
5949
|
1920,
|
|
5955
5950
|
1080,
|
|
5956
|
-
|
|
5951
|
+
60
|
|
5957
5952
|
]
|
|
5958
5953
|
]
|
|
5959
5954
|
],
|
|
@@ -6225,7 +6220,7 @@
|
|
|
6225
6220
|
[
|
|
6226
6221
|
1920,
|
|
6227
6222
|
1080,
|
|
6228
|
-
|
|
6223
|
+
164
|
|
6229
6224
|
]
|
|
6230
6225
|
]
|
|
6231
6226
|
],
|
|
@@ -6358,6 +6353,19 @@
|
|
|
6358
6353
|
]
|
|
6359
6354
|
]
|
|
6360
6355
|
],
|
|
6356
|
+
[
|
|
6357
|
+
"nvidia geforce rtx 5050 laptop gpu",
|
|
6358
|
+
"5050",
|
|
6359
|
+
"5050 geforce gpu laptop nvidia rtx",
|
|
6360
|
+
0,
|
|
6361
|
+
[
|
|
6362
|
+
[
|
|
6363
|
+
1920,
|
|
6364
|
+
1080,
|
|
6365
|
+
60
|
|
6366
|
+
]
|
|
6367
|
+
]
|
|
6368
|
+
],
|
|
6361
6369
|
[
|
|
6362
6370
|
"nvidia geforce rtx 5060",
|
|
6363
6371
|
"5060",
|
|
@@ -6377,6 +6385,11 @@
|
|
|
6377
6385
|
"5060 geforce gpu laptop nvidia rtx",
|
|
6378
6386
|
0,
|
|
6379
6387
|
[
|
|
6388
|
+
[
|
|
6389
|
+
1920,
|
|
6390
|
+
1080,
|
|
6391
|
+
240
|
|
6392
|
+
],
|
|
6380
6393
|
[
|
|
6381
6394
|
2560,
|
|
6382
6395
|
1600,
|
|
@@ -992,11 +992,6 @@
|
|
|
992
992
|
"8060s amd radeon",
|
|
993
993
|
0,
|
|
994
994
|
[
|
|
995
|
-
[
|
|
996
|
-
1920,
|
|
997
|
-
1080,
|
|
998
|
-
60
|
|
999
|
-
],
|
|
1000
995
|
[
|
|
1001
996
|
3840,
|
|
1002
997
|
2160,
|
|
@@ -5520,7 +5515,7 @@
|
|
|
5520
5515
|
[
|
|
5521
5516
|
3584,
|
|
5522
5517
|
2240,
|
|
5523
|
-
|
|
5518
|
+
130
|
|
5524
5519
|
]
|
|
5525
5520
|
]
|
|
5526
5521
|
],
|
|
@@ -5788,6 +5783,11 @@
|
|
|
5788
5783
|
"580 amd pro radeon",
|
|
5789
5784
|
0,
|
|
5790
5785
|
[
|
|
5786
|
+
[
|
|
5787
|
+
3840,
|
|
5788
|
+
2160,
|
|
5789
|
+
60
|
|
5790
|
+
],
|
|
5791
5791
|
[
|
|
5792
5792
|
5120,
|
|
5793
5793
|
2880,
|
|
@@ -6511,7 +6511,7 @@
|
|
|
6511
6511
|
[
|
|
6512
6512
|
1920,
|
|
6513
6513
|
1080,
|
|
6514
|
-
|
|
6514
|
+
60
|
|
6515
6515
|
],
|
|
6516
6516
|
[
|
|
6517
6517
|
2560,
|
|
@@ -9543,11 +9543,6 @@
|
|
|
9543
9543
|
2560,
|
|
9544
9544
|
1440,
|
|
9545
9545
|
165
|
|
9546
|
-
],
|
|
9547
|
-
[
|
|
9548
|
-
4608,
|
|
9549
|
-
2592,
|
|
9550
|
-
46
|
|
9551
9546
|
]
|
|
9552
9547
|
]
|
|
9553
9548
|
],
|
|
@@ -9588,15 +9583,15 @@
|
|
|
9588
9583
|
"6500 amd radeon rx xt",
|
|
9589
9584
|
0,
|
|
9590
9585
|
[
|
|
9591
|
-
[
|
|
9592
|
-
1680,
|
|
9593
|
-
1050,
|
|
9594
|
-
60
|
|
9595
|
-
],
|
|
9596
9586
|
[
|
|
9597
9587
|
1920,
|
|
9598
9588
|
1080,
|
|
9599
9589
|
75
|
|
9590
|
+
],
|
|
9591
|
+
[
|
|
9592
|
+
3840,
|
|
9593
|
+
2160,
|
|
9594
|
+
59
|
|
9600
9595
|
]
|
|
9601
9596
|
]
|
|
9602
9597
|
],
|
|
@@ -9882,11 +9877,6 @@
|
|
|
9882
9877
|
2160,
|
|
9883
9878
|
144
|
|
9884
9879
|
],
|
|
9885
|
-
[
|
|
9886
|
-
5120,
|
|
9887
|
-
2880,
|
|
9888
|
-
59
|
|
9889
|
-
],
|
|
9890
9880
|
[
|
|
9891
9881
|
6400,
|
|
9892
9882
|
2666,
|
|
@@ -10115,7 +10105,12 @@
|
|
|
10115
10105
|
[
|
|
10116
10106
|
1920,
|
|
10117
10107
|
1080,
|
|
10118
|
-
|
|
10108
|
+
180
|
|
10109
|
+
],
|
|
10110
|
+
[
|
|
10111
|
+
2560,
|
|
10112
|
+
1440,
|
|
10113
|
+
1063
|
|
10119
10114
|
]
|
|
10120
10115
|
]
|
|
10121
10116
|
],
|
|
@@ -10159,7 +10154,7 @@
|
|
|
10159
10154
|
[
|
|
10160
10155
|
2560,
|
|
10161
10156
|
1440,
|
|
10162
|
-
|
|
10157
|
+
260
|
|
10163
10158
|
],
|
|
10164
10159
|
[
|
|
10165
10160
|
3840,
|
|
@@ -10190,6 +10185,11 @@
|
|
|
10190
10185
|
[
|
|
10191
10186
|
1920,
|
|
10192
10187
|
1080,
|
|
10188
|
+
1247
|
|
10189
|
+
],
|
|
10190
|
+
[
|
|
10191
|
+
3840,
|
|
10192
|
+
2160,
|
|
10193
10193
|
60
|
|
10194
10194
|
]
|
|
10195
10195
|
]
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
[
|
|
36
36
|
2224,
|
|
37
37
|
1668,
|
|
38
|
-
|
|
38
|
+
1596,
|
|
39
39
|
"apple ipad pro (10.5-inch)"
|
|
40
40
|
],
|
|
41
41
|
[
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
[
|
|
102
102
|
2388,
|
|
103
103
|
1668,
|
|
104
|
-
|
|
104
|
+
102,
|
|
105
105
|
"apple ipad pro (11-inch) (2rd generation)"
|
|
106
106
|
],
|
|
107
107
|
[
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
2360,
|
|
177
177
|
1640,
|
|
178
178
|
60,
|
|
179
|
-
"apple ipad 11th gen (wifi)"
|
|
179
|
+
"apple ipad 11th gen (wifi+cellular)"
|
|
180
180
|
]
|
|
181
181
|
]
|
|
182
182
|
],
|
|
@@ -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
|
],
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
[
|
|
280
280
|
2360,
|
|
281
281
|
1640,
|
|
282
|
-
|
|
282
|
+
120,
|
|
283
283
|
"apple ipad air (5th generation)"
|
|
284
284
|
],
|
|
285
285
|
[
|
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
2360,
|
|
339
339
|
1640,
|
|
340
340
|
60,
|
|
341
|
-
"apple ipad air 11-inch 7th gen (wifi
|
|
341
|
+
"apple ipad air 11-inch 7th gen (wifi)"
|
|
342
342
|
],
|
|
343
343
|
[
|
|
344
344
|
2732,
|
|
@@ -357,8 +357,8 @@
|
|
|
357
357
|
[
|
|
358
358
|
2420,
|
|
359
359
|
1668,
|
|
360
|
-
|
|
361
|
-
"apple ipad pro 11
|
|
360
|
+
75,
|
|
361
|
+
"apple ipad pro 11 inch 5th gen"
|
|
362
362
|
],
|
|
363
363
|
[
|
|
364
364
|
2752,
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
[
|
|
100
100
|
1792,
|
|
101
101
|
828,
|
|
102
|
-
|
|
102
|
+
66,
|
|
103
103
|
"apple iphone 11"
|
|
104
104
|
],
|
|
105
105
|
[
|
|
@@ -128,12 +128,6 @@
|
|
|
128
128
|
61,
|
|
129
129
|
"apple iphone 12 mini"
|
|
130
130
|
],
|
|
131
|
-
[
|
|
132
|
-
2436,
|
|
133
|
-
1125,
|
|
134
|
-
61,
|
|
135
|
-
"apple iphone 12"
|
|
136
|
-
],
|
|
137
131
|
[
|
|
138
132
|
2532,
|
|
139
133
|
1170,
|
|
@@ -169,8 +163,8 @@
|
|
|
169
163
|
[
|
|
170
164
|
2532,
|
|
171
165
|
1170,
|
|
172
|
-
|
|
173
|
-
"apple iphone 13"
|
|
166
|
+
60,
|
|
167
|
+
"apple iphone 13 pro"
|
|
174
168
|
],
|
|
175
169
|
[
|
|
176
170
|
2778,
|
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.86/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.86","/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