@grepp/detect-gpu 5.0.82 → 5.0.84

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/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # Forked from [pmndrs/detect-gpu](https://github.com/pmndrs/detect-gpu)
2
2
 
3
+ Fixed the automatic update issue on detect-gpu
4
+
3
5
  # Detect GPU
4
6
 
5
- [![npm version](https://badge.fury.io/js/detect-gpu.svg)](https://badge.fury.io/js/detect-gpu)
6
- [![gzip size](https://img.badgesize.io/https:/unpkg.com/detect-gpu/dist/detect-gpu.esm.js?compression=gzip)](https://unpkg.com/detect-gpu)
7
- [![install size](https://packagephobia.now.sh/badge?p=detect-gpu)](https://packagephobia.now.sh/result?p=detect-gpu)
7
+ [![npm version](https://badge.fury.io/js/@grepp%2Fdetect-gpu.svg)](https://badge.fury.io/js/@grepp%2Fdetect-gpu)
8
8
 
9
9
  Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications. Think of it like a user-agent detection for the GPU but more powerful.
10
10
 
11
11
  ## Demo
12
12
 
13
- [Live demo](https://pmndrs.github.io/detect-gpu/)
13
+ [Live demo](https://gistpreview.github.io/?d86f1681c364f614bd47a4079fb99ac8/detect-gpu-demo.html)
14
14
 
15
15
  ## Installation
16
16
 
@@ -19,13 +19,13 @@ By default we use the [UNPKG](https://unpkg.com) CDN to host the benchmark data.
19
19
  Make sure you have [Node.js](http://nodejs.org/) installed.
20
20
 
21
21
  ```sh
22
- $ npm install detect-gpu
22
+ $ npm install @grepp/detect-gpu
23
23
  ```
24
24
 
25
25
  ## Usage
26
26
 
27
27
  ```ts
28
- import { getGPUTier } from 'detect-gpu';
28
+ import { getGPUTier } from '@grepp/detect-gpu';
29
29
 
30
30
  (async () => {
31
31
  const gpuTier = await getGPUTier();
@@ -2855,6 +2855,19 @@
2855
2855
  ]
2856
2856
  ]
2857
2857
  ],
2858
+ [
2859
+ "amd radeon 740m",
2860
+ "740",
2861
+ "740m amd radeon",
2862
+ 0,
2863
+ [
2864
+ [
2865
+ 3840,
2866
+ 2160,
2867
+ 34
2868
+ ]
2869
+ ]
2870
+ ],
2858
2871
  [
2859
2872
  "amd radeon 7500m/7600m",
2860
2873
  "7500",
@@ -2935,6 +2948,24 @@
2935
2948
  ]
2936
2949
  ]
2937
2950
  ],
2951
+ [
2952
+ "amd radeon 8060s",
2953
+ "8060",
2954
+ "8060s amd radeon",
2955
+ 0,
2956
+ [
2957
+ [
2958
+ 1920,
2959
+ 1080,
2960
+ 60
2961
+ ],
2962
+ [
2963
+ 3840,
2964
+ 2160,
2965
+ 60
2966
+ ]
2967
+ ]
2968
+ ],
2938
2969
  [
2939
2970
  "amd radeon 860m",
2940
2971
  "860",
@@ -2945,6 +2976,11 @@
2945
2976
  1920,
2946
2977
  1200,
2947
2978
  253
2979
+ ],
2980
+ [
2981
+ 2880,
2982
+ 1920,
2983
+ 111
2948
2984
  ]
2949
2985
  ]
2950
2986
  ],
@@ -7225,9 +7261,9 @@
7225
7261
  60
7226
7262
  ],
7227
7263
  [
7228
- 3360,
7229
- 2100,
7230
- 55
7264
+ 2560,
7265
+ 1440,
7266
+ 51
7231
7267
  ],
7232
7268
  [
7233
7269
  5120,
@@ -7371,7 +7407,7 @@
7371
7407
  [
7372
7408
  3360,
7373
7409
  2100,
7374
- 42
7410
+ 38
7375
7411
  ]
7376
7412
  ]
7377
7413
  ],
@@ -7490,7 +7526,7 @@
7490
7526
  [
7491
7527
  3584,
7492
7528
  2240,
7493
- 60
7529
+ 139
7494
7530
  ]
7495
7531
  ]
7496
7532
  ],
@@ -8042,6 +8078,11 @@
8042
8078
  2160,
8043
8079
  60
8044
8080
  ],
8081
+ [
8082
+ 4096,
8083
+ 2304,
8084
+ 60
8085
+ ],
8045
8086
  [
8046
8087
  5120,
8047
8088
  2880,
@@ -9037,6 +9078,11 @@
9037
9078
  768,
9038
9079
  14
9039
9080
  ],
9081
+ [
9082
+ 1280,
9083
+ 1024,
9084
+ 24
9085
+ ],
9040
9086
  [
9041
9087
  1920,
9042
9088
  1080,
@@ -10764,6 +10810,19 @@
10764
10810
  ]
10765
10811
  ]
10766
10812
  ],
10813
+ [
10814
+ "amd radeon rx",
10815
+ "rx",
10816
+ "amd radeon rx",
10817
+ 0,
10818
+ [
10819
+ [
10820
+ 1920,
10821
+ 1080,
10822
+ 116
10823
+ ]
10824
+ ]
10825
+ ],
10767
10826
  [
10768
10827
  "amd radeon rx 460",
10769
10828
  "460",
@@ -11280,11 +11339,6 @@
11280
11339
  1080,
11281
11340
  350
11282
11341
  ],
11283
- [
11284
- 2560,
11285
- 1440,
11286
- 75
11287
- ],
11288
11342
  [
11289
11343
  3840,
11290
11344
  2160,
@@ -11530,7 +11584,7 @@
11530
11584
  [
11531
11585
  1920,
11532
11586
  1080,
11533
- 170
11587
+ 165
11534
11588
  ]
11535
11589
  ]
11536
11590
  ],
@@ -11747,6 +11801,11 @@
11747
11801
  "6800 amd radeon rx",
11748
11802
  0,
11749
11803
  [
11804
+ [
11805
+ 1920,
11806
+ 1080,
11807
+ 180
11808
+ ],
11750
11809
  [
11751
11810
  2560,
11752
11811
  1440,
@@ -12029,9 +12088,9 @@
12029
12088
  0,
12030
12089
  [
12031
12090
  [
12032
- 2560,
12033
- 1440,
12034
- 1336
12091
+ 1920,
12092
+ 1080,
12093
+ 1545
12035
12094
  ],
12036
12095
  [
12037
12096
  3840,
@@ -12119,7 +12178,7 @@
12119
12178
  [
12120
12179
  1920,
12121
12180
  1080,
12122
- 1967
12181
+ 2286
12123
12182
  ],
12124
12183
  [
12125
12184
  3440,
@@ -2737,7 +2737,7 @@
2737
2737
  [
2738
2738
  1920,
2739
2739
  1080,
2740
- 119
2740
+ 134
2741
2741
  ]
2742
2742
  ]
2743
2743
  ],
@@ -5496,7 +5496,7 @@
5496
5496
  [
5497
5497
  1920,
5498
5498
  1080,
5499
- 632
5499
+ 804
5500
5500
  ],
5501
5501
  [
5502
5502
  2560,
@@ -5658,6 +5658,11 @@
5658
5658
  1920,
5659
5659
  1080,
5660
5660
  693
5661
+ ],
5662
+ [
5663
+ 2560,
5664
+ 1440,
5665
+ 180
5661
5666
  ]
5662
5667
  ]
5663
5668
  ],
@@ -5981,12 +5986,7 @@
5981
5986
  [
5982
5987
  1920,
5983
5988
  1080,
5984
- 164
5985
- ],
5986
- [
5987
- 2560,
5988
- 1440,
5989
- 568
5989
+ 60
5990
5990
  ]
5991
5991
  ]
5992
5992
  ],
@@ -6106,17 +6106,25 @@
6106
6106
  ]
6107
6107
  ]
6108
6108
  ],
6109
+ [
6110
+ "nvidia geforce rtx 5050",
6111
+ "5050",
6112
+ "5050 geforce nvidia rtx",
6113
+ 0,
6114
+ [
6115
+ [
6116
+ 1920,
6117
+ 1080,
6118
+ 60
6119
+ ]
6120
+ ]
6121
+ ],
6109
6122
  [
6110
6123
  "nvidia geforce rtx 5060",
6111
6124
  "5060",
6112
6125
  "5060 geforce nvidia rtx",
6113
6126
  0,
6114
6127
  [
6115
- [
6116
- 1360,
6117
- 768,
6118
- 60
6119
- ],
6120
6128
  [
6121
6129
  2560,
6122
6130
  1440,
@@ -6151,7 +6159,7 @@
6151
6159
  [
6152
6160
  2560,
6153
6161
  1440,
6154
- 60
6162
+ 120
6155
6163
  ]
6156
6164
  ]
6157
6165
  ],
@@ -6271,6 +6279,19 @@
6271
6279
  ]
6272
6280
  ]
6273
6281
  ],
6282
+ [
6283
+ "nvidia geforce rtx 5090 laptop gpu",
6284
+ "5090",
6285
+ "5090 geforce gpu laptop nvidia rtx",
6286
+ 0,
6287
+ [
6288
+ [
6289
+ 2560,
6290
+ 1600,
6291
+ 144
6292
+ ]
6293
+ ]
6294
+ ],
6274
6295
  [
6275
6296
  "nvidia geforce rtx t10-16",
6276
6297
  "10",
@@ -136,9 +136,9 @@
136
136
  0,
137
137
  [
138
138
  [
139
- 1920,
140
- 1080,
141
- 148
139
+ 3840,
140
+ 2160,
141
+ 90
142
142
  ]
143
143
  ]
144
144
  ],
@@ -399,7 +399,7 @@
399
399
  [
400
400
  3840,
401
401
  2160,
402
- 134
402
+ 137
403
403
  ]
404
404
  ]
405
405
  ],
@@ -447,6 +447,19 @@
447
447
  ]
448
448
  ]
449
449
  ],
450
+ [
451
+ "intel arc pro b60",
452
+ "60",
453
+ "arc b60 intel pro",
454
+ 0,
455
+ [
456
+ [
457
+ 2560,
458
+ 1440,
459
+ 158
460
+ ]
461
+ ]
462
+ ],
450
463
  [
451
464
  "intel broxton-p hd",
452
465
  "p",
@@ -1186,7 +1199,7 @@
1186
1199
  [
1187
1200
  1920,
1188
1201
  1080,
1189
- 14
1202
+ 17
1190
1203
  ]
1191
1204
  ]
1192
1205
  ],
@@ -1397,12 +1410,12 @@
1397
1410
  [
1398
1411
  1280,
1399
1412
  800,
1400
- 32
1413
+ 41
1401
1414
  ],
1402
1415
  [
1403
1416
  1366,
1404
1417
  768,
1405
- 33
1418
+ 25
1406
1419
  ],
1407
1420
  [
1408
1421
  1440,
@@ -3204,11 +3217,6 @@
3204
3217
  1080,
3205
3218
  58
3206
3219
  ],
3207
- [
3208
- 1920,
3209
- 1200,
3210
- 60
3211
- ],
3212
3220
  [
3213
3221
  2560,
3214
3222
  1600,
@@ -3449,7 +3457,7 @@
3449
3457
  [
3450
3458
  3584,
3451
3459
  2240,
3452
- 137
3460
+ 60
3453
3461
  ],
3454
3462
  [
3455
3463
  3840,
@@ -3565,7 +3573,7 @@
3565
3573
  [
3566
3574
  3840,
3567
3575
  2160,
3568
- 18
3576
+ 21
3569
3577
  ]
3570
3578
  ]
3571
3579
  ],
@@ -2976,7 +2976,7 @@
2976
2976
  [
2977
2977
  1920,
2978
2978
  1080,
2979
- 119
2979
+ 134
2980
2980
  ]
2981
2981
  ]
2982
2982
  ],
@@ -5735,7 +5735,7 @@
5735
5735
  [
5736
5736
  1920,
5737
5737
  1080,
5738
- 632
5738
+ 804
5739
5739
  ],
5740
5740
  [
5741
5741
  2560,
@@ -5897,6 +5897,11 @@
5897
5897
  1920,
5898
5898
  1080,
5899
5899
  693
5900
+ ],
5901
+ [
5902
+ 2560,
5903
+ 1440,
5904
+ 180
5900
5905
  ]
5901
5906
  ]
5902
5907
  ],
@@ -6220,12 +6225,7 @@
6220
6225
  [
6221
6226
  1920,
6222
6227
  1080,
6223
- 164
6224
- ],
6225
- [
6226
- 2560,
6227
- 1440,
6228
- 568
6228
+ 60
6229
6229
  ]
6230
6230
  ]
6231
6231
  ],
@@ -6345,17 +6345,25 @@
6345
6345
  ]
6346
6346
  ]
6347
6347
  ],
6348
+ [
6349
+ "nvidia geforce rtx 5050",
6350
+ "5050",
6351
+ "5050 geforce nvidia rtx",
6352
+ 0,
6353
+ [
6354
+ [
6355
+ 1920,
6356
+ 1080,
6357
+ 60
6358
+ ]
6359
+ ]
6360
+ ],
6348
6361
  [
6349
6362
  "nvidia geforce rtx 5060",
6350
6363
  "5060",
6351
6364
  "5060 geforce nvidia rtx",
6352
6365
  0,
6353
6366
  [
6354
- [
6355
- 1360,
6356
- 768,
6357
- 60
6358
- ],
6359
6367
  [
6360
6368
  2560,
6361
6369
  1440,
@@ -6390,7 +6398,7 @@
6390
6398
  [
6391
6399
  2560,
6392
6400
  1440,
6393
- 60
6401
+ 120
6394
6402
  ]
6395
6403
  ]
6396
6404
  ],
@@ -6510,6 +6518,19 @@
6510
6518
  ]
6511
6519
  ]
6512
6520
  ],
6521
+ [
6522
+ "nvidia geforce rtx 5090 laptop gpu",
6523
+ "5090",
6524
+ "5090 geforce gpu laptop nvidia rtx",
6525
+ 0,
6526
+ [
6527
+ [
6528
+ 2560,
6529
+ 1600,
6530
+ 144
6531
+ ]
6532
+ ]
6533
+ ],
6513
6534
  [
6514
6535
  "nvidia geforce rtx t10-16",
6515
6536
  "10",
@@ -9112,7 +9133,12 @@
9112
9133
  [
9113
9134
  1920,
9114
9135
  1080,
9115
- 66
9136
+ 58
9137
+ ],
9138
+ [
9139
+ 2560,
9140
+ 1440,
9141
+ 43
9116
9142
  ]
9117
9143
  ]
9118
9144
  ],
@@ -9505,15 +9531,15 @@
9505
9531
  768,
9506
9532
  57
9507
9533
  ],
9534
+ [
9535
+ 1920,
9536
+ 1080,
9537
+ 36
9538
+ ],
9508
9539
  [
9509
9540
  2560,
9510
9541
  1440,
9511
9542
  19
9512
- ],
9513
- [
9514
- 3840,
9515
- 2160,
9516
- 10
9517
9543
  ]
9518
9544
  ]
9519
9545
  ],
@@ -10787,8 +10813,8 @@
10787
10813
  0,
10788
10814
  [
10789
10815
  [
10790
- 3840,
10791
- 2160,
10816
+ 1920,
10817
+ 1200,
10792
10818
  60
10793
10819
  ]
10794
10820
  ]
@@ -893,6 +893,19 @@
893
893
  ]
894
894
  ]
895
895
  ],
896
+ [
897
+ "amd radeon 740m",
898
+ "740",
899
+ "740m amd radeon",
900
+ 0,
901
+ [
902
+ [
903
+ 3840,
904
+ 2160,
905
+ 34
906
+ ]
907
+ ]
908
+ ],
896
909
  [
897
910
  "amd radeon 7500m/7600m",
898
911
  "7500",
@@ -973,6 +986,24 @@
973
986
  ]
974
987
  ]
975
988
  ],
989
+ [
990
+ "amd radeon 8060s",
991
+ "8060",
992
+ "8060s amd radeon",
993
+ 0,
994
+ [
995
+ [
996
+ 1920,
997
+ 1080,
998
+ 60
999
+ ],
1000
+ [
1001
+ 3840,
1002
+ 2160,
1003
+ 60
1004
+ ]
1005
+ ]
1006
+ ],
976
1007
  [
977
1008
  "amd radeon 860m",
978
1009
  "860",
@@ -983,6 +1014,11 @@
983
1014
  1920,
984
1015
  1200,
985
1016
  253
1017
+ ],
1018
+ [
1019
+ 2880,
1020
+ 1920,
1021
+ 111
986
1022
  ]
987
1023
  ]
988
1024
  ],
@@ -5263,9 +5299,9 @@
5263
5299
  60
5264
5300
  ],
5265
5301
  [
5266
- 3360,
5267
- 2100,
5268
- 55
5302
+ 2560,
5303
+ 1440,
5304
+ 51
5269
5305
  ],
5270
5306
  [
5271
5307
  5120,
@@ -5409,7 +5445,7 @@
5409
5445
  [
5410
5446
  3360,
5411
5447
  2100,
5412
- 42
5448
+ 38
5413
5449
  ]
5414
5450
  ]
5415
5451
  ],
@@ -5528,7 +5564,7 @@
5528
5564
  [
5529
5565
  3584,
5530
5566
  2240,
5531
- 60
5567
+ 139
5532
5568
  ]
5533
5569
  ]
5534
5570
  ],
@@ -6080,6 +6116,11 @@
6080
6116
  2160,
6081
6117
  60
6082
6118
  ],
6119
+ [
6120
+ 4096,
6121
+ 2304,
6122
+ 60
6123
+ ],
6083
6124
  [
6084
6125
  5120,
6085
6126
  2880,
@@ -7075,6 +7116,11 @@
7075
7116
  768,
7076
7117
  14
7077
7118
  ],
7119
+ [
7120
+ 1280,
7121
+ 1024,
7122
+ 24
7123
+ ],
7078
7124
  [
7079
7125
  1920,
7080
7126
  1080,
@@ -8802,6 +8848,19 @@
8802
8848
  ]
8803
8849
  ]
8804
8850
  ],
8851
+ [
8852
+ "amd radeon rx",
8853
+ "rx",
8854
+ "amd radeon rx",
8855
+ 0,
8856
+ [
8857
+ [
8858
+ 1920,
8859
+ 1080,
8860
+ 116
8861
+ ]
8862
+ ]
8863
+ ],
8805
8864
  [
8806
8865
  "amd radeon rx 460",
8807
8866
  "460",
@@ -9318,11 +9377,6 @@
9318
9377
  1080,
9319
9378
  350
9320
9379
  ],
9321
- [
9322
- 2560,
9323
- 1440,
9324
- 75
9325
- ],
9326
9380
  [
9327
9381
  3840,
9328
9382
  2160,
@@ -9568,7 +9622,7 @@
9568
9622
  [
9569
9623
  1920,
9570
9624
  1080,
9571
- 170
9625
+ 165
9572
9626
  ]
9573
9627
  ]
9574
9628
  ],
@@ -9785,6 +9839,11 @@
9785
9839
  "6800 amd radeon rx",
9786
9840
  0,
9787
9841
  [
9842
+ [
9843
+ 1920,
9844
+ 1080,
9845
+ 180
9846
+ ],
9788
9847
  [
9789
9848
  2560,
9790
9849
  1440,
@@ -10067,9 +10126,9 @@
10067
10126
  0,
10068
10127
  [
10069
10128
  [
10070
- 2560,
10071
- 1440,
10072
- 1336
10129
+ 1920,
10130
+ 1080,
10131
+ 1545
10073
10132
  ],
10074
10133
  [
10075
10134
  3840,
@@ -10157,7 +10216,7 @@
10157
10216
  [
10158
10217
  1920,
10159
10218
  1080,
10160
- 1967
10219
+ 2286
10161
10220
  ],
10162
10221
  [
10163
10222
  3440,
@@ -2249,8 +2249,8 @@
2249
2249
  [
2250
2250
  2178,
2251
2251
  1080,
2252
- 108,
2253
- "samsung galaxy s20 5g (sm-g981n)"
2252
+ 60,
2253
+ "samsung galaxy s20 5g"
2254
2254
  ],
2255
2255
  [
2256
2256
  2196,
@@ -2279,7 +2279,7 @@
2279
2279
  [
2280
2280
  2320,
2281
2281
  1080,
2282
- 89,
2282
+ 110,
2283
2283
  "xiaomi redmi k40"
2284
2284
  ],
2285
2285
  [
@@ -2492,6 +2492,12 @@
2492
2492
  "830 adreno qualcomm",
2493
2493
  0,
2494
2494
  [
2495
+ [
2496
+ 2122,
2497
+ 1080,
2498
+ 120,
2499
+ "samsung galaxy s25+"
2500
+ ],
2495
2501
  [
2496
2502
  2256,
2497
2503
  1032,
@@ -2505,15 +2511,9 @@
2505
2511
  "samsung galaxy s25 ultra"
2506
2512
  ],
2507
2513
  [
2508
- 2340,
2509
- 1080,
2510
- 120,
2511
- "samsung galaxy s25+"
2512
- ],
2513
- [
2514
- 3054,
2515
- 1380,
2516
- 99,
2514
+ 3200,
2515
+ 1440,
2516
+ 60,
2517
2517
  "xiaomi 15 pro"
2518
2518
  ]
2519
2519
  ]
@@ -190,7 +190,7 @@
190
190
  2266,
191
191
  1488,
192
192
  60,
193
- "apple ipad mini (a17)"
193
+ "apple ipad mini 7th gen cellular (a17)"
194
194
  ]
195
195
  ]
196
196
  ],
@@ -279,7 +279,7 @@
279
279
  [
280
280
  2360,
281
281
  1640,
282
- 120,
282
+ 60,
283
283
  "apple ipad air (5th generation)"
284
284
  ],
285
285
  [
@@ -311,8 +311,8 @@
311
311
  [
312
312
  2388,
313
313
  1668,
314
- 60,
315
- "apple ipad air 6th gen (m2)"
314
+ 120,
315
+ "apple ipad pro 11 inch (4th gen)"
316
316
  ],
317
317
  [
318
318
  2732,
@@ -61,13 +61,13 @@
61
61
  [
62
62
  1792,
63
63
  828,
64
- 60,
64
+ 65,
65
65
  "apple iphone xr"
66
66
  ],
67
67
  [
68
68
  2436,
69
69
  1125,
70
- 58,
70
+ 61,
71
71
  "apple iphone xs"
72
72
  ],
73
73
  [
@@ -75,6 +75,12 @@
75
75
  1242,
76
76
  60,
77
77
  "apple iphone xs max"
78
+ ],
79
+ [
80
+ 2688,
81
+ 1242,
82
+ 60,
83
+ "apple iphone xs max"
78
84
  ]
79
85
  ]
80
86
  ],
@@ -99,7 +105,7 @@
99
105
  [
100
106
  2436,
101
107
  1125,
102
- 60,
108
+ 61,
103
109
  "apple iphone 11 pro"
104
110
  ],
105
111
  [
@@ -151,7 +157,7 @@
151
157
  [
152
158
  1334,
153
159
  750,
154
- 60,
160
+ 118,
155
161
  "apple iphone se (2022)"
156
162
  ],
157
163
  [
@@ -163,8 +169,8 @@
163
169
  [
164
170
  2532,
165
171
  1170,
166
- 60,
167
- "apple iphone 13 pro"
172
+ 33,
173
+ "apple iphone 13"
168
174
  ],
169
175
  [
170
176
  2778,
@@ -223,7 +229,7 @@
223
229
  [
224
230
  2532,
225
231
  1170,
226
- 41,
232
+ 60,
227
233
  "apple iphone 16 (iphone17,5)"
228
234
  ],
229
235
  [
@@ -237,7 +237,7 @@
237
237
  "samsung galaxy m33"
238
238
  ],
239
239
  [
240
- 2344,
240
+ 2408,
241
241
  1080,
242
242
  34,
243
243
  "samsung galaxy a14 5g"
@@ -681,9 +681,9 @@
681
681
  0,
682
682
  [
683
683
  [
684
- 2376,
685
- 1080,
686
- 60,
684
+ 2486,
685
+ 1264,
686
+ 90,
687
687
  "oppo find x8 pro"
688
688
  ],
689
689
  [
@@ -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.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};
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.84/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
@@ -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.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)]}})})}});
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.84","/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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grepp/detect-gpu",
3
- "version": "5.0.82",
3
+ "version": "5.0.84",
4
4
  "description": "Classify GPU's based on their benchmark score in order to provide an adaptive experience.",
5
5
  "author": "Tim van Scherpenzeel",
6
6
  "license": "MIT",