detect-gpu
Advanced tools
Comparing version 0.0.18 to 0.0.19
{ | ||
"extends": "airbnb-base", | ||
"rules": { | ||
"no-tabs": 0, | ||
"indent": 0, | ||
"import/prefer-default-export": 0 | ||
}, | ||
"globals": { | ||
"window": true, | ||
"document": true, | ||
"navigator": true | ||
} | ||
"extends": "airbnb-base", | ||
"rules": { | ||
"no-tabs": 0, | ||
"indent": 0, | ||
"import/prefer-default-export": 0 | ||
}, | ||
"globals": { | ||
"window": true, | ||
"document": true, | ||
"navigator": true, | ||
"test": true, | ||
"expect": true | ||
} | ||
} |
@@ -1,1 +0,1 @@ | ||
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("DetectGPU",[],o):"object"==typeof exports?exports.DetectGPU=o():e.DetectGPU=o()}(window,function(){return function(e){var o={};function r(n){if(o[n])return o[n].exports;var a=o[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=o,r.d=function(e,o,n){r.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,o){if(1&o&&(e=r(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var a in e)r.d(n,a,function(o){return e[o]}.bind(null,a));return n},r.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(o,"a",o),o},r.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r.p="",r(r.s=0)}([function(e,o,r){"use strict";r.r(o);var n=["1 - NVIDIA GeForce GTX 1080 Ti (Desktop)","2 - NVIDIA Titan X Pascal","3 - NVIDIA GeForce GTX 1080 SLI (Laptop)","4 - NVIDIA GeForce GTX 1070 SLI (Desktop)","5 - NVIDIA GeForce GTX 1070 SLI (Laptop)","6 - NVIDIA GeForce GTX 1080 (Desktop)","7 - AMD Radeon RX Vega 64","8 - NVIDIA GeForce GTX 1080 (Laptop)","9 - NVIDIA GeForce GTX 1070 Ti (Desktop)","10 - NVIDIA GeForce GTX 980 SLI (Laptop)","11 - NVIDIA Quadro P5200","12 - AMD Radeon Pro Vega 56","13 - NVIDIA GeForce GTX 1070 (Desktop)","14 - NVIDIA GeForce GTX 1080 Max-Q","15 - NVIDIA GeForce GTX 1070 (Laptop)","16 - NVIDIA Quadro P4200","17 - NVIDIA Quadro P5000","18 - NVIDIA GeForce GTX 980 Ti","19 - NVIDIA GeForce GTX 1070 Max-Q","20 - NVIDIA Quadro P5000 Max-Q","21 - NVIDIA GeForce GTX 980M SLI","22 - AMD Radeon R9 Fury","23 - AMD Radeon R9 Nano","24 - NVIDIA GeForce GTX 980","25 - AMD Radeon RX 580 (Desktop)","26 - NVIDIA GeForce GTX 980 (Laptop)","27 - NVIDIA Quadro M5500","28 - AMD Radeon R9 390X","29 - NVIDIA GeForce GTX 970M SLI","30 - NVIDIA GeForce GTX 1060 (Desktop)","31 - NVIDIA Quadro P4000","32 - AMD Radeon RX 480 (Desktop)","33 - NVIDIA GeForce GTX 1060 (Laptop)","34 - NVIDIA Quadro P4000 Max-Q","35 - NVIDIA Quadro P3200","36 - AMD Radeon RX 580 (Laptop)","37 - NVIDIA GeForce GTX 780 Ti","38 - AMD Radeon RX Vega Mobile","39 - AMD Radeon RX Vega M GH","40 - NVIDIA Quadro P3000","41 - NVIDIA GeForce GTX 970","42 - NVIDIA GeForce GTX 1060 Max-Q","43 - NVIDIA Quadro P3000 Max-Q","45 - AMD Radeon Pro WX 7100","46 - AMD Radeon RX 470 (Desktop)","47 - AMD Radeon RX 570 (Laptop)","48 - AMD Radeon RX 470 (Laptop)","49 - NVIDIA GeForce GTX 880M SLI","51 - AMD Radeon R9 290X","53 - NVIDIA GeForce GTX 965M SLI","58 - NVIDIA GeForce GTX 980M","59 - NVIDIA Quadro M5000M","60 - AMD Radeon RX Vega M GL / 870","61 - AMD Radeon R9 280X","62 - AMD Radeon R9 380","63 - NVIDIA GeForce GTX 960","64 - NVIDIA GeForce GTX 1050 Ti (Notebook)","65 - NVIDIA GeForce GTX 1050 Ti Max-Q","66 - NVIDIA GeForce GTX 1050 Ti (Desktop)","67 - NVIDIA GeForce GTX 970M","68 - NVIDIA Quadro M4000M","73 - AMD Radeon R9 M395X","74 - AMD Radeon R9 M485X","75 - AMD Radeon R9 M295X","76 - AMD Radeon R9 M390X","77 - NVIDIA Quadro M3000M","78 - NVIDIA GeForce GTX 1050 (Desktop)","79 - NVIDIA GeForce GTX 1050 (Notebook)","80 - NVIDIA GeForce GTX 1050 Max-Q","81 - AMD FirePro W7170M","82 - AMD Radeon R9 M395","83 - AMD Radeon R7 370","85 - NVIDIA GeForce GTX 880M","86 - NVIDIA GeForce GTX 950","87 - AMD Radeon RX 560X (Laptop)","88 - AMD Radeon RX 560 (Laptop)","89 - AMD Radeon R9 270X","91 - NVIDIA GeForce GTX 760","92 - NVIDIA GeForce GTX 780M","93 - NVIDIA Quadro K5100M","95 - AMD Radeon RX 460 (Desktop)","96 - AMD Radeon Pro WX 4150","98 - NVIDIA GeForce GTX 965M","99 - NVIDIA Quadro M2200","100 - NVIDIA GeForce GTX 870M","101 - AMD Radeon R9 M290X","107 - AMD Radeon RX 460 (Laptop)","110 - AMD Radeon R9 M390","111 - AMD FirePro M6100","113 - AMD Radeon Pro 560","114 - AMD Radeon Pro 560X","115 - AMD Radeon Pro 460","116 - AMD Radeon Pro WX 4130","117 - NVIDIA GeForce GTX 960M","118 - NVIDIA GeForce GTX 750 Ti","119 - AMD Radeon RX 550 (Laptop)","123 - NVIDIA Quadro M1200","124 - AMD Radeon Pro 555","125 - AMD Radeon Pro 455","126 - NVIDIA GeForce GT 1030 (Desktop)","127 - NVIDIA GeForce MX150","128 - NVIDIA Quadro P600","129 - NVIDIA Quadro P500","130 - NVIDIA Quadro M2000M","131 - NVIDIA Quadro K5000M","132 - NVIDIA Quadro K4100M","133 - NVIDIA GeForce GTX 770M","134 - AMD Radeon RX 540","135 - AMD Radeon Pro WX 3100 Mobile","136 - NVIDIA GeForce GTX 860M","144 - NVIDIA GeForce GTX 950M","145 - AMD Radeon Pro 450","146 - AMD Radeon R9 M470X","147 - AMD Radeon R9 M385X","148 - NVIDIA GeForce GTX 850M","149 - NVIDIA Quadro P1000","150 - NVIDIA Quadro M1000M","151 - NVIDIA Quadro M620","152 - AMD Radeon R9 M280X","153 - AMD Radeon RX Vega 11","158 - NVIDIA GeForce 945M","159 - NVIDIA GeForce GTX 765M","163 - NVIDIA Quadro K4000M","164 - AMD Radeon RX Vega 10","165 - Intel Iris Pro Graphics P580","166 - Intel Iris Pro Graphics 580","171 - AMD Radeon R9 M470","173 - AMD Radeon R9 M380","182 - NVIDIA Quadro K3100M","183 - AMD FirePro W5170M","184 - AMD Radeon R9 M370X","187 - NVIDIA GeForce GTX 760M","188 - AMD Radeon R9 M275","190 - NVIDIA Maxwell GPU Surface Book (940M, GDDR5)","191 - AMD FirePro W5130M","197 - NVIDIA Quadro K3000M","199 - AMD FirePro M6000","200 - AMD FirePro M5100","201 - NVIDIA Quadro K2100M","206 - AMD Radeon R7 250","207 - NVIDIA GeForce GT 755M","209 - NVIDIA GeForce 845M","212 - AMD Radeon R9 M265X","214 - AMD Radeon R7 M465","216 - AMD FirePro W4170M","217 - AMD FirePro W4100","222 - NVIDIA GeForce GT 750M","223 - Intel Iris Pro Graphics 6200","224 - NVIDIA Quadro M520","225 - NVIDIA GeForce MX130","226 - NVIDIA GeForce 940MX","227 - NVIDIA Quadro K1100M","228 - AMD Radeon RX Vega 8","229 - NVIDIA GeForce 940M","230 - NVIDIA GeForce 930MX","231 - NVIDIA Quadro M600M","232 - AMD FirePro W4190M","233 - AMD Radeon R9 M375","234 - AMD Radeon R7 M445","236 - AMD Radeon R7 M370","239 - NVIDIA Quadro M500M","240 - NVIDIA GeForce 840M","241 - AMD Radeon R7 M275DX","242 - NVIDIA GeForce GT 745M","245 - AMD Radeon R7 (Bristol Ridge)","246 - AMD Radeon R7 512 Cores (Kaveri Desktop)","247 - Intel Iris Pro Graphics 5200","248 - AMD Radeon R7 384 Cores (Kaveri Desktop)","249 - NVIDIA GeForce GT 740M","250 - Intel Iris Plus Graphics 650","251 - Intel Iris Plus Graphics 655","252 - NVIDIA GeForce 930M","253 - Intel Iris Graphics 550","254 - AMD Radeon 530","255 - NVIDIA GeForce 830M","256 - NVIDIA GeForce MX110","257 - Intel Iris Plus Graphics 640","258 - NVIDIA GeForce 920MX","259 - Intel Iris Graphics 540","262 - NVIDIA Quadro K2000M","265 - NVIDIA GeForce GT 735M","267 - NVIDIA GeForce 825M","269 - AMD FirePro M4000","276 - AMD Radeon R7 M260X","279 - NVIDIA GeForce GT 730M","282 - AMD FirePro M4100","285 - AMD Radeon R7 M270","286 - AMD Radeon R7 M265","290 - NVIDIA GeForce GT 640M","291 - AMD Radeon R7 (Carrizo)","292 - AMD Radeon R7 (Kaveri)","293 - AMD Radeon R8 M365DX","294 - AMD Radeon R7 M460","297 - AMD Radeon R7 M360","299 - NVIDIA GeForce 920M","302 - AMD Radeon R8 M445DX","303 - AMD Radeon R7 M440","309 - AMD Radeon R7 M260","310 - AMD Radeon R7 M340","311 - AMD Radeon 520","312 - AMD Radeon R6 M340DX","313 - AMD Radeon RX Vega 6","314 - Intel UHD Graphics 630","315 - Intel HD Graphics 630","316 - Intel HD Graphics P630","317 - Intel HD Graphics 530","318 - Intel HD Graphics P530","320 - AMD Radeon R5 (Bristol Ridge)","321 - Intel UHD Graphics 620","322 - Intel HD Graphics 620","323 - AMD Radeon R6 (Carrizo)","335 - AMD Radeon R6 (Kaveri)","344 - AMD FirePro W2100","354 - Intel HD Graphics 5600","361 - AMD Radeon R6 M255DX","362 - AMD Radeon HD 7660D","364 - NVIDIA Quadro K1000M","380 - AMD Radeon HD 8650G","386 - AMD Radeon HD 7560D","388 - AMD Radeon R5 M335","389 - AMD Radeon R5 M330","390 - AMD Radeon R5 M430","391 - AMD Radeon R5 M255","393 - NVIDIA GeForce 910M","394 - NVIDIA GeForce 820M","395 - AMD Radeon RX Vega 3","396 - Intel HD Graphics 520","397 - Intel Iris Graphics 6100","398 - NVIDIA GeForce GT 720M","399 - AMD Radeon R5 (Stoney Ridge)","401 - AMD Radeon R5 M240","402 - AMD Radeon R5 M320","403 - AMD Radeon R5 M230","404 - AMD Radeon R5 M315","410 - Intel HD Graphics 6000","411 - NVIDIA Quadro K610M","413 - Intel Iris Graphics 5100","415 - AMD Radeon HD 8610G","418 - Intel HD Graphics 4600","420 - Intel HD Graphics 5500","427 - Intel UHD Graphics 615","428 - Intel HD Graphics 615","429 - AMD Radeon R5 (Carrizo)","430 - AMD Radeon R5 (Kaveri)","433 - NVIDIA GeForce 710M","434 - AMD Radeon HD 7660G","437 - Intel HD Graphics 5000","453 - AMD Radeon HD 8550G","462 - AMD Radeon HD 8470D","469 - Intel HD Graphics 515","470 - Intel HD Graphics 4400","471 - Intel HD Graphics 610","472 - Intel HD Graphics 510","501 - Intel HD Graphics 5300","502 - Intel UHD Graphics 605","503 - Intel HD Graphics 505","511 - AMD Radeon HD 7480D","512 - Intel HD Graphics 4000","516 - AMD Radeon R4 (Stoney Ridge)","517 - AMD Radeon R4 (Kaveri)","518 - Intel HD Graphics (Broadwell)","520 - AMD Radeon R5 (Beema/Carrizo-L)","521 - AMD Radeon R4 (Beema)","522 - AMD Radeon R3 (Mullins/Beema)","523 - AMD Radeon R2 (Stoney Ridge)","524 - Intel HD Graphics 4200","533 - AMD Radeon HD 8450G","537 - AMD Radeon HD 8400","550 - AMD Radeon HD 8350G","551 - AMD Radeon HD 8330","552 - Intel UHD Graphics 600","553 - Intel HD Graphics 500","573 - Intel HD Graphics 405 (Braswell)","574 - Intel HD Graphics (Braswell)","575 - Intel HD Graphics 400 (Braswell)","584 - Intel HD Graphics (Haswell)","604 - AMD Radeon R2 (Mullins/Beema/Carrizo-L)","605 - Intel HD Graphics (Cherry Trail)","607 - AMD Radeon HD 8280","615 - AMD Radeon HD 8240","616 - AMD Radeon R6 (Mullins)","617 - AMD Radeon HD 8250","641 - AMD Radeon HD 8210","645 - Intel HD Graphics (Ivy Bridge)","686 - Intel HD Graphics (Bay Trail)","690 - AMD Radeon HD 7340","692 - AMD Radeon HD 7310","694 - AMD Radeon HD 8180","704 - AMD Radeon HD 7290"],a=["260 - Apple A11 Bionic GPU","261 - Apple A10X Fusion GPU / PowerVR","296 - Apple A9X / PowerVR Series 7XT","319 - NVIDIA Tegra X1 Maxwell GPU","405 - Apple A10 Fusion GPU / PowerVR","421 - Qualcomm Adreno 630","422 - Qualcomm Adreno 540","423 - ARM Mali-G72 MP18","424 - ARM Mali-G71 MP20","425 - ARM Mali-G72 MP12","426 - ARM Mali-G71 MP8","464 - Qualcomm Adreno 530","465 - PowerVR GXA6850","466 - NVIDIA Tegra K1 Kepler GPU","467 - Apple A9 / PowerVR GT7600","468 - ARM Mali-T880 MP12","513 - ARM Mali-T760 MP8","514 - ARM Mali-G71 MP2","519 - Qualcomm Adreno 430","538 - ARM Mali-G72 MP3","539 - ARM Mali-T880 MP4","571 - ARM Mali-T760 MP6","572 - ARM Mali-T880 MP2","582 - PowerVR GX6450","583 - Qualcomm Adreno 420","603 - Qualcomm Adreno 418","605 - Intel HD Graphics (Cherry Trail)","680 - Qualcomm Adreno 512","681 - Qualcomm Adreno 510","682 - Qualcomm Adreno 330","683 - PowerVR G6430","684 - PowerVR GX6250","685 - PowerVR G6400","686 - Intel HD Graphics (Bay Trail)","687 - ARM Mali-T628 MP6","688 - ARM Mali-T760 MP4","726 - PowerVR SGX554MP4","727 - ARM Mali-T628 MP4","728 - Qualcomm Adreno 509","729 - Qualcomm Adreno 508","730 - Qualcomm Adreno 506","731 - Qualcomm Adreno 505","735 - ARM Mali-T860 MP2","736 - ARM Mali-T830 MP3","742 - ARM Mali-T604 MP4","747 - NVIDIA GeForce Tegra 4","748 - PowerVR G6200","749 - Qualcomm Adreno 405","750 - ARM Mali-T830 MP2","777 - PowerVR SGX543MP4","778 - ARM Mali-T624","779 - Qualcomm Adreno 320","780 - ARM Mali-T760 MP2","781 - PowerVR GE8100","782 - ARM Mali-T720 MP4","783 - ARM Mali-450 MP4","784 - ARM Mali-T830 MP1","792 - PowerVR SGX543MP3","802 - PowerVR SGX543MP2","805 - PowerVR SGX545","806 - PowerVR SGX544MP2","807 - ARM Mali-T720 MP2","808 - PowerVR SGX544","809 - Qualcomm Adreno 308","810 - Qualcomm Adreno 306","811 - Qualcomm Adreno 305","812 - Qualcomm Adreno 304","813 - ARM Mali-T720","814 - Vivante GC7000UL","815 - Qualcomm Adreno 302","823 - Qualcomm Adreno 225","824 - Vivante GC4000","825 - ARM Mali-400 MP4","826 - NVIDIA GeForce ULP (Tegra 3)","827 - Broadcom VideoCore-IV","828 - Qualcomm Adreno 220","829 - Vivante GC1000+ Dual-Core","830 - ARM Mali-400 MP2","831 - ARM Mali-400 MP","832 - NVIDIA GeForce ULP (Tegra 2)","834 - PowerVR SGX540","836 - Qualcomm Adreno 205","837 - Qualcomm Adreno 203","838 - Vivante GC800","839 - PowerVR SGX535","840 - PowerVR SGX531","841 - PowerVR SGX530","842 - Qualcomm Adreno 200","843 - ARM Mali-200"],t=function(){function e(e,o){for(var r=0;r<o.length;r++){var n=o[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(o,r,n){return r&&e(o.prototype,r),n&&e(o,n),o}}();var i=function(){function e(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e),this.setUserAgent(o)}return t(e,[{key:"match",value:function(e){return this.matchCache[e]||(this.matchCache[e]=this.userAgent.indexOf(e)>-1),this.matchCache[e]}},{key:"getUserAgent",value:function(){return"undefined"!=typeof document?window.navigator.userAgent:""}},{key:"setUserAgent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.userAgent=e||this.userAgent||this.getUserAgent(),this.userAgent&&(this.matchCache={},this.userAgent=this.userAgent.toLowerCase())}},{key:"iphone",get:function(){return!this.windows&&this.match("iphone")}},{key:"ipod",get:function(){return this.match("ipod")}},{key:"ipad",get:function(){return this.match("ipad")}},{key:"android",get:function(){return!this.windows&&this.match("android")}},{key:"androidPhone",get:function(){return this.android&&this.match("mobile")}},{key:"androidTablet",get:function(){return this.android&&!this.match("mobile")}},{key:"blackberry",get:function(){return this.match("blackberry")||this.match("bb10")||this.match("rim")}},{key:"blackberryPhone",get:function(){return this.blackberry&&!this.match("tablet")}},{key:"blackberryTablet",get:function(){return this.blackberry&&this.match("tablet")}},{key:"windows",get:function(){return this.match("windows")}},{key:"windowsPhone",get:function(){return this.windows&&this.match("phone")}},{key:"windowsTablet",get:function(){return this.windows&&this.match("touch")&&!this.windowsPhone}},{key:"firefoxOS",get:function(){return(this.match("(mobile;")||this.match("(tablet;"))&&this.match("; rv:")}},{key:"firefoxOSPhone",get:function(){return this.firefoxOS&&this.match("mobile")}},{key:"firefoxOSTablet",get:function(){return this.firefoxOS&&this.match("tablet")}},{key:"mobile",get:function(){return this.androidPhone||this.iphone||this.ipod||this.windowsPhone||this.blackberryPhone||this.firefoxOSPhone}},{key:"tablet",get:function(){return this.ipad||this.androidTablet||this.blackberryTablet||this.windowsTablet||this.firefoxOSTablet}}]),e}();function M(e,o){var r=0,n=e.reverse();return o.map(function(e){var o=Math.round(n.length/100*e),a=n.slice(r,r+o);return r+=o,a})}r.d(o,"register",function(){return I});var D=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c=new i,d=function(e){var o=document.createElement("canvas"),r=o.getContext("webgl",e)||o.getContext("experimental-webgl",e);return!!(r&&r instanceof window.WebGLRenderingContext)&&r}({failIfMajorPerformanceCaveat:!0}),A=d.getExtension("WEBGL_debug_renderer_info");function I(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.verbose=!1,this.benchmarkTierPercentagesMobile=[15,35,30,20],this.benchmarkTierPercentagesDesktop=[15,35,30,20],D(this,e),function(e,o,r){if(!d||!A)return c.mobile||c.tablet?"GPU_MOBILE_TIER_0":"GPU_DESKTOP_TIER_0";var t=A&&d.getParameter(A.UNMASKED_RENDERER_WEBGL).toLowerCase();if(!t)return c.mobile||c.tablet?"GPU_MOBILE_TIER_1":"GPU_DESKTOP_TIER_1";var i=t.replace(/[\D]/g,"");e&&console.log("Found version number: "+i);var D=M(a,o),I=M(n,r);if(/(radeon hd 6970m|radeon hd 6770m|radeon hd 6490m|radeon hd 6630m|radeon hd 6750m|radeon hd 5750|radeon hd 5670|radeon hd 4850|radeon hd 4870|radeon hd 4670|geforce 9400m|geforce 320m|geforce 330m|geforce gt 130|geforce gt 120|geforce gtx 285|geforce 8600|geforce 9600m|geforce 9400m|geforce 8800 gs|geforce 8800 gt|quadro fx 5|quadro fx 4|radeon hd 2600|radeon hd 2400|radeon hd 2600|radeon r9 200|mali-4|mali-3|mali-2)/.test(t))return c.mobile||c.tablet?"GPU_MOBILE_TIER_0":"GPU_DESKTOP_TIER_0";if(c.mobile||c.tablet){var l=t.includes("adreno"),R=t.includes("apple"),s=t.includes("mali")&&!t.includes("mali-t"),G=t.includes("mali-t"),u=t.includes("nvidia"),h=t.includes("powervr"),p=void 0;return D.some(function(o,r){return o.some(function(o){var n=o.toLowerCase().split("- ")[1].split(" /")[0],a=n.replace(/[\D]/g,"");(n.includes("adreno")&&l||n.includes("apple")&&R||n.includes("mali")&&!n.includes("mali-t")&&s||n.includes("mali-t")&&G||n.includes("nvidia")&&u||n.includes("powervr")&&h)&&a.includes(i)&&(e&&console.log("Match with benchmark entry: "+n),p="GPU_MOBILE_TIER_"+r)})}),void 0===p&&(e&&console.log("Matching GPU tier could not be found, using fallback: GPU_MOBILE_TIER_1"),p="GPU_MOBILE_TIER_1"),p}var V=t.includes("intel"),P=t.includes("amd"),m=t.includes("nvidia"),f=void 0;return I.forEach(function(o,r){return o.forEach(function(o){var n=o.toLowerCase().split("- ")[1].split(" /")[0],a=n.replace(/[\D]/g,"");(n.includes("intel")&&V||n.includes("amd")&&P||n.includes("nvidia")&&m)&&a.includes(i)&&(e&&console.log("Match with benchmark entry: "+n),f="GPU_DESKTOP_TIER_"+r)})}),void 0===f&&(e&&console.log("Matching GPU tier could not be found, using fallback: GPU_DESKTOP_TIER_1"),f="GPU_DESKTOP_TIER_1"),f}(this.verbose,this.benchmarkTierPercentagesMobile,this.benchmarkTierPercentagesDesktop)}}])}); | ||
!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("DetectGPU",[],o):"object"==typeof exports?exports.DetectGPU=o():e.DetectGPU=o()}(window,function(){return function(e){var o={};function r(n){if(o[n])return o[n].exports;var a=o[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=o,r.d=function(e,o,n){r.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,o){if(1&o&&(e=r(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var a in e)r.d(n,a,function(o){return e[o]}.bind(null,a));return n},r.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(o,"a",o),o},r.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r.p="",r(r.s=0)}([function(e,o,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};o.getGPUTier=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.mobileBenchmarkPercentages=[15,35,30,20],this.desktopBenchmarkPercentages=[15,35,30,20],this.forceRendererString=!1,this.forceMobile=!1,n(this,e);var o=M.mobile||M.tablet||this.forceMobile,r=!o,t=void 0;if(!1===this.forceRendererString){var D=(0,i.getWebGLContext)({failIfMajorPerformanceCaveat:!0}),A=D.getExtension("WEBGL_debug_renderer_info");t=A&&D.getParameter(A.UNMASKED_RENDERER_WEBGL)}else t=this.forceRendererString;var I=(t=function(e){e.includes("angle (")&&e.includes("direct3d")&&(e=e.replace("angle (","").split(" direct3d")[0]);console.log(e),e.includes("nvidia")&&e.includes("gb")&&(e=e.split(/\dgb/)[0]);return e.toLowerCase()}(t)).replace(/[\D]/g,"");if(/(radeon hd 6970m|radeon hd 6770m|radeon hd 6490m|radeon hd 6630m|radeon hd 6750m|radeon hd 5750|radeon hd 5670|radeon hd 4850|radeon hd 4870|radeon hd 4670|geforce 9400m|geforce 320m|geforce 330m|geforce gt 130|geforce gt 120|geforce gtx 285|geforce 8600|geforce 9600m|geforce 9400m|geforce 8800 gs|geforce 8800 gt|quadro fx 5|quadro fx 4|radeon hd 2600|radeon hd 2400|radeon hd 2600|radeon r9 200|mali-4|mali-3|mali-2)/.test(t))return o?{tier:"GPU_MOBILE_TIER_0",type:"BLACKLISTED"}:{tier:"GPU_DESKTOP_TIER_0",type:"BLACKLISTED"};if(o){var R=(0,i.getBenchmarkByPercentage)(a.BENCHMARK_SCORE_MOBILE,this.mobileBenchmarkPercentages),l=t.includes("adreno"),s=t.includes("apple"),u=t.includes("mali")&&!t.includes("mali-t"),G=t.includes("mali-t"),h=t.includes("nvidia"),p=t.includes("powervr"),V=void 0,P=void 0;return R.forEach(function(e,o){return e.forEach(function(e){var r=c(e),n=d(r);(r.includes("adreno")&&l||r.includes("apple")&&s||r.includes("mali")&&!r.includes("mali-t")&&u||r.includes("mali-t")&&G||r.includes("nvidia")&&h||r.includes("powervr")&&p)&&n.includes(I)&&(V="GPU_MOBILE_TIER_"+o,P="BENCHMARK - "+r)})}),V||(V="GPU_MOBILE_TIER_1",P="FALLBACK"),{tier:V,type:P}}if(r){var f=(0,i.getBenchmarkByPercentage)(a.BENCHMARK_SCORE_DESKTOP,this.desktopBenchmarkPercentages),m=t.includes("intel"),N=t.includes("amd"),T=t.includes("nvidia"),X=void 0,g=void 0;return f.forEach(function(e,o){return e.forEach(function(e){var r=c(e),n=d(r);(r.includes("intel")&&m||r.includes("amd")&&N||r.includes("nvidia")&&T)&&n.includes(I)&&(X="GPU_DESKTOP_TIER_"+o,g="BENCHMARK - "+r)})}),X||(X="GPU_DESKTOP_TIER_1",g="FALLBACK"),{tier:X,type:g}}};var a=r(1),t=function(e){return e&&e.__esModule?e:{default:e}}(r(2)),i=r(3);var M=new t.default;function c(e){return e.toLowerCase().split("- ")[1].split(" /")[0]}function d(e){return e.replace(/[\D]/g,"")}},function(e,o,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0});o.BENCHMARK_SCORE_DESKTOP=["704 - AMD Radeon HD 7290","694 - AMD Radeon HD 8180","692 - AMD Radeon HD 7310","690 - AMD Radeon HD 7340","686 - Intel HD Graphics (Bay Trail)","645 - Intel HD Graphics (Ivy Bridge)","641 - AMD Radeon HD 8210","617 - AMD Radeon HD 8250","616 - AMD Radeon R6 (Mullins)","615 - AMD Radeon HD 8240","607 - AMD Radeon HD 8280","605 - Intel HD Graphics (Cherry Trail)","604 - AMD Radeon R2 (Mullins/Beema/Carrizo-L)","584 - Intel HD Graphics (Haswell)","575 - Intel HD Graphics 400 (Braswell)","574 - Intel HD Graphics (Braswell)","573 - Intel HD Graphics 405 (Braswell)","553 - Intel HD Graphics 500","552 - Intel UHD Graphics 600","551 - AMD Radeon HD 8330","550 - AMD Radeon HD 8350G","537 - AMD Radeon HD 8400","533 - AMD Radeon HD 8450G","524 - Intel HD Graphics 4200","523 - AMD Radeon R2 (Stoney Ridge)","522 - AMD Radeon R3 (Mullins/Beema)","521 - AMD Radeon R4 (Beema)","520 - AMD Radeon R5 (Beema/Carrizo-L)","518 - Intel HD Graphics (Broadwell)","517 - AMD Radeon R4 (Kaveri)","516 - AMD Radeon R4 (Stoney Ridge)","512 - Intel HD Graphics 4000","511 - AMD Radeon HD 7480D","503 - Intel HD Graphics 505","502 - Intel UHD Graphics 605","501 - Intel HD Graphics 5300","472 - Intel HD Graphics 510","471 - Intel HD Graphics 610","470 - Intel HD Graphics 4400","469 - Intel HD Graphics 515","462 - AMD Radeon HD 8470D","453 - AMD Radeon HD 8550G","437 - Intel HD Graphics 5000","434 - AMD Radeon HD 7660G","433 - NVIDIA GeForce 710M","430 - AMD Radeon R5 (Kaveri)","429 - AMD Radeon R5 (Carrizo)","428 - Intel HD Graphics 615","427 - Intel UHD Graphics 615","420 - Intel HD Graphics 5500","418 - Intel HD Graphics 4600","415 - AMD Radeon HD 8610G","413 - Intel Iris Graphics 5100","411 - NVIDIA Quadro K610M","410 - Intel HD Graphics 6000","404 - AMD Radeon R5 M315","403 - AMD Radeon R5 M230","402 - AMD Radeon R5 M320","401 - AMD Radeon R5 M240","399 - AMD Radeon R5 (Stoney Ridge)","398 - NVIDIA GeForce GT 720M","397 - Intel Iris Graphics 6100","396 - Intel HD Graphics 520","395 - AMD Radeon RX Vega 3","394 - NVIDIA GeForce 820M","393 - NVIDIA GeForce 910M","391 - AMD Radeon R5 M255","390 - AMD Radeon R5 M430","389 - AMD Radeon R5 M330","388 - AMD Radeon R5 M335","386 - AMD Radeon HD 7560D","380 - AMD Radeon HD 8650G","364 - NVIDIA Quadro K1000M","362 - AMD Radeon HD 7660D","361 - AMD Radeon R6 M255DX","354 - Intel HD Graphics 5600","344 - AMD FirePro W2100","335 - AMD Radeon R6 (Kaveri)","323 - AMD Radeon R6 (Carrizo)","322 - Intel HD Graphics 620","321 - Intel UHD Graphics 620","320 - AMD Radeon R5 (Bristol Ridge)","318 - Intel HD Graphics P530","317 - Intel HD Graphics 530","316 - Intel HD Graphics P630","315 - Intel HD Graphics 630","314 - Intel UHD Graphics 630","313 - AMD Radeon RX Vega 6","312 - AMD Radeon R6 M340DX","311 - AMD Radeon 520","310 - AMD Radeon R7 M340","309 - AMD Radeon R7 M260","303 - AMD Radeon R7 M440","302 - AMD Radeon R8 M445DX","299 - NVIDIA GeForce 920M","297 - AMD Radeon R7 M360","294 - AMD Radeon R7 M460","293 - AMD Radeon R8 M365DX","292 - AMD Radeon R7 (Kaveri)","291 - AMD Radeon R7 (Carrizo)","290 - NVIDIA GeForce GT 640M","286 - AMD Radeon R7 M265","285 - AMD Radeon R7 M270","282 - AMD FirePro M4100","279 - NVIDIA GeForce GT 730M","276 - AMD Radeon R7 M260X","269 - AMD FirePro M4000","267 - NVIDIA GeForce 825M","265 - NVIDIA GeForce GT 735M","262 - NVIDIA Quadro K2000M","259 - Intel Iris Graphics 540","258 - NVIDIA GeForce 920MX","257 - Intel Iris Plus Graphics 640","256 - NVIDIA GeForce MX110","255 - NVIDIA GeForce 830M","254 - AMD Radeon 530","253 - Intel Iris Graphics 550","252 - NVIDIA GeForce 930M","251 - Intel Iris Plus Graphics 655","250 - Intel Iris Plus Graphics 650","249 - NVIDIA GeForce GT 740M","248 - AMD Radeon R7 384 Cores (Kaveri Desktop)","247 - Intel Iris Pro Graphics 5200","246 - AMD Radeon R7 512 Cores (Kaveri Desktop)","245 - AMD Radeon R7 (Bristol Ridge)","242 - NVIDIA GeForce GT 745M","241 - AMD Radeon R7 M275DX","240 - NVIDIA GeForce 840M","239 - NVIDIA Quadro M500M","236 - AMD Radeon R7 M370","234 - AMD Radeon R7 M445","233 - AMD Radeon R9 M375","232 - AMD FirePro W4190M","231 - NVIDIA Quadro M600M","230 - NVIDIA GeForce 930MX","229 - NVIDIA GeForce 940M","228 - AMD Radeon RX Vega 8","227 - NVIDIA Quadro K1100M","226 - NVIDIA GeForce 940MX","225 - NVIDIA GeForce MX130","224 - NVIDIA Quadro M520","223 - Intel Iris Pro Graphics 6200","222 - NVIDIA GeForce GT 750M","217 - AMD FirePro W4100","216 - AMD FirePro W4170M","214 - AMD Radeon R7 M465","212 - AMD Radeon R9 M265X","209 - NVIDIA GeForce 845M","207 - NVIDIA GeForce GT 755M","206 - AMD Radeon R7 250","201 - NVIDIA Quadro K2100M","200 - AMD FirePro M5100","199 - AMD FirePro M6000","197 - NVIDIA Quadro K3000M","191 - AMD FirePro W5130M","190 - NVIDIA Maxwell GPU Surface Book (940M, GDDR5)","188 - AMD Radeon R9 M275","187 - NVIDIA GeForce GTX 760M","184 - AMD Radeon R9 M370X","183 - AMD FirePro W5170M","182 - NVIDIA Quadro K3100M","173 - AMD Radeon R9 M380","171 - AMD Radeon R9 M470","166 - Intel Iris Pro Graphics 580","165 - Intel Iris Pro Graphics P580","164 - AMD Radeon RX Vega 10","163 - NVIDIA Quadro K4000M","159 - NVIDIA GeForce GTX 765M","158 - NVIDIA GeForce 945M","153 - AMD Radeon RX Vega 11","152 - AMD Radeon R9 M280X","151 - NVIDIA Quadro M620","150 - NVIDIA Quadro M1000M","149 - NVIDIA Quadro P1000","148 - NVIDIA GeForce GTX 850M","147 - AMD Radeon R9 M385X","146 - AMD Radeon R9 M470X","145 - AMD Radeon Pro 450","144 - NVIDIA GeForce GTX 950M","136 - NVIDIA GeForce GTX 860M","135 - AMD Radeon Pro WX 3100 Mobile","134 - AMD Radeon RX 540","133 - NVIDIA GeForce GTX 770M","132 - NVIDIA Quadro K4100M","131 - NVIDIA Quadro K5000M","130 - NVIDIA Quadro M2000M","129 - NVIDIA Quadro P500","128 - NVIDIA Quadro P600","127 - NVIDIA GeForce MX150","126 - NVIDIA GeForce GT 1030 (Desktop)","125 - AMD Radeon Pro 455","124 - AMD Radeon Pro 555","123 - NVIDIA Quadro M1200","119 - AMD Radeon RX 550 (Laptop)","118 - NVIDIA GeForce GTX 750 Ti","117 - NVIDIA GeForce GTX 960M","116 - AMD Radeon Pro WX 4130","115 - AMD Radeon Pro 460","114 - AMD Radeon Pro 560X","113 - AMD Radeon Pro 560","111 - AMD FirePro M6100","110 - AMD Radeon R9 M390","107 - AMD Radeon RX 460 (Laptop)","101 - AMD Radeon R9 M290X","100 - NVIDIA GeForce GTX 870M","99 - NVIDIA Quadro M2200","98 - NVIDIA GeForce GTX 965M","96 - AMD Radeon Pro WX 4150","95 - AMD Radeon RX 460 (Desktop)","93 - NVIDIA Quadro K5100M","92 - NVIDIA GeForce GTX 780M","91 - NVIDIA GeForce GTX 760","89 - AMD Radeon R9 270X","88 - AMD Radeon RX 560 (Laptop)","87 - AMD Radeon RX 560X (Laptop)","86 - NVIDIA GeForce GTX 950","85 - NVIDIA GeForce GTX 880M","83 - AMD Radeon R7 370","82 - AMD Radeon R9 M395","81 - AMD FirePro W7170M","80 - NVIDIA GeForce GTX 1050 Max-Q","79 - NVIDIA GeForce GTX 1050 (Notebook)","78 - NVIDIA GeForce GTX 1050 (Desktop)","77 - NVIDIA Quadro M3000M","76 - AMD Radeon R9 M390X","75 - AMD Radeon R9 M295X","74 - AMD Radeon R9 M485X","73 - AMD Radeon R9 M395X","68 - NVIDIA Quadro M4000M","67 - NVIDIA GeForce GTX 970M","66 - NVIDIA GeForce GTX 1050 Ti (Desktop)","65 - NVIDIA GeForce GTX 1050 Ti Max-Q","64 - NVIDIA GeForce GTX 1050 Ti (Notebook)","63 - NVIDIA GeForce GTX 960","62 - AMD Radeon R9 380","61 - AMD Radeon R9 280X","60 - AMD Radeon RX Vega M GL / 870","59 - NVIDIA Quadro M5000M","58 - NVIDIA GeForce GTX 980M","53 - NVIDIA GeForce GTX 965M SLI","51 - AMD Radeon R9 290X","49 - NVIDIA GeForce GTX 880M SLI","48 - AMD Radeon RX 470 (Laptop)","47 - AMD Radeon RX 570 (Laptop)","46 - AMD Radeon RX 470 (Desktop)","45 - AMD Radeon Pro WX 7100","43 - NVIDIA Quadro P3000 Max-Q","42 - NVIDIA GeForce GTX 1060 Max-Q","41 - NVIDIA GeForce GTX 970","40 - NVIDIA Quadro P3000","39 - AMD Radeon RX Vega M GH","38 - AMD Radeon RX Vega Mobile","37 - NVIDIA GeForce GTX 780 Ti","36 - AMD Radeon RX 580 (Laptop)","35 - NVIDIA Quadro P3200","34 - NVIDIA Quadro P4000 Max-Q","33 - NVIDIA GeForce GTX 1060 (Laptop)","32 - AMD Radeon RX 480 (Desktop)","31 - NVIDIA Quadro P4000","30 - NVIDIA GeForce GTX 1060 (Desktop)","29 - NVIDIA GeForce GTX 970M SLI","28 - AMD Radeon R9 390X","27 - NVIDIA Quadro M5500","26 - NVIDIA GeForce GTX 980 (Laptop)","25 - AMD Radeon RX 580 (Desktop)","24 - NVIDIA GeForce GTX 980","23 - AMD Radeon R9 Nano","22 - AMD Radeon R9 Fury","21 - NVIDIA GeForce GTX 980M SLI","20 - NVIDIA Quadro P5000 Max-Q","19 - NVIDIA GeForce GTX 1070 Max-Q","18 - NVIDIA GeForce GTX 980 Ti","17 - NVIDIA Quadro P5000","16 - NVIDIA Quadro P4200","15 - NVIDIA GeForce GTX 1070 (Laptop)","14 - NVIDIA GeForce GTX 1080 Max-Q","13 - NVIDIA GeForce GTX 1070 (Desktop)","12 - AMD Radeon Pro Vega 56","11 - NVIDIA Quadro P5200","10 - NVIDIA GeForce GTX 980 SLI (Laptop)","9 - NVIDIA GeForce GTX 1070 Ti (Desktop)","8 - NVIDIA GeForce GTX 1080 (Laptop)","7 - AMD Radeon RX Vega 64","6 - NVIDIA GeForce GTX 1080 (Desktop)","5 - NVIDIA GeForce GTX 1070 SLI (Laptop)","4 - NVIDIA GeForce GTX 1070 SLI (Desktop)","3 - NVIDIA GeForce GTX 1080 SLI (Laptop)","2 - NVIDIA Titan X Pascal","1 - NVIDIA GeForce GTX 1080 Ti (Desktop)"],o.BENCHMARK_SCORE_MOBILE=["843 - ARM Mali-200","842 - Qualcomm Adreno 200","841 - PowerVR SGX530","840 - PowerVR SGX531","839 - PowerVR SGX535","838 - Vivante GC800","837 - Qualcomm Adreno 203","836 - Qualcomm Adreno 205","834 - PowerVR SGX540","832 - NVIDIA GeForce ULP (Tegra 2)","831 - ARM Mali-400 MP","830 - ARM Mali-400 MP2","829 - Vivante GC1000+ Dual-Core","828 - Qualcomm Adreno 220","827 - Broadcom VideoCore-IV","826 - NVIDIA GeForce ULP (Tegra 3)","825 - ARM Mali-400 MP4","824 - Vivante GC4000","823 - Qualcomm Adreno 225","815 - Qualcomm Adreno 302","814 - Vivante GC7000UL","813 - ARM Mali-T720","812 - Qualcomm Adreno 304","811 - Qualcomm Adreno 305","810 - Qualcomm Adreno 306","809 - Qualcomm Adreno 308","808 - PowerVR SGX544","807 - ARM Mali-T720 MP2","806 - PowerVR SGX544MP2","805 - PowerVR SGX545","802 - PowerVR SGX543MP2","792 - PowerVR SGX543MP3","784 - ARM Mali-T830 MP1","783 - ARM Mali-450 MP4","782 - ARM Mali-T720 MP4","781 - PowerVR GE8100","780 - ARM Mali-T760 MP2","779 - Qualcomm Adreno 320","778 - ARM Mali-T624","777 - PowerVR SGX543MP4","750 - ARM Mali-T830 MP2","749 - Qualcomm Adreno 405","748 - PowerVR G6200","747 - NVIDIA GeForce Tegra 4","742 - ARM Mali-T604 MP4","736 - ARM Mali-T830 MP3","735 - ARM Mali-T860 MP2","731 - Qualcomm Adreno 505","730 - Qualcomm Adreno 506","729 - Qualcomm Adreno 508","728 - Qualcomm Adreno 509","727 - ARM Mali-T628 MP4","726 - PowerVR SGX554MP4","688 - ARM Mali-T760 MP4","687 - ARM Mali-T628 MP6","686 - Intel HD Graphics (Bay Trail)","685 - PowerVR G6400","684 - PowerVR GX6250","683 - PowerVR G6430","682 - Qualcomm Adreno 330","681 - Qualcomm Adreno 510","680 - Qualcomm Adreno 512","605 - Intel HD Graphics (Cherry Trail)","603 - Qualcomm Adreno 418","583 - Qualcomm Adreno 420","582 - PowerVR GX6450","572 - ARM Mali-T880 MP2","571 - ARM Mali-T760 MP6","539 - ARM Mali-T880 MP4","538 - ARM Mali-G72 MP3","519 - Qualcomm Adreno 430","514 - ARM Mali-G71 MP2","513 - ARM Mali-T760 MP8","468 - ARM Mali-T880 MP12","467 - Apple A9 / PowerVR GT7600","466 - NVIDIA Tegra K1 Kepler GPU","465 - PowerVR GXA6850","464 - Qualcomm Adreno 530","426 - ARM Mali-G71 MP8","425 - ARM Mali-G72 MP12","424 - ARM Mali-G71 MP20","423 - ARM Mali-G72 MP18","422 - Qualcomm Adreno 540","421 - Qualcomm Adreno 630","405 - Apple A10 Fusion GPU / PowerVR","319 - NVIDIA Tegra X1 Maxwell GPU","296 - Apple A9X / PowerVR Series 7XT","261 - Apple A10X Fusion GPU / PowerVR","260 - Apple A11 Bionic GPU"]},function(e,o,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var n=function(){function e(e,o){for(var r=0;r<o.length;r++){var n=o[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(o,r,n){return r&&e(o.prototype,r),n&&e(o,n),o}}();var a=function(){function e(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!function(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e),this.setUserAgent(o)}return n(e,[{key:"match",value:function(e){return this.matchCache[e]||(this.matchCache[e]=this.userAgent.indexOf(e)>-1),this.matchCache[e]}},{key:"getUserAgent",value:function(){return"undefined"!=typeof document?window.navigator.userAgent:""}},{key:"setUserAgent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.userAgent=e||this.userAgent||this.getUserAgent(),this.userAgent&&(this.matchCache={},this.userAgent=this.userAgent.toLowerCase())}},{key:"iphone",get:function(){return!this.windows&&this.match("iphone")}},{key:"ipod",get:function(){return this.match("ipod")}},{key:"ipad",get:function(){return this.match("ipad")}},{key:"android",get:function(){return!this.windows&&this.match("android")}},{key:"androidPhone",get:function(){return this.android&&this.match("mobile")}},{key:"androidTablet",get:function(){return this.android&&!this.match("mobile")}},{key:"blackberry",get:function(){return this.match("blackberry")||this.match("bb10")||this.match("rim")}},{key:"blackberryPhone",get:function(){return this.blackberry&&!this.match("tablet")}},{key:"blackberryTablet",get:function(){return this.blackberry&&this.match("tablet")}},{key:"windows",get:function(){return this.match("windows")}},{key:"windowsPhone",get:function(){return this.windows&&this.match("phone")}},{key:"windowsTablet",get:function(){return this.windows&&this.match("touch")&&!this.windowsPhone}},{key:"firefoxOS",get:function(){return(this.match("(mobile;")||this.match("(tablet;"))&&this.match("; rv:")}},{key:"firefoxOSPhone",get:function(){return this.firefoxOS&&this.match("mobile")}},{key:"firefoxOSTablet",get:function(){return this.firefoxOS&&this.match("tablet")}},{key:"mobile",get:function(){return this.androidPhone||this.iphone||this.ipod||this.windowsPhone||this.blackberryPhone||this.firefoxOSPhone}},{key:"tablet",get:function(){return this.ipad||this.androidTablet||this.blackberryTablet||this.windowsTablet||this.firefoxOSTablet}}]),e}();o.default=a},function(e,o,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.getWebGLContext=function(e){var o=document.createElement("canvas"),r=o.getContext("webgl",e)||o.getContext("experimental-webgl",e);if(!(r&&r instanceof WebGLRenderingContext))return!1;return r},o.getBenchmarkByPercentage=function(e,o){var r=0;return o.map(function(o){var n=Math.round(e.length/100*o),a=e.slice(r,r+n);return r+=n,a})}}])}); |
{ | ||
"name": "detect-gpu", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "Classify GPU's based on their benchmark score in order to provide an adaptive experience.", | ||
@@ -9,4 +9,7 @@ "main": "dist/detect-gpu.js", | ||
"lint": "eslint src/**/*.js", | ||
"test": "jest --config=jest.config.json", | ||
"test:coverage": "jest --config=jest.config.json --coverage", | ||
"dist": "NODE_ENV=production webpack -p --progress --optimize-minimize --display-modules && NODE_ENV=development webpack -d --progress --display-modules", | ||
"deploy": "npm run dist && npm version patch && npm publish && git push origin", | ||
"parse-analytics": "node ./scripts/analytics_parser.js", | ||
"update-benchmarks": "node ./scripts/update_benchmarks.js" | ||
@@ -18,2 +21,3 @@ }, | ||
"babel-core": "^6.26.3", | ||
"babel-jest": "^23.4.2", | ||
"babel-loader": "^7.1.5", | ||
@@ -28,2 +32,3 @@ "babel-plugin-transform-object-assign": "^6.22.0", | ||
"http-server": "^0.11.1", | ||
"jest": "^23.5.0", | ||
"prettier": "^1.13.7", | ||
@@ -35,3 +40,4 @@ "prettier-eslint": "^8.8.2", | ||
"dependencies": { | ||
"jssoup": "^0.0.8", | ||
"csvtojson": "^2.0.8", | ||
"jssoup": "^0.0.9", | ||
"node-fetch": "^2.1.2", | ||
@@ -38,0 +44,0 @@ "ua-parser-js": "^0.7.18" |
@@ -12,10 +12,11 @@ # Detect GPU | ||
In the current state `detect-gpu` should be considered to be experimental and should not yet be used in production. There are many edge cases and I've only been able to test it on a small range of devices. It is very likely that some GPU's are not reported correctly. This is most likely due to entries in the benchmark test that are very similar to each other, use strange versioning schemes or the reported GPU does not expose its name and version correctly. | ||
In the current state `detect-gpu` should be considered to be experimental and should not yet be used in production. | ||
If you are interested in helping out and improving the stability of the library feel encouraged to [open an issue](https://github.com/TimvanScherpenzeel/detect-gpu/issues/new) with the following content: | ||
If you are interested in helping me out collecting renderer names please add the following script tag to your webpage: | ||
- The reported GPU tier as reported by [detect-gpu](https://timvanscherpenzeel.github.io/detect-gpu/) | ||
- A copy of the full output of [detect-features](https://timvanscherpenzeel.github.io/detect-features/), this will include enough information for me to determine what could be wrong. | ||
```html | ||
<script defer src="https://unpkg.com/detect-gpu/scripts/analytics_embed.js"></script> | ||
``` | ||
I'm hoping that through community effort we can create a more stable version of the library. Without your input (e.g. sharing ideas, PR's and making issues) it will be very difficult to improve the library. I simply only have access to a small range of devices and GPU's myself. | ||
The script simply checks the name of the users unmasked renderer and sends it as a Google Analytics event to my account. The contents of the script can be found [here](https://github.com/TimvanScherpenzeel/detect-gpu/blob/master/scripts/analytics_embed.js). | ||
@@ -22,0 +23,0 @@ ## Demo |
@@ -55,7 +55,7 @@ #!/usr/bin/env node | ||
export const BENCHMARK_SCORE_DESKTOP = [ | ||
${result[0].map(entry => `\n\'${entry}\'`)} | ||
${result[0].reverse().map(entry => `\n\'${entry}\'`)} | ||
]; | ||
export const BENCHMARK_SCORE_MOBILE = [ | ||
${result[1].map(entry => `\n\'${entry}\'`)} | ||
${result[1].reverse().map(entry => `\n\'${entry}\'`)} | ||
]; | ||
@@ -62,0 +62,0 @@ `; |
@@ -6,383 +6,383 @@ // Scraped from https://www.notebookcheck.net/ | ||
export const BENCHMARK_SCORE_DESKTOP = [ | ||
'704 - AMD Radeon HD 7290', | ||
'694 - AMD Radeon HD 8180', | ||
'692 - AMD Radeon HD 7310', | ||
'690 - AMD Radeon HD 7340', | ||
'686 - Intel HD Graphics (Bay Trail)', | ||
'645 - Intel HD Graphics (Ivy Bridge)', | ||
'641 - AMD Radeon HD 8210', | ||
'617 - AMD Radeon HD 8250', | ||
'616 - AMD Radeon R6 (Mullins)', | ||
'615 - AMD Radeon HD 8240', | ||
'607 - AMD Radeon HD 8280', | ||
'605 - Intel HD Graphics (Cherry Trail)', | ||
'604 - AMD Radeon R2 (Mullins/Beema/Carrizo-L)', | ||
'584 - Intel HD Graphics (Haswell)', | ||
'575 - Intel HD Graphics 400 (Braswell)', | ||
'574 - Intel HD Graphics (Braswell)', | ||
'573 - Intel HD Graphics 405 (Braswell)', | ||
'553 - Intel HD Graphics 500', | ||
'552 - Intel UHD Graphics 600', | ||
'551 - AMD Radeon HD 8330', | ||
'550 - AMD Radeon HD 8350G', | ||
'537 - AMD Radeon HD 8400', | ||
'533 - AMD Radeon HD 8450G', | ||
'524 - Intel HD Graphics 4200', | ||
'523 - AMD Radeon R2 (Stoney Ridge)', | ||
'522 - AMD Radeon R3 (Mullins/Beema)', | ||
'521 - AMD Radeon R4 (Beema)', | ||
'520 - AMD Radeon R5 (Beema/Carrizo-L)', | ||
'518 - Intel HD Graphics (Broadwell)', | ||
'517 - AMD Radeon R4 (Kaveri)', | ||
'516 - AMD Radeon R4 (Stoney Ridge)', | ||
'512 - Intel HD Graphics 4000', | ||
'511 - AMD Radeon HD 7480D', | ||
'503 - Intel HD Graphics 505', | ||
'502 - Intel UHD Graphics 605', | ||
'501 - Intel HD Graphics 5300', | ||
'472 - Intel HD Graphics 510', | ||
'471 - Intel HD Graphics 610', | ||
'470 - Intel HD Graphics 4400', | ||
'469 - Intel HD Graphics 515', | ||
'462 - AMD Radeon HD 8470D', | ||
'453 - AMD Radeon HD 8550G', | ||
'437 - Intel HD Graphics 5000', | ||
'434 - AMD Radeon HD 7660G', | ||
'433 - NVIDIA GeForce 710M', | ||
'430 - AMD Radeon R5 (Kaveri)', | ||
'429 - AMD Radeon R5 (Carrizo)', | ||
'428 - Intel HD Graphics 615', | ||
'427 - Intel UHD Graphics 615', | ||
'420 - Intel HD Graphics 5500', | ||
'418 - Intel HD Graphics 4600', | ||
'415 - AMD Radeon HD 8610G', | ||
'413 - Intel Iris Graphics 5100', | ||
'411 - NVIDIA Quadro K610M', | ||
'410 - Intel HD Graphics 6000', | ||
'404 - AMD Radeon R5 M315', | ||
'403 - AMD Radeon R5 M230', | ||
'402 - AMD Radeon R5 M320', | ||
'401 - AMD Radeon R5 M240', | ||
'399 - AMD Radeon R5 (Stoney Ridge)', | ||
'398 - NVIDIA GeForce GT 720M', | ||
'397 - Intel Iris Graphics 6100', | ||
'396 - Intel HD Graphics 520', | ||
'395 - AMD Radeon RX Vega 3', | ||
'394 - NVIDIA GeForce 820M', | ||
'393 - NVIDIA GeForce 910M', | ||
'391 - AMD Radeon R5 M255', | ||
'390 - AMD Radeon R5 M430', | ||
'389 - AMD Radeon R5 M330', | ||
'388 - AMD Radeon R5 M335', | ||
'386 - AMD Radeon HD 7560D', | ||
'380 - AMD Radeon HD 8650G', | ||
'364 - NVIDIA Quadro K1000M', | ||
'362 - AMD Radeon HD 7660D', | ||
'361 - AMD Radeon R6 M255DX', | ||
'354 - Intel HD Graphics 5600', | ||
'344 - AMD FirePro W2100', | ||
'335 - AMD Radeon R6 (Kaveri)', | ||
'323 - AMD Radeon R6 (Carrizo)', | ||
'322 - Intel HD Graphics 620', | ||
'321 - Intel UHD Graphics 620', | ||
'320 - AMD Radeon R5 (Bristol Ridge)', | ||
'318 - Intel HD Graphics P530', | ||
'317 - Intel HD Graphics 530', | ||
'316 - Intel HD Graphics P630', | ||
'315 - Intel HD Graphics 630', | ||
'314 - Intel UHD Graphics 630', | ||
'313 - AMD Radeon RX Vega 6', | ||
'312 - AMD Radeon R6 M340DX', | ||
'311 - AMD Radeon 520', | ||
'310 - AMD Radeon R7 M340', | ||
'309 - AMD Radeon R7 M260', | ||
'303 - AMD Radeon R7 M440', | ||
'302 - AMD Radeon R8 M445DX', | ||
'299 - NVIDIA GeForce 920M', | ||
'297 - AMD Radeon R7 M360', | ||
'294 - AMD Radeon R7 M460', | ||
'293 - AMD Radeon R8 M365DX', | ||
'292 - AMD Radeon R7 (Kaveri)', | ||
'291 - AMD Radeon R7 (Carrizo)', | ||
'290 - NVIDIA GeForce GT 640M', | ||
'286 - AMD Radeon R7 M265', | ||
'285 - AMD Radeon R7 M270', | ||
'282 - AMD FirePro M4100', | ||
'279 - NVIDIA GeForce GT 730M', | ||
'276 - AMD Radeon R7 M260X', | ||
'269 - AMD FirePro M4000', | ||
'267 - NVIDIA GeForce 825M', | ||
'265 - NVIDIA GeForce GT 735M', | ||
'262 - NVIDIA Quadro K2000M', | ||
'259 - Intel Iris Graphics 540', | ||
'258 - NVIDIA GeForce 920MX', | ||
'257 - Intel Iris Plus Graphics 640', | ||
'256 - NVIDIA GeForce MX110', | ||
'255 - NVIDIA GeForce 830M', | ||
'254 - AMD Radeon 530', | ||
'253 - Intel Iris Graphics 550', | ||
'252 - NVIDIA GeForce 930M', | ||
'251 - Intel Iris Plus Graphics 655', | ||
'250 - Intel Iris Plus Graphics 650', | ||
'249 - NVIDIA GeForce GT 740M', | ||
'248 - AMD Radeon R7 384 Cores (Kaveri Desktop)', | ||
'247 - Intel Iris Pro Graphics 5200', | ||
'246 - AMD Radeon R7 512 Cores (Kaveri Desktop)', | ||
'245 - AMD Radeon R7 (Bristol Ridge)', | ||
'242 - NVIDIA GeForce GT 745M', | ||
'241 - AMD Radeon R7 M275DX', | ||
'240 - NVIDIA GeForce 840M', | ||
'239 - NVIDIA Quadro M500M', | ||
'236 - AMD Radeon R7 M370', | ||
'234 - AMD Radeon R7 M445', | ||
'233 - AMD Radeon R9 M375', | ||
'232 - AMD FirePro W4190M', | ||
'231 - NVIDIA Quadro M600M', | ||
'230 - NVIDIA GeForce 930MX', | ||
'229 - NVIDIA GeForce 940M', | ||
'228 - AMD Radeon RX Vega 8', | ||
'227 - NVIDIA Quadro K1100M', | ||
'226 - NVIDIA GeForce 940MX', | ||
'225 - NVIDIA GeForce MX130', | ||
'224 - NVIDIA Quadro M520', | ||
'223 - Intel Iris Pro Graphics 6200', | ||
'222 - NVIDIA GeForce GT 750M', | ||
'217 - AMD FirePro W4100', | ||
'216 - AMD FirePro W4170M', | ||
'214 - AMD Radeon R7 M465', | ||
'212 - AMD Radeon R9 M265X', | ||
'209 - NVIDIA GeForce 845M', | ||
'207 - NVIDIA GeForce GT 755M', | ||
'206 - AMD Radeon R7 250', | ||
'201 - NVIDIA Quadro K2100M', | ||
'200 - AMD FirePro M5100', | ||
'199 - AMD FirePro M6000', | ||
'197 - NVIDIA Quadro K3000M', | ||
'191 - AMD FirePro W5130M', | ||
'190 - NVIDIA Maxwell GPU Surface Book (940M, GDDR5)', | ||
'188 - AMD Radeon R9 M275', | ||
'187 - NVIDIA GeForce GTX 760M', | ||
'184 - AMD Radeon R9 M370X', | ||
'183 - AMD FirePro W5170M', | ||
'182 - NVIDIA Quadro K3100M', | ||
'173 - AMD Radeon R9 M380', | ||
'171 - AMD Radeon R9 M470', | ||
'166 - Intel Iris Pro Graphics 580', | ||
'165 - Intel Iris Pro Graphics P580', | ||
'164 - AMD Radeon RX Vega 10', | ||
'163 - NVIDIA Quadro K4000M', | ||
'159 - NVIDIA GeForce GTX 765M', | ||
'158 - NVIDIA GeForce 945M', | ||
'153 - AMD Radeon RX Vega 11', | ||
'152 - AMD Radeon R9 M280X', | ||
'151 - NVIDIA Quadro M620', | ||
'150 - NVIDIA Quadro M1000M', | ||
'149 - NVIDIA Quadro P1000', | ||
'148 - NVIDIA GeForce GTX 850M', | ||
'147 - AMD Radeon R9 M385X', | ||
'146 - AMD Radeon R9 M470X', | ||
'145 - AMD Radeon Pro 450', | ||
'144 - NVIDIA GeForce GTX 950M', | ||
'136 - NVIDIA GeForce GTX 860M', | ||
'135 - AMD Radeon Pro WX 3100 Mobile', | ||
'134 - AMD Radeon RX 540', | ||
'133 - NVIDIA GeForce GTX 770M', | ||
'132 - NVIDIA Quadro K4100M', | ||
'131 - NVIDIA Quadro K5000M', | ||
'130 - NVIDIA Quadro M2000M', | ||
'129 - NVIDIA Quadro P500', | ||
'128 - NVIDIA Quadro P600', | ||
'127 - NVIDIA GeForce MX150', | ||
'126 - NVIDIA GeForce GT 1030 (Desktop)', | ||
'125 - AMD Radeon Pro 455', | ||
'124 - AMD Radeon Pro 555', | ||
'123 - NVIDIA Quadro M1200', | ||
'119 - AMD Radeon RX 550 (Laptop)', | ||
'118 - NVIDIA GeForce GTX 750 Ti', | ||
'117 - NVIDIA GeForce GTX 960M', | ||
'116 - AMD Radeon Pro WX 4130', | ||
'115 - AMD Radeon Pro 460', | ||
'114 - AMD Radeon Pro 560X', | ||
'113 - AMD Radeon Pro 560', | ||
'111 - AMD FirePro M6100', | ||
'110 - AMD Radeon R9 M390', | ||
'107 - AMD Radeon RX 460 (Laptop)', | ||
'101 - AMD Radeon R9 M290X', | ||
'100 - NVIDIA GeForce GTX 870M', | ||
'99 - NVIDIA Quadro M2200', | ||
'98 - NVIDIA GeForce GTX 965M', | ||
'96 - AMD Radeon Pro WX 4150', | ||
'95 - AMD Radeon RX 460 (Desktop)', | ||
'93 - NVIDIA Quadro K5100M', | ||
'92 - NVIDIA GeForce GTX 780M', | ||
'91 - NVIDIA GeForce GTX 760', | ||
'89 - AMD Radeon R9 270X', | ||
'88 - AMD Radeon RX 560 (Laptop)', | ||
'87 - AMD Radeon RX 560X (Laptop)', | ||
'86 - NVIDIA GeForce GTX 950', | ||
'85 - NVIDIA GeForce GTX 880M', | ||
'83 - AMD Radeon R7 370', | ||
'82 - AMD Radeon R9 M395', | ||
'81 - AMD FirePro W7170M', | ||
'80 - NVIDIA GeForce GTX 1050 Max-Q', | ||
'79 - NVIDIA GeForce GTX 1050 (Notebook)', | ||
'78 - NVIDIA GeForce GTX 1050 (Desktop)', | ||
'77 - NVIDIA Quadro M3000M', | ||
'76 - AMD Radeon R9 M390X', | ||
'75 - AMD Radeon R9 M295X', | ||
'74 - AMD Radeon R9 M485X', | ||
'73 - AMD Radeon R9 M395X', | ||
'68 - NVIDIA Quadro M4000M', | ||
'67 - NVIDIA GeForce GTX 970M', | ||
'66 - NVIDIA GeForce GTX 1050 Ti (Desktop)', | ||
'65 - NVIDIA GeForce GTX 1050 Ti Max-Q', | ||
'64 - NVIDIA GeForce GTX 1050 Ti (Notebook)', | ||
'63 - NVIDIA GeForce GTX 960', | ||
'62 - AMD Radeon R9 380', | ||
'61 - AMD Radeon R9 280X', | ||
'60 - AMD Radeon RX Vega M GL / 870', | ||
'59 - NVIDIA Quadro M5000M', | ||
'58 - NVIDIA GeForce GTX 980M', | ||
'53 - NVIDIA GeForce GTX 965M SLI', | ||
'51 - AMD Radeon R9 290X', | ||
'49 - NVIDIA GeForce GTX 880M SLI', | ||
'48 - AMD Radeon RX 470 (Laptop)', | ||
'47 - AMD Radeon RX 570 (Laptop)', | ||
'46 - AMD Radeon RX 470 (Desktop)', | ||
'45 - AMD Radeon Pro WX 7100', | ||
'43 - NVIDIA Quadro P3000 Max-Q', | ||
'42 - NVIDIA GeForce GTX 1060 Max-Q', | ||
'41 - NVIDIA GeForce GTX 970', | ||
'40 - NVIDIA Quadro P3000', | ||
'39 - AMD Radeon RX Vega M GH', | ||
'38 - AMD Radeon RX Vega Mobile', | ||
'37 - NVIDIA GeForce GTX 780 Ti', | ||
'36 - AMD Radeon RX 580 (Laptop)', | ||
'35 - NVIDIA Quadro P3200', | ||
'34 - NVIDIA Quadro P4000 Max-Q', | ||
'33 - NVIDIA GeForce GTX 1060 (Laptop)', | ||
'32 - AMD Radeon RX 480 (Desktop)', | ||
'31 - NVIDIA Quadro P4000', | ||
'30 - NVIDIA GeForce GTX 1060 (Desktop)', | ||
'29 - NVIDIA GeForce GTX 970M SLI', | ||
'28 - AMD Radeon R9 390X', | ||
'27 - NVIDIA Quadro M5500', | ||
'26 - NVIDIA GeForce GTX 980 (Laptop)', | ||
'25 - AMD Radeon RX 580 (Desktop)', | ||
'24 - NVIDIA GeForce GTX 980', | ||
'23 - AMD Radeon R9 Nano', | ||
'22 - AMD Radeon R9 Fury', | ||
'21 - NVIDIA GeForce GTX 980M SLI', | ||
'20 - NVIDIA Quadro P5000 Max-Q', | ||
'19 - NVIDIA GeForce GTX 1070 Max-Q', | ||
'18 - NVIDIA GeForce GTX 980 Ti', | ||
'17 - NVIDIA Quadro P5000', | ||
'16 - NVIDIA Quadro P4200', | ||
'15 - NVIDIA GeForce GTX 1070 (Laptop)', | ||
'14 - NVIDIA GeForce GTX 1080 Max-Q', | ||
'13 - NVIDIA GeForce GTX 1070 (Desktop)', | ||
'12 - AMD Radeon Pro Vega 56', | ||
'11 - NVIDIA Quadro P5200', | ||
'10 - NVIDIA GeForce GTX 980 SLI (Laptop)', | ||
'9 - NVIDIA GeForce GTX 1070 Ti (Desktop)', | ||
'8 - NVIDIA GeForce GTX 1080 (Laptop)', | ||
'7 - AMD Radeon RX Vega 64', | ||
'6 - NVIDIA GeForce GTX 1080 (Desktop)', | ||
'5 - NVIDIA GeForce GTX 1070 SLI (Laptop)', | ||
'4 - NVIDIA GeForce GTX 1070 SLI (Desktop)', | ||
'3 - NVIDIA GeForce GTX 1080 SLI (Laptop)', | ||
'2 - NVIDIA Titan X Pascal', | ||
'1 - NVIDIA GeForce GTX 1080 Ti (Desktop)', | ||
'2 - NVIDIA Titan X Pascal', | ||
'3 - NVIDIA GeForce GTX 1080 SLI (Laptop)', | ||
'4 - NVIDIA GeForce GTX 1070 SLI (Desktop)', | ||
'5 - NVIDIA GeForce GTX 1070 SLI (Laptop)', | ||
'6 - NVIDIA GeForce GTX 1080 (Desktop)', | ||
'7 - AMD Radeon RX Vega 64', | ||
'8 - NVIDIA GeForce GTX 1080 (Laptop)', | ||
'9 - NVIDIA GeForce GTX 1070 Ti (Desktop)', | ||
'10 - NVIDIA GeForce GTX 980 SLI (Laptop)', | ||
'11 - NVIDIA Quadro P5200', | ||
'12 - AMD Radeon Pro Vega 56', | ||
'13 - NVIDIA GeForce GTX 1070 (Desktop)', | ||
'14 - NVIDIA GeForce GTX 1080 Max-Q', | ||
'15 - NVIDIA GeForce GTX 1070 (Laptop)', | ||
'16 - NVIDIA Quadro P4200', | ||
'17 - NVIDIA Quadro P5000', | ||
'18 - NVIDIA GeForce GTX 980 Ti', | ||
'19 - NVIDIA GeForce GTX 1070 Max-Q', | ||
'20 - NVIDIA Quadro P5000 Max-Q', | ||
'21 - NVIDIA GeForce GTX 980M SLI', | ||
'22 - AMD Radeon R9 Fury', | ||
'23 - AMD Radeon R9 Nano', | ||
'24 - NVIDIA GeForce GTX 980', | ||
'25 - AMD Radeon RX 580 (Desktop)', | ||
'26 - NVIDIA GeForce GTX 980 (Laptop)', | ||
'27 - NVIDIA Quadro M5500', | ||
'28 - AMD Radeon R9 390X', | ||
'29 - NVIDIA GeForce GTX 970M SLI', | ||
'30 - NVIDIA GeForce GTX 1060 (Desktop)', | ||
'31 - NVIDIA Quadro P4000', | ||
'32 - AMD Radeon RX 480 (Desktop)', | ||
'33 - NVIDIA GeForce GTX 1060 (Laptop)', | ||
'34 - NVIDIA Quadro P4000 Max-Q', | ||
'35 - NVIDIA Quadro P3200', | ||
'36 - AMD Radeon RX 580 (Laptop)', | ||
'37 - NVIDIA GeForce GTX 780 Ti', | ||
'38 - AMD Radeon RX Vega Mobile', | ||
'39 - AMD Radeon RX Vega M GH', | ||
'40 - NVIDIA Quadro P3000', | ||
'41 - NVIDIA GeForce GTX 970', | ||
'42 - NVIDIA GeForce GTX 1060 Max-Q', | ||
'43 - NVIDIA Quadro P3000 Max-Q', | ||
'45 - AMD Radeon Pro WX 7100', | ||
'46 - AMD Radeon RX 470 (Desktop)', | ||
'47 - AMD Radeon RX 570 (Laptop)', | ||
'48 - AMD Radeon RX 470 (Laptop)', | ||
'49 - NVIDIA GeForce GTX 880M SLI', | ||
'51 - AMD Radeon R9 290X', | ||
'53 - NVIDIA GeForce GTX 965M SLI', | ||
'58 - NVIDIA GeForce GTX 980M', | ||
'59 - NVIDIA Quadro M5000M', | ||
'60 - AMD Radeon RX Vega M GL / 870', | ||
'61 - AMD Radeon R9 280X', | ||
'62 - AMD Radeon R9 380', | ||
'63 - NVIDIA GeForce GTX 960', | ||
'64 - NVIDIA GeForce GTX 1050 Ti (Notebook)', | ||
'65 - NVIDIA GeForce GTX 1050 Ti Max-Q', | ||
'66 - NVIDIA GeForce GTX 1050 Ti (Desktop)', | ||
'67 - NVIDIA GeForce GTX 970M', | ||
'68 - NVIDIA Quadro M4000M', | ||
'73 - AMD Radeon R9 M395X', | ||
'74 - AMD Radeon R9 M485X', | ||
'75 - AMD Radeon R9 M295X', | ||
'76 - AMD Radeon R9 M390X', | ||
'77 - NVIDIA Quadro M3000M', | ||
'78 - NVIDIA GeForce GTX 1050 (Desktop)', | ||
'79 - NVIDIA GeForce GTX 1050 (Notebook)', | ||
'80 - NVIDIA GeForce GTX 1050 Max-Q', | ||
'81 - AMD FirePro W7170M', | ||
'82 - AMD Radeon R9 M395', | ||
'83 - AMD Radeon R7 370', | ||
'85 - NVIDIA GeForce GTX 880M', | ||
'86 - NVIDIA GeForce GTX 950', | ||
'87 - AMD Radeon RX 560X (Laptop)', | ||
'88 - AMD Radeon RX 560 (Laptop)', | ||
'89 - AMD Radeon R9 270X', | ||
'91 - NVIDIA GeForce GTX 760', | ||
'92 - NVIDIA GeForce GTX 780M', | ||
'93 - NVIDIA Quadro K5100M', | ||
'95 - AMD Radeon RX 460 (Desktop)', | ||
'96 - AMD Radeon Pro WX 4150', | ||
'98 - NVIDIA GeForce GTX 965M', | ||
'99 - NVIDIA Quadro M2200', | ||
'100 - NVIDIA GeForce GTX 870M', | ||
'101 - AMD Radeon R9 M290X', | ||
'107 - AMD Radeon RX 460 (Laptop)', | ||
'110 - AMD Radeon R9 M390', | ||
'111 - AMD FirePro M6100', | ||
'113 - AMD Radeon Pro 560', | ||
'114 - AMD Radeon Pro 560X', | ||
'115 - AMD Radeon Pro 460', | ||
'116 - AMD Radeon Pro WX 4130', | ||
'117 - NVIDIA GeForce GTX 960M', | ||
'118 - NVIDIA GeForce GTX 750 Ti', | ||
'119 - AMD Radeon RX 550 (Laptop)', | ||
'123 - NVIDIA Quadro M1200', | ||
'124 - AMD Radeon Pro 555', | ||
'125 - AMD Radeon Pro 455', | ||
'126 - NVIDIA GeForce GT 1030 (Desktop)', | ||
'127 - NVIDIA GeForce MX150', | ||
'128 - NVIDIA Quadro P600', | ||
'129 - NVIDIA Quadro P500', | ||
'130 - NVIDIA Quadro M2000M', | ||
'131 - NVIDIA Quadro K5000M', | ||
'132 - NVIDIA Quadro K4100M', | ||
'133 - NVIDIA GeForce GTX 770M', | ||
'134 - AMD Radeon RX 540', | ||
'135 - AMD Radeon Pro WX 3100 Mobile', | ||
'136 - NVIDIA GeForce GTX 860M', | ||
'144 - NVIDIA GeForce GTX 950M', | ||
'145 - AMD Radeon Pro 450', | ||
'146 - AMD Radeon R9 M470X', | ||
'147 - AMD Radeon R9 M385X', | ||
'148 - NVIDIA GeForce GTX 850M', | ||
'149 - NVIDIA Quadro P1000', | ||
'150 - NVIDIA Quadro M1000M', | ||
'151 - NVIDIA Quadro M620', | ||
'152 - AMD Radeon R9 M280X', | ||
'153 - AMD Radeon RX Vega 11', | ||
'158 - NVIDIA GeForce 945M', | ||
'159 - NVIDIA GeForce GTX 765M', | ||
'163 - NVIDIA Quadro K4000M', | ||
'164 - AMD Radeon RX Vega 10', | ||
'165 - Intel Iris Pro Graphics P580', | ||
'166 - Intel Iris Pro Graphics 580', | ||
'171 - AMD Radeon R9 M470', | ||
'173 - AMD Radeon R9 M380', | ||
'182 - NVIDIA Quadro K3100M', | ||
'183 - AMD FirePro W5170M', | ||
'184 - AMD Radeon R9 M370X', | ||
'187 - NVIDIA GeForce GTX 760M', | ||
'188 - AMD Radeon R9 M275', | ||
'190 - NVIDIA Maxwell GPU Surface Book (940M, GDDR5)', | ||
'191 - AMD FirePro W5130M', | ||
'197 - NVIDIA Quadro K3000M', | ||
'199 - AMD FirePro M6000', | ||
'200 - AMD FirePro M5100', | ||
'201 - NVIDIA Quadro K2100M', | ||
'206 - AMD Radeon R7 250', | ||
'207 - NVIDIA GeForce GT 755M', | ||
'209 - NVIDIA GeForce 845M', | ||
'212 - AMD Radeon R9 M265X', | ||
'214 - AMD Radeon R7 M465', | ||
'216 - AMD FirePro W4170M', | ||
'217 - AMD FirePro W4100', | ||
'222 - NVIDIA GeForce GT 750M', | ||
'223 - Intel Iris Pro Graphics 6200', | ||
'224 - NVIDIA Quadro M520', | ||
'225 - NVIDIA GeForce MX130', | ||
'226 - NVIDIA GeForce 940MX', | ||
'227 - NVIDIA Quadro K1100M', | ||
'228 - AMD Radeon RX Vega 8', | ||
'229 - NVIDIA GeForce 940M', | ||
'230 - NVIDIA GeForce 930MX', | ||
'231 - NVIDIA Quadro M600M', | ||
'232 - AMD FirePro W4190M', | ||
'233 - AMD Radeon R9 M375', | ||
'234 - AMD Radeon R7 M445', | ||
'236 - AMD Radeon R7 M370', | ||
'239 - NVIDIA Quadro M500M', | ||
'240 - NVIDIA GeForce 840M', | ||
'241 - AMD Radeon R7 M275DX', | ||
'242 - NVIDIA GeForce GT 745M', | ||
'245 - AMD Radeon R7 (Bristol Ridge)', | ||
'246 - AMD Radeon R7 512 Cores (Kaveri Desktop)', | ||
'247 - Intel Iris Pro Graphics 5200', | ||
'248 - AMD Radeon R7 384 Cores (Kaveri Desktop)', | ||
'249 - NVIDIA GeForce GT 740M', | ||
'250 - Intel Iris Plus Graphics 650', | ||
'251 - Intel Iris Plus Graphics 655', | ||
'252 - NVIDIA GeForce 930M', | ||
'253 - Intel Iris Graphics 550', | ||
'254 - AMD Radeon 530', | ||
'255 - NVIDIA GeForce 830M', | ||
'256 - NVIDIA GeForce MX110', | ||
'257 - Intel Iris Plus Graphics 640', | ||
'258 - NVIDIA GeForce 920MX', | ||
'259 - Intel Iris Graphics 540', | ||
'262 - NVIDIA Quadro K2000M', | ||
'265 - NVIDIA GeForce GT 735M', | ||
'267 - NVIDIA GeForce 825M', | ||
'269 - AMD FirePro M4000', | ||
'276 - AMD Radeon R7 M260X', | ||
'279 - NVIDIA GeForce GT 730M', | ||
'282 - AMD FirePro M4100', | ||
'285 - AMD Radeon R7 M270', | ||
'286 - AMD Radeon R7 M265', | ||
'290 - NVIDIA GeForce GT 640M', | ||
'291 - AMD Radeon R7 (Carrizo)', | ||
'292 - AMD Radeon R7 (Kaveri)', | ||
'293 - AMD Radeon R8 M365DX', | ||
'294 - AMD Radeon R7 M460', | ||
'297 - AMD Radeon R7 M360', | ||
'299 - NVIDIA GeForce 920M', | ||
'302 - AMD Radeon R8 M445DX', | ||
'303 - AMD Radeon R7 M440', | ||
'309 - AMD Radeon R7 M260', | ||
'310 - AMD Radeon R7 M340', | ||
'311 - AMD Radeon 520', | ||
'312 - AMD Radeon R6 M340DX', | ||
'313 - AMD Radeon RX Vega 6', | ||
'314 - Intel UHD Graphics 630', | ||
'315 - Intel HD Graphics 630', | ||
'316 - Intel HD Graphics P630', | ||
'317 - Intel HD Graphics 530', | ||
'318 - Intel HD Graphics P530', | ||
'320 - AMD Radeon R5 (Bristol Ridge)', | ||
'321 - Intel UHD Graphics 620', | ||
'322 - Intel HD Graphics 620', | ||
'323 - AMD Radeon R6 (Carrizo)', | ||
'335 - AMD Radeon R6 (Kaveri)', | ||
'344 - AMD FirePro W2100', | ||
'354 - Intel HD Graphics 5600', | ||
'361 - AMD Radeon R6 M255DX', | ||
'362 - AMD Radeon HD 7660D', | ||
'364 - NVIDIA Quadro K1000M', | ||
'380 - AMD Radeon HD 8650G', | ||
'386 - AMD Radeon HD 7560D', | ||
'388 - AMD Radeon R5 M335', | ||
'389 - AMD Radeon R5 M330', | ||
'390 - AMD Radeon R5 M430', | ||
'391 - AMD Radeon R5 M255', | ||
'393 - NVIDIA GeForce 910M', | ||
'394 - NVIDIA GeForce 820M', | ||
'395 - AMD Radeon RX Vega 3', | ||
'396 - Intel HD Graphics 520', | ||
'397 - Intel Iris Graphics 6100', | ||
'398 - NVIDIA GeForce GT 720M', | ||
'399 - AMD Radeon R5 (Stoney Ridge)', | ||
'401 - AMD Radeon R5 M240', | ||
'402 - AMD Radeon R5 M320', | ||
'403 - AMD Radeon R5 M230', | ||
'404 - AMD Radeon R5 M315', | ||
'410 - Intel HD Graphics 6000', | ||
'411 - NVIDIA Quadro K610M', | ||
'413 - Intel Iris Graphics 5100', | ||
'415 - AMD Radeon HD 8610G', | ||
'418 - Intel HD Graphics 4600', | ||
'420 - Intel HD Graphics 5500', | ||
'427 - Intel UHD Graphics 615', | ||
'428 - Intel HD Graphics 615', | ||
'429 - AMD Radeon R5 (Carrizo)', | ||
'430 - AMD Radeon R5 (Kaveri)', | ||
'433 - NVIDIA GeForce 710M', | ||
'434 - AMD Radeon HD 7660G', | ||
'437 - Intel HD Graphics 5000', | ||
'453 - AMD Radeon HD 8550G', | ||
'462 - AMD Radeon HD 8470D', | ||
'469 - Intel HD Graphics 515', | ||
'470 - Intel HD Graphics 4400', | ||
'471 - Intel HD Graphics 610', | ||
'472 - Intel HD Graphics 510', | ||
'501 - Intel HD Graphics 5300', | ||
'502 - Intel UHD Graphics 605', | ||
'503 - Intel HD Graphics 505', | ||
'511 - AMD Radeon HD 7480D', | ||
'512 - Intel HD Graphics 4000', | ||
'516 - AMD Radeon R4 (Stoney Ridge)', | ||
'517 - AMD Radeon R4 (Kaveri)', | ||
'518 - Intel HD Graphics (Broadwell)', | ||
'520 - AMD Radeon R5 (Beema/Carrizo-L)', | ||
'521 - AMD Radeon R4 (Beema)', | ||
'522 - AMD Radeon R3 (Mullins/Beema)', | ||
'523 - AMD Radeon R2 (Stoney Ridge)', | ||
'524 - Intel HD Graphics 4200', | ||
'533 - AMD Radeon HD 8450G', | ||
'537 - AMD Radeon HD 8400', | ||
'550 - AMD Radeon HD 8350G', | ||
'551 - AMD Radeon HD 8330', | ||
'552 - Intel UHD Graphics 600', | ||
'553 - Intel HD Graphics 500', | ||
'573 - Intel HD Graphics 405 (Braswell)', | ||
'574 - Intel HD Graphics (Braswell)', | ||
'575 - Intel HD Graphics 400 (Braswell)', | ||
'584 - Intel HD Graphics (Haswell)', | ||
'604 - AMD Radeon R2 (Mullins/Beema/Carrizo-L)', | ||
'605 - Intel HD Graphics (Cherry Trail)', | ||
'607 - AMD Radeon HD 8280', | ||
'615 - AMD Radeon HD 8240', | ||
'616 - AMD Radeon R6 (Mullins)', | ||
'617 - AMD Radeon HD 8250', | ||
'641 - AMD Radeon HD 8210', | ||
'645 - Intel HD Graphics (Ivy Bridge)', | ||
'686 - Intel HD Graphics (Bay Trail)', | ||
'690 - AMD Radeon HD 7340', | ||
'692 - AMD Radeon HD 7310', | ||
'694 - AMD Radeon HD 8180', | ||
'704 - AMD Radeon HD 7290', | ||
]; | ||
export const BENCHMARK_SCORE_MOBILE = [ | ||
'843 - ARM Mali-200', | ||
'842 - Qualcomm Adreno 200', | ||
'841 - PowerVR SGX530', | ||
'840 - PowerVR SGX531', | ||
'839 - PowerVR SGX535', | ||
'838 - Vivante GC800', | ||
'837 - Qualcomm Adreno 203', | ||
'836 - Qualcomm Adreno 205', | ||
'834 - PowerVR SGX540', | ||
'832 - NVIDIA GeForce ULP (Tegra 2)', | ||
'831 - ARM Mali-400 MP', | ||
'830 - ARM Mali-400 MP2', | ||
'829 - Vivante GC1000+ Dual-Core', | ||
'828 - Qualcomm Adreno 220', | ||
'827 - Broadcom VideoCore-IV', | ||
'826 - NVIDIA GeForce ULP (Tegra 3)', | ||
'825 - ARM Mali-400 MP4', | ||
'824 - Vivante GC4000', | ||
'823 - Qualcomm Adreno 225', | ||
'815 - Qualcomm Adreno 302', | ||
'814 - Vivante GC7000UL', | ||
'813 - ARM Mali-T720', | ||
'812 - Qualcomm Adreno 304', | ||
'811 - Qualcomm Adreno 305', | ||
'810 - Qualcomm Adreno 306', | ||
'809 - Qualcomm Adreno 308', | ||
'808 - PowerVR SGX544', | ||
'807 - ARM Mali-T720 MP2', | ||
'806 - PowerVR SGX544MP2', | ||
'805 - PowerVR SGX545', | ||
'802 - PowerVR SGX543MP2', | ||
'792 - PowerVR SGX543MP3', | ||
'784 - ARM Mali-T830 MP1', | ||
'783 - ARM Mali-450 MP4', | ||
'782 - ARM Mali-T720 MP4', | ||
'781 - PowerVR GE8100', | ||
'780 - ARM Mali-T760 MP2', | ||
'779 - Qualcomm Adreno 320', | ||
'778 - ARM Mali-T624', | ||
'777 - PowerVR SGX543MP4', | ||
'750 - ARM Mali-T830 MP2', | ||
'749 - Qualcomm Adreno 405', | ||
'748 - PowerVR G6200', | ||
'747 - NVIDIA GeForce Tegra 4', | ||
'742 - ARM Mali-T604 MP4', | ||
'736 - ARM Mali-T830 MP3', | ||
'735 - ARM Mali-T860 MP2', | ||
'731 - Qualcomm Adreno 505', | ||
'730 - Qualcomm Adreno 506', | ||
'729 - Qualcomm Adreno 508', | ||
'728 - Qualcomm Adreno 509', | ||
'727 - ARM Mali-T628 MP4', | ||
'726 - PowerVR SGX554MP4', | ||
'688 - ARM Mali-T760 MP4', | ||
'687 - ARM Mali-T628 MP6', | ||
'686 - Intel HD Graphics (Bay Trail)', | ||
'685 - PowerVR G6400', | ||
'684 - PowerVR GX6250', | ||
'683 - PowerVR G6430', | ||
'682 - Qualcomm Adreno 330', | ||
'681 - Qualcomm Adreno 510', | ||
'680 - Qualcomm Adreno 512', | ||
'605 - Intel HD Graphics (Cherry Trail)', | ||
'603 - Qualcomm Adreno 418', | ||
'583 - Qualcomm Adreno 420', | ||
'582 - PowerVR GX6450', | ||
'572 - ARM Mali-T880 MP2', | ||
'571 - ARM Mali-T760 MP6', | ||
'539 - ARM Mali-T880 MP4', | ||
'538 - ARM Mali-G72 MP3', | ||
'519 - Qualcomm Adreno 430', | ||
'514 - ARM Mali-G71 MP2', | ||
'513 - ARM Mali-T760 MP8', | ||
'468 - ARM Mali-T880 MP12', | ||
'467 - Apple A9 / PowerVR GT7600', | ||
'466 - NVIDIA Tegra K1 Kepler GPU', | ||
'465 - PowerVR GXA6850', | ||
'464 - Qualcomm Adreno 530', | ||
'426 - ARM Mali-G71 MP8', | ||
'425 - ARM Mali-G72 MP12', | ||
'424 - ARM Mali-G71 MP20', | ||
'423 - ARM Mali-G72 MP18', | ||
'422 - Qualcomm Adreno 540', | ||
'421 - Qualcomm Adreno 630', | ||
'405 - Apple A10 Fusion GPU / PowerVR', | ||
'319 - NVIDIA Tegra X1 Maxwell GPU', | ||
'296 - Apple A9X / PowerVR Series 7XT', | ||
'261 - Apple A10X Fusion GPU / PowerVR', | ||
'260 - Apple A11 Bionic GPU', | ||
'261 - Apple A10X Fusion GPU / PowerVR', | ||
'296 - Apple A9X / PowerVR Series 7XT', | ||
'319 - NVIDIA Tegra X1 Maxwell GPU', | ||
'405 - Apple A10 Fusion GPU / PowerVR', | ||
'421 - Qualcomm Adreno 630', | ||
'422 - Qualcomm Adreno 540', | ||
'423 - ARM Mali-G72 MP18', | ||
'424 - ARM Mali-G71 MP20', | ||
'425 - ARM Mali-G72 MP12', | ||
'426 - ARM Mali-G71 MP8', | ||
'464 - Qualcomm Adreno 530', | ||
'465 - PowerVR GXA6850', | ||
'466 - NVIDIA Tegra K1 Kepler GPU', | ||
'467 - Apple A9 / PowerVR GT7600', | ||
'468 - ARM Mali-T880 MP12', | ||
'513 - ARM Mali-T760 MP8', | ||
'514 - ARM Mali-G71 MP2', | ||
'519 - Qualcomm Adreno 430', | ||
'538 - ARM Mali-G72 MP3', | ||
'539 - ARM Mali-T880 MP4', | ||
'571 - ARM Mali-T760 MP6', | ||
'572 - ARM Mali-T880 MP2', | ||
'582 - PowerVR GX6450', | ||
'583 - Qualcomm Adreno 420', | ||
'603 - Qualcomm Adreno 418', | ||
'605 - Intel HD Graphics (Cherry Trail)', | ||
'680 - Qualcomm Adreno 512', | ||
'681 - Qualcomm Adreno 510', | ||
'682 - Qualcomm Adreno 330', | ||
'683 - PowerVR G6430', | ||
'684 - PowerVR GX6250', | ||
'685 - PowerVR G6400', | ||
'686 - Intel HD Graphics (Bay Trail)', | ||
'687 - ARM Mali-T628 MP6', | ||
'688 - ARM Mali-T760 MP4', | ||
'726 - PowerVR SGX554MP4', | ||
'727 - ARM Mali-T628 MP4', | ||
'728 - Qualcomm Adreno 509', | ||
'729 - Qualcomm Adreno 508', | ||
'730 - Qualcomm Adreno 506', | ||
'731 - Qualcomm Adreno 505', | ||
'735 - ARM Mali-T860 MP2', | ||
'736 - ARM Mali-T830 MP3', | ||
'742 - ARM Mali-T604 MP4', | ||
'747 - NVIDIA GeForce Tegra 4', | ||
'748 - PowerVR G6200', | ||
'749 - Qualcomm Adreno 405', | ||
'750 - ARM Mali-T830 MP2', | ||
'777 - PowerVR SGX543MP4', | ||
'778 - ARM Mali-T624', | ||
'779 - Qualcomm Adreno 320', | ||
'780 - ARM Mali-T760 MP2', | ||
'781 - PowerVR GE8100', | ||
'782 - ARM Mali-T720 MP4', | ||
'783 - ARM Mali-450 MP4', | ||
'784 - ARM Mali-T830 MP1', | ||
'792 - PowerVR SGX543MP3', | ||
'802 - PowerVR SGX543MP2', | ||
'805 - PowerVR SGX545', | ||
'806 - PowerVR SGX544MP2', | ||
'807 - ARM Mali-T720 MP2', | ||
'808 - PowerVR SGX544', | ||
'809 - Qualcomm Adreno 308', | ||
'810 - Qualcomm Adreno 306', | ||
'811 - Qualcomm Adreno 305', | ||
'812 - Qualcomm Adreno 304', | ||
'813 - ARM Mali-T720', | ||
'814 - Vivante GC7000UL', | ||
'815 - Qualcomm Adreno 302', | ||
'823 - Qualcomm Adreno 225', | ||
'824 - Vivante GC4000', | ||
'825 - ARM Mali-400 MP4', | ||
'826 - NVIDIA GeForce ULP (Tegra 3)', | ||
'827 - Broadcom VideoCore-IV', | ||
'828 - Qualcomm Adreno 220', | ||
'829 - Vivante GC1000+ Dual-Core', | ||
'830 - ARM Mali-400 MP2', | ||
'831 - ARM Mali-400 MP', | ||
'832 - NVIDIA GeForce ULP (Tegra 2)', | ||
'834 - PowerVR SGX540', | ||
'836 - Qualcomm Adreno 205', | ||
'837 - Qualcomm Adreno 203', | ||
'838 - Vivante GC800', | ||
'839 - PowerVR SGX535', | ||
'840 - PowerVR SGX531', | ||
'841 - PowerVR SGX530', | ||
'842 - Qualcomm Adreno 200', | ||
'843 - ARM Mali-200', | ||
]; |
347
src/index.js
@@ -8,168 +8,63 @@ // Data | ||
// Utilities | ||
import { isWebGLSupported, getBenchmarkByPercentage } from './utilities'; | ||
import { getWebGLContext, getBenchmarkByPercentage } from './utilities'; | ||
// Device detection | ||
const device = new Device(); | ||
const gl = isWebGLSupported({ | ||
failIfMajorPerformanceCaveat: true, | ||
}); | ||
function cleanEntryString(entryString) { | ||
return entryString | ||
.toLowerCase() // Lowercase all for easier matching | ||
.split('- ')[1] // Remove prelude score (`3 - `) | ||
.split(' /')[0]; // Reduce 'apple a9x / powervr series 7xt' to 'apple a9x' | ||
} | ||
const glExtensionDebugRendererInfo = gl.getExtension('WEBGL_debug_renderer_info'); | ||
function getEntryVersionNumber(entryString) { | ||
return entryString.replace(/[\D]/g, ''); // Grab and concat all digits in the string | ||
} | ||
function getGPUTier(verbose, mobileBenchmarkPercentages, desktopBenchmarkPercentages) { | ||
if (!gl || !glExtensionDebugRendererInfo) { | ||
if (device.mobile || device.tablet) { | ||
return 'GPU_MOBILE_TIER_0'; | ||
} | ||
return 'GPU_DESKTOP_TIER_0'; | ||
function cleanRendererString(rendererString) { | ||
// Strip off ANGLE and Direct3D version | ||
if (rendererString.includes('angle (') && rendererString.includes('direct3d')) { | ||
rendererString = rendererString.replace('angle (', '').split(' direct3d')[0]; | ||
} | ||
// Mobile devices (correct) | ||
// ------------------------ | ||
console.log(rendererString); | ||
// Samsung S9+ | ||
// const renderer = 'Mali-G72'.toLowerCase(); | ||
// // Strip off the GB amount (1060 6gb was being concatenated to 10606 and because of it using the fallback) | ||
if (rendererString.includes('nvidia') && rendererString.includes('gb')) { | ||
rendererString = rendererString.split(/\dgb/)[0]; | ||
} | ||
// Samsung S9 | ||
// const renderer = 'Mali-G72'.toLowerCase(); | ||
return rendererString.toLowerCase(); | ||
} | ||
// Samsung S8 | ||
// const renderer = 'Mali-G71'.toLowerCase(); | ||
export function getGPUTier(options = {}) { | ||
this.mobileBenchmarkPercentages = [15, 35, 30, 20]; | ||
this.desktopBenchmarkPercentages = [15, 35, 30, 20]; | ||
this.forceRendererString = false; | ||
this.forceMobile = false; | ||
// Samsung S8+ | ||
// const renderer = 'Mali-G71'.toLowerCase(); | ||
Object.assign(this, options); | ||
// Samsung Galaxy S7 | ||
// const renderer = 'Mali-T880'.toLowerCase(); | ||
const isMobile = device.mobile || device.tablet || this.forceMobile; | ||
const isDesktop = !isMobile; | ||
// Samsung Galaxy S7 | ||
// const renderer = 'Mali-T760'.toLowerCase(); | ||
let renderer; | ||
// Samsung Galaxy S5 | ||
// const renderer = 'Mali-T628'.toLowerCase(); | ||
if (this.forceRendererString === false) { | ||
const gl = getWebGLContext({ | ||
failIfMajorPerformanceCaveat: true, | ||
}); | ||
// Samsung Galaxy S4 | ||
// const renderer = 'Adreno (TM) 320'.toLowerCase(); | ||
const glExtensionDebugRendererInfo = gl.getExtension('WEBGL_debug_renderer_info'); | ||
// Google Pixel 2 | ||
// const renderer = 'Adreno (TM) 540'.toLowerCase(); | ||
// Google Pixel | ||
// const renderer = 'Adreno (TM) 530'.toLowerCase(); | ||
// Google Pixel XL | ||
// const renderer = 'Adreno (TM) 530'.toLowerCase(); | ||
// Google Nexus 6P | ||
// const renderer = 'Adreno (TM) 430'.toLowerCase(); | ||
// Google Nexus 5X | ||
// const renderer = 'Adreno (TM) 418'.toLowerCase(); | ||
// Google Nexus 6 | ||
// const renderer = 'Adreno (TM) 420'.toLowerCase(); | ||
// Google Nexus 5 | ||
// const renderer = 'Adreno (TM) 330'.toLowerCase(); | ||
// Google Nexus 9 | ||
// const renderer = 'NVIDIA Tegra'.toLowerCase(); | ||
// Google Nexus 7 | ||
// const renderer = 'Adreno (TM) 320'.toLowerCase(); | ||
// LG G5 | ||
// const renderer = 'Adreno (TM) 530'.toLowerCase(); | ||
// Motorola Moto X 2nd Gen | ||
// const renderer = 'Adreno (TM) 330'.toLowerCase(); | ||
// Motorola Moto G 2nd Gen | ||
// const renderer = 'Adreno (TM) 305'.toLowerCase(); | ||
// Motorola G4 | ||
// const renderer = 'Adreno (TM) 405'.toLowerCase(); | ||
// iPhone X | ||
// const renderer = 'Apple A11 GPU'.toLowerCase(); | ||
// iPhone 8 | ||
// const renderer = 'Apple A11 GPU'.toLowerCase(); | ||
// iPhone 8 Plus | ||
// const renderer = 'Apple A11 GPU'.toLowerCase(); | ||
// iPhone SE | ||
// const renderer = 'Apple A9 GPU'.toLowerCase(); | ||
// iPhone 6S Plus | ||
// const renderer = 'Apple A9 GPU'.toLowerCase(); | ||
// iPhone 6S | ||
// const renderer = 'Apple A9 GPU'.toLowerCase(); | ||
// iPad Mini 2 | ||
// const renderer = 'Apple A7 GPU'.toLowerCase(); | ||
// iPad 2017 | ||
// const renderer = 'Apple A9 GPU'.toLowerCase(); | ||
// iPhone 5C | ||
// const renderer = 'PowerVR SGX 543'.toLowerCase(); | ||
// iPhone SE | ||
// const renderer = 'Apple A9 GPU'.toLowerCase(); | ||
// iPad 6th | ||
// const renderer = 'Apple A10 GPU'.toLowerCase(); | ||
// iPad 5th | ||
// const renderer = 'Apple A9 GPU'.toLowerCase(); | ||
// iPad Pro | ||
// const renderer = 'Apple A9X GPU'.toLowerCase(); | ||
// iPad Air 2 | ||
// const renderer = 'Apple A8X GPU'.toLowerCase(); | ||
// iPad Mini 3 | ||
// const renderer = 'Apple A7 GPU'.toLowerCase(); | ||
// iPhone 5S | ||
// const renderer = 'Apple A8 GPU'.toLowerCase(); | ||
// Desktop | ||
// ------- | ||
// const renderer = 'AMD Radeon R9 390X'.toLowerCase(); | ||
// const renderer = 'NVIDIA GeForce GTX 750 Series'.toLowerCase(); | ||
const renderer = glExtensionDebugRendererInfo | ||
&& gl.getParameter(glExtensionDebugRendererInfo.UNMASKED_RENDERER_WEBGL).toLowerCase(); | ||
if (!renderer) { | ||
if (device.mobile || device.tablet) { | ||
return 'GPU_MOBILE_TIER_1'; | ||
} | ||
return 'GPU_DESKTOP_TIER_1'; | ||
renderer = glExtensionDebugRendererInfo | ||
&& gl.getParameter(glExtensionDebugRendererInfo.UNMASKED_RENDERER_WEBGL); | ||
} else { | ||
renderer = this.forceRendererString; | ||
} | ||
const versionNumber = renderer.replace(/[\D]/g, ''); | ||
renderer = cleanRendererString(renderer); | ||
const rendererVersionNumber = renderer.replace(/[\D]/g, ''); | ||
if (verbose) { | ||
console.log(`Found version number: ${versionNumber}`); | ||
} | ||
const mobileBenchmarkTiers = getBenchmarkByPercentage( | ||
BENCHMARK_SCORE_MOBILE, | ||
mobileBenchmarkPercentages, | ||
); | ||
const desktopBenchmarkTiers = getBenchmarkByPercentage( | ||
BENCHMARK_SCORE_DESKTOP, | ||
desktopBenchmarkPercentages, | ||
); | ||
// GPU BLACKLIST | ||
@@ -179,16 +74,26 @@ // - https://wiki.mozilla.org/Blocklisting/Blocked_Graphics_Drivers | ||
// - https://chromium.googlesource.com/chromium/src/gpu/+/master/config/software_rendering_list.json | ||
const GPU_BLACKLIST = /(radeon hd 6970m|radeon hd 6770m|radeon hd 6490m|radeon hd 6630m|radeon hd 6750m|radeon hd 5750|radeon hd 5670|radeon hd 4850|radeon hd 4870|radeon hd 4670|geforce 9400m|geforce 320m|geforce 330m|geforce gt 130|geforce gt 120|geforce gtx 285|geforce 8600|geforce 9600m|geforce 9400m|geforce 8800 gs|geforce 8800 gt|quadro fx 5|quadro fx 4|radeon hd 2600|radeon hd 2400|radeon hd 2600|radeon r9 200|mali-4|mali-3|mali-2)/.test( | ||
const isGPUBlacklisted = /(radeon hd 6970m|radeon hd 6770m|radeon hd 6490m|radeon hd 6630m|radeon hd 6750m|radeon hd 5750|radeon hd 5670|radeon hd 4850|radeon hd 4870|radeon hd 4670|geforce 9400m|geforce 320m|geforce 330m|geforce gt 130|geforce gt 120|geforce gtx 285|geforce 8600|geforce 9600m|geforce 9400m|geforce 8800 gs|geforce 8800 gt|quadro fx 5|quadro fx 4|radeon hd 2600|radeon hd 2400|radeon hd 2600|radeon r9 200|mali-4|mali-3|mali-2)/.test( | ||
renderer, | ||
); | ||
if (GPU_BLACKLIST) { | ||
if (device.mobile || device.tablet) { | ||
return 'GPU_MOBILE_TIER_0'; | ||
if (isGPUBlacklisted) { | ||
if (isMobile) { | ||
return { | ||
tier: 'GPU_MOBILE_TIER_0', | ||
type: 'BLACKLISTED', | ||
}; | ||
} | ||
return 'GPU_DESKTOP_TIER_0'; | ||
return { | ||
tier: 'GPU_DESKTOP_TIER_0', | ||
type: 'BLACKLISTED', | ||
}; | ||
} | ||
if (device.mobile || device.tablet) { | ||
// Mobile | ||
if (isMobile) { | ||
const mobileBenchmark = getBenchmarkByPercentage( | ||
BENCHMARK_SCORE_MOBILE, | ||
this.mobileBenchmarkPercentages, | ||
); | ||
const isRendererAdreno = renderer.includes('adreno'); | ||
@@ -201,15 +106,9 @@ const isRendererApple = renderer.includes('apple'); | ||
let mobileTier; | ||
let tier; | ||
let type; | ||
mobileBenchmarkTiers.some((rawTier, i) => rawTier.some((rawEntry) => { | ||
const entry = rawEntry | ||
.toLowerCase() | ||
// Remove prelude score (`3 - `) | ||
.split('- ')[1] | ||
// Entries like 'apple a9x / powervr series 7xt' give problems | ||
// with the 7 being picked up (resulting in a tier 3 classification of A7 chip which should be tier 1). | ||
.split(' /')[0]; | ||
mobileBenchmark.forEach((benchmarkTier, index) => benchmarkTier.forEach((benchmarkEntry) => { | ||
const entry = cleanEntryString(benchmarkEntry); | ||
const entryVersionNumber = getEntryVersionNumber(entry); | ||
const entryVersion = entry.replace(/[\D]/g, ''); | ||
if ( | ||
@@ -223,8 +122,5 @@ (entry.includes('adreno') && isRendererAdreno) | ||
) { | ||
if (entryVersion.includes(versionNumber)) { | ||
if (verbose) { | ||
console.log(`Match with benchmark entry: ${entry}`); | ||
} | ||
mobileTier = `GPU_MOBILE_TIER_${i}`; | ||
if (entryVersionNumber.includes(rendererVersionNumber)) { | ||
tier = `GPU_MOBILE_TIER_${index}`; | ||
type = `BENCHMARK - ${entry}`; | ||
} | ||
@@ -234,85 +130,52 @@ } | ||
if (mobileTier === undefined) { | ||
if (verbose) { | ||
console.log('Matching GPU tier could not be found, using fallback: GPU_MOBILE_TIER_1'); | ||
} | ||
mobileTier = 'GPU_MOBILE_TIER_1'; | ||
if (!tier) { | ||
tier = 'GPU_MOBILE_TIER_1'; | ||
type = 'FALLBACK'; | ||
} | ||
return mobileTier; | ||
return { | ||
tier, | ||
type, | ||
}; | ||
} | ||
// Desktop | ||
const isRendererIntel = renderer.includes('intel'); | ||
const isRendererAMD = renderer.includes('amd'); | ||
const isRendererNVIDIA = renderer.includes('nvidia'); | ||
let desktopTier; | ||
if (isDesktop) { | ||
const desktopBenchmark = getBenchmarkByPercentage( | ||
BENCHMARK_SCORE_DESKTOP, | ||
this.desktopBenchmarkPercentages, | ||
); | ||
desktopBenchmarkTiers.forEach((rawTier, i) => rawTier.forEach((rawEntry) => { | ||
const entry = rawEntry | ||
.toLowerCase() | ||
// Remove prelude score | ||
.split('- ')[1] | ||
// Entries like 'apple a9x / powervr series 7xt' give problems | ||
// with the 7 being picked up (resulting in a tier 3 classification of A7 chip which should be tier 1). | ||
.split(' /')[0]; | ||
const entryVersion = entry.replace(/[\D]/g, ''); | ||
const isRendererIntel = renderer.includes('intel'); | ||
const isRendererAMD = renderer.includes('amd'); | ||
const isRendererNVIDIA = renderer.includes('nvidia'); | ||
if ( | ||
(entry.includes('intel') && isRendererIntel) | ||
|| (entry.includes('amd') && isRendererAMD) | ||
|| (entry.includes('nvidia') && isRendererNVIDIA) | ||
) { | ||
if (entryVersion.includes(versionNumber)) { | ||
if (verbose) { | ||
console.log(`Match with benchmark entry: ${entry}`); | ||
let tier; | ||
let type; | ||
desktopBenchmark.forEach((benchmarkTier, index) => benchmarkTier.forEach((benchmarkEntry) => { | ||
const entry = cleanEntryString(benchmarkEntry); | ||
const entryVersionNumber = getEntryVersionNumber(entry); | ||
if ( | ||
(entry.includes('intel') && isRendererIntel) | ||
|| (entry.includes('amd') && isRendererAMD) | ||
|| (entry.includes('nvidia') && isRendererNVIDIA) | ||
) { | ||
if (entryVersionNumber.includes(rendererVersionNumber)) { | ||
tier = `GPU_DESKTOP_TIER_${index}`; | ||
type = `BENCHMARK - ${entry}`; | ||
} | ||
desktopTier = `GPU_DESKTOP_TIER_${i}`; | ||
} | ||
} | ||
})); | ||
})); | ||
if (desktopTier === undefined) { | ||
if (verbose) { | ||
console.log('Matching GPU tier could not be found, using fallback: GPU_DESKTOP_TIER_1'); | ||
if (!tier) { | ||
tier = 'GPU_DESKTOP_TIER_1'; | ||
type = 'FALLBACK'; | ||
} | ||
desktopTier = 'GPU_DESKTOP_TIER_1'; | ||
return { | ||
tier, | ||
type, | ||
}; | ||
} | ||
return desktopTier; | ||
} | ||
export function register(options = {}) { | ||
this.verbose = false; | ||
// Benchmark listing is reversed so that if multiple instances of a GPU is found the highest one is used | ||
// Take for example G72, it is reported only as G72 to the browser but can mean G72 MP3, G72 MP12 and G72 MP18. | ||
// It will in this case take the highest tier in order to be future proof (assuming G72 becomes more powerful over time) | ||
// Desktop GPU percentages | ||
// 15% TIER_0 | ||
// 35% TIER_1 | ||
// 30% TIER_2 | ||
// 20% TIER_3 | ||
this.benchmarkTierPercentagesMobile = [15, 35, 30, 20]; | ||
// Mobile GPU percentages | ||
// 15% TIER_0 | ||
// 35% TIER_1 | ||
// 30% TIER_2 | ||
// 20% TIER_3 | ||
this.benchmarkTierPercentagesDesktop = [15, 35, 30, 20]; | ||
Object.assign(this, options); | ||
const GPU_TIER = getGPUTier( | ||
this.verbose, | ||
this.benchmarkTierPercentagesMobile, | ||
this.benchmarkTierPercentagesDesktop, | ||
); | ||
return GPU_TIER; | ||
} |
@@ -1,6 +0,6 @@ | ||
export function isWebGLSupported(attributes) { | ||
export function getWebGLContext(attributes) { | ||
const canvas = document.createElement('canvas'); | ||
const gl = canvas.getContext('webgl', attributes) || canvas.getContext('experimental-webgl', attributes); | ||
if (!gl || !(gl instanceof window.WebGLRenderingContext)) { | ||
if (!gl || !(gl instanceof WebGLRenderingContext)) { | ||
return false; | ||
@@ -15,7 +15,6 @@ } | ||
let chunkOffset = 0; | ||
const reversedBenchmark = benchmark.reverse(); | ||
const benchmarkTiers = percentages.map((percentage) => { | ||
const chunkSize = Math.round((reversedBenchmark.length / 100) * percentage); | ||
const chunk = reversedBenchmark.slice(chunkOffset, chunkOffset + chunkSize); | ||
const chunkSize = Math.round((benchmark.length / 100) * percentage); | ||
const chunk = benchmark.slice(chunkOffset, chunkOffset + chunkSize); | ||
@@ -22,0 +21,0 @@ chunkOffset += chunkSize; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
345222
22
1498
75
4
16
4
2
+ Addedcsvtojson@^2.0.8
+ Addedbluebird@3.7.2(transitive)
+ Addedcsvtojson@2.0.10(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addedgrowl@1.10.5(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedjssoup@0.0.9(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedms@2.0.0(transitive)
+ Addedstrip-bom@2.0.0(transitive)
- Removedjssoup@0.0.8(transitive)
Updatedjssoup@^0.0.9