detect-gpu
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -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 M1000M","150 - NVIDIA Quadro M620","151 - AMD Radeon R9 M280X","152 - AMD Radeon RX Vega 11","157 - NVIDIA GeForce 945M","158 - NVIDIA GeForce GTX 765M","162 - NVIDIA Quadro K4000M","163 - AMD Radeon RX Vega 10","164 - Intel Iris Pro Graphics P580","165 - Intel Iris Pro Graphics 580","170 - AMD Radeon R9 M470","172 - AMD Radeon R9 M380","181 - NVIDIA Quadro K3100M","182 - AMD FirePro W5170M","183 - AMD Radeon R9 M370X","186 - NVIDIA GeForce GTX 760M","187 - AMD Radeon R9 M275","189 - NVIDIA Maxwell GPU Surface Book (940M, GDDR5)","190 - AMD FirePro W5130M","196 - NVIDIA Quadro K3000M","198 - AMD FirePro M6000","199 - AMD FirePro M5100","200 - NVIDIA Quadro K2100M","205 - AMD Radeon R7 250","206 - NVIDIA GeForce GT 755M","208 - NVIDIA GeForce 845M","211 - AMD Radeon R9 M265X","213 - AMD Radeon R7 M465","215 - AMD FirePro W4170M","216 - AMD FirePro W4100","221 - NVIDIA GeForce GT 750M","222 - Intel Iris Pro Graphics 6200","223 - NVIDIA Quadro M520","224 - NVIDIA GeForce MX130","225 - NVIDIA GeForce 940MX","226 - NVIDIA Quadro K1100M","227 - AMD Radeon RX Vega 8","228 - NVIDIA GeForce 940M","229 - NVIDIA GeForce 930MX","230 - NVIDIA Quadro M600M","231 - AMD FirePro W4190M","232 - AMD Radeon R9 M375","233 - AMD Radeon R7 M445","235 - AMD Radeon R7 M370","238 - NVIDIA Quadro M500M","239 - NVIDIA GeForce 840M","240 - AMD Radeon R7 M275DX","241 - NVIDIA GeForce GT 745M","244 - AMD Radeon R7 (Bristol Ridge)","245 - AMD Radeon R7 512 Cores (Kaveri Desktop)","246 - Intel Iris Pro Graphics 5200","247 - AMD Radeon R7 384 Cores (Kaveri Desktop)","248 - NVIDIA GeForce GT 740M","249 - Intel Iris Plus Graphics 650","250 - Intel Iris Plus Graphics 655","251 - NVIDIA GeForce 930M","252 - Intel Iris Graphics 550","253 - AMD Radeon 530","254 - NVIDIA GeForce 830M","255 - NVIDIA GeForce MX110","256 - Intel Iris Plus Graphics 640","257 - NVIDIA GeForce 920MX","258 - Intel Iris Graphics 540","261 - NVIDIA Quadro K2000M","264 - NVIDIA GeForce GT 735M","266 - NVIDIA GeForce 825M","268 - AMD FirePro M4000","275 - AMD Radeon R7 M260X","278 - NVIDIA GeForce GT 730M","281 - AMD FirePro M4100","284 - AMD Radeon R7 M270","285 - AMD Radeon R7 M265","289 - NVIDIA GeForce GT 640M","290 - AMD Radeon R7 (Carrizo)","291 - AMD Radeon R7 (Kaveri)","292 - AMD Radeon R8 M365DX","293 - AMD Radeon R7 M460","296 - AMD Radeon R7 M360","298 - NVIDIA GeForce 920M","301 - AMD Radeon R8 M445DX","302 - AMD Radeon R7 M440","308 - AMD Radeon R7 M260","309 - AMD Radeon R7 M340","310 - AMD Radeon 520","311 - AMD Radeon R6 M340DX","312 - AMD Radeon RX Vega 6","313 - Intel UHD Graphics 630","314 - Intel HD Graphics 630","315 - Intel HD Graphics P630","316 - Intel HD Graphics 530","317 - Intel HD Graphics P530","319 - AMD Radeon R5 (Bristol Ridge)","320 - Intel UHD Graphics 620","321 - Intel HD Graphics 620","322 - AMD Radeon R6 (Carrizo)","334 - AMD Radeon R6 (Kaveri)","343 - AMD FirePro W2100","353 - Intel HD Graphics 5600","360 - AMD Radeon R6 M255DX","361 - AMD Radeon HD 7660D","363 - NVIDIA Quadro K1000M","379 - AMD Radeon HD 8650G","385 - AMD Radeon HD 7560D","387 - AMD Radeon R5 M335","388 - AMD Radeon R5 M330","389 - AMD Radeon R5 M430","390 - AMD Radeon R5 M255","392 - NVIDIA GeForce 910M","393 - NVIDIA GeForce 820M","394 - AMD Radeon RX Vega 3","395 - Intel HD Graphics 520","396 - Intel Iris Graphics 6100","397 - NVIDIA GeForce GT 720M","398 - AMD Radeon R5 (Stoney Ridge)","400 - AMD Radeon R5 M240","401 - AMD Radeon R5 M320","402 - AMD Radeon R5 M230","403 - AMD Radeon R5 M315","409 - Intel HD Graphics 6000","410 - NVIDIA Quadro K610M","412 - Intel Iris Graphics 5100","414 - AMD Radeon HD 8610G","417 - Intel HD Graphics 4600","419 - Intel HD Graphics 5500","426 - 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=["259 - Apple A11 Bionic GPU","260 - Apple A10X Fusion GPU / PowerVR","295 - Apple A9X / PowerVR Series 7XT","318 - NVIDIA Tegra X1 Maxwell GPU","404 - Apple A10 Fusion GPU / PowerVR","420 - Qualcomm Adreno 630","421 - Qualcomm Adreno 540","422 - ARM Mali-G72 MP18","423 - ARM Mali-G71 MP20","424 - ARM Mali-G72 MP12","425 - 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:"fxos",get:function(){return(this.match("(mobile;")||this.match("(tablet;"))&&this.match("; rv:")}},{key:"fxosPhone",get:function(){return this.fxos&&this.match("mobile")}},{key:"fxosTablet",get:function(){return this.fxos&&this.match("tablet")}},{key:"meego",get:function(){return this.match("meego")}},{key:"mobile",get:function(){return this.androidPhone||this.iphone||this.ipod||this.windowsPhone||this.blackberryPhone||this.fxosPhone||this.meego}},{key:"tablet",get:function(){return this.ipad||this.androidTablet||this.blackberryTablet||this.windowsTablet||this.fxosTablet}}]),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 l});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},A=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}(),c=d.getExtension("WEBGL_debug_renderer_info"),I=c&&d.getParameter(c.UNMASKED_RENDERER_WEBGL).toLowerCase(),R=parseInt(I.replace(/[\D]/g,""),10);function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return D(this,e),this.BENCHMARK_TIER_PERCENTAGES_MOBILE=[15,35,30,20],this.BENCHMARK_TIER_PERCENTAGES_DESKTOP=[15,35,30,20],function(e,o){var r=M(a,e),t=M(n,o),i=/(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(I);if(!d||i)return A.mobile||A.tablet?"GPU_MOBILE_TIER_0":"GPU_DESKTOP_TIER_0";if(!I)return A.mobile||A.tablet?"GPU_MOBILE_TIER_1":"GPU_DESKTOP_TIER_1";if(A.mobile||A.tablet){var D=I.includes("adreno"),c=I.includes("apple"),l=I.includes("mali")&&!I.includes("mali-t"),s=I.includes("mali-t"),G=I.includes("nvidia"),u=I.includes("powervr"),h=void 0;return r.some(function(e,o){return e.some(function(e){var r=e.toLowerCase().split("- ")[1].split("/")[0];(r.includes("adreno")&&D||r.includes("apple")&&c||r.includes("mali")&&!r.includes("mali-t")&&l||r.includes("mali-t")&&s||r.includes("nvidia")&&G||r.includes("powervr")&&u)&&r.includes(R)&&(h="GPU_MOBILE_TIER_"+o)})}),void 0===h&&(console.log("Matching GPU tier could not be found, using fallback: GPU_MOBILE_TIER_1"),h="GPU_MOBILE_TIER_1"),h}var p=I.includes("intel"),V=I.includes("amd"),P=I.includes("nvidia"),m=void 0;return t.forEach(function(e,o){return e.forEach(function(e){var r=e.toLowerCase().split("- ")[1].split("/")[0];(r.includes("intel")&&p||r.includes("amd")&&V||r.includes("nvidia")&&P)&&r.includes(R)&&(m="GPU_DESKTOP_TIER_"+o)})}),void 0===m&&(console.log("Matching GPU tier could not be found, using fallback: GPU_DESKTOP_TIER_1"),m="GPU_DESKTOP_TIER_1"),m}(this.BENCHMARK_TIER_PERCENTAGES_MOBILE,this.BENCHMARK_TIER_PERCENTAGES_DESKTOP)}}])}); | ||
!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 M1000M","150 - NVIDIA Quadro M620","151 - AMD Radeon R9 M280X","152 - AMD Radeon RX Vega 11","157 - NVIDIA GeForce 945M","158 - NVIDIA GeForce GTX 765M","162 - NVIDIA Quadro K4000M","163 - AMD Radeon RX Vega 10","164 - Intel Iris Pro Graphics P580","165 - Intel Iris Pro Graphics 580","170 - AMD Radeon R9 M470","172 - AMD Radeon R9 M380","181 - NVIDIA Quadro K3100M","182 - AMD FirePro W5170M","183 - AMD Radeon R9 M370X","186 - NVIDIA GeForce GTX 760M","187 - AMD Radeon R9 M275","189 - NVIDIA Maxwell GPU Surface Book (940M, GDDR5)","190 - AMD FirePro W5130M","196 - NVIDIA Quadro K3000M","198 - AMD FirePro M6000","199 - AMD FirePro M5100","200 - NVIDIA Quadro K2100M","205 - AMD Radeon R7 250","206 - NVIDIA GeForce GT 755M","208 - NVIDIA GeForce 845M","211 - AMD Radeon R9 M265X","213 - AMD Radeon R7 M465","215 - AMD FirePro W4170M","216 - AMD FirePro W4100","221 - NVIDIA GeForce GT 750M","222 - Intel Iris Pro Graphics 6200","223 - NVIDIA Quadro M520","224 - NVIDIA GeForce MX130","225 - NVIDIA GeForce 940MX","226 - NVIDIA Quadro K1100M","227 - AMD Radeon RX Vega 8","228 - NVIDIA GeForce 940M","229 - NVIDIA GeForce 930MX","230 - NVIDIA Quadro M600M","231 - AMD FirePro W4190M","232 - AMD Radeon R9 M375","233 - AMD Radeon R7 M445","235 - AMD Radeon R7 M370","238 - NVIDIA Quadro M500M","239 - NVIDIA GeForce 840M","240 - AMD Radeon R7 M275DX","241 - NVIDIA GeForce GT 745M","244 - AMD Radeon R7 (Bristol Ridge)","245 - AMD Radeon R7 512 Cores (Kaveri Desktop)","246 - Intel Iris Pro Graphics 5200","247 - AMD Radeon R7 384 Cores (Kaveri Desktop)","248 - NVIDIA GeForce GT 740M","249 - Intel Iris Plus Graphics 650","250 - Intel Iris Plus Graphics 655","251 - NVIDIA GeForce 930M","252 - Intel Iris Graphics 550","253 - AMD Radeon 530","254 - NVIDIA GeForce 830M","255 - NVIDIA GeForce MX110","256 - Intel Iris Plus Graphics 640","257 - NVIDIA GeForce 920MX","258 - Intel Iris Graphics 540","261 - NVIDIA Quadro K2000M","264 - NVIDIA GeForce GT 735M","266 - NVIDIA GeForce 825M","268 - AMD FirePro M4000","275 - AMD Radeon R7 M260X","278 - NVIDIA GeForce GT 730M","281 - AMD FirePro M4100","284 - AMD Radeon R7 M270","285 - AMD Radeon R7 M265","289 - NVIDIA GeForce GT 640M","290 - AMD Radeon R7 (Carrizo)","291 - AMD Radeon R7 (Kaveri)","292 - AMD Radeon R8 M365DX","293 - AMD Radeon R7 M460","296 - AMD Radeon R7 M360","298 - NVIDIA GeForce 920M","301 - AMD Radeon R8 M445DX","302 - AMD Radeon R7 M440","308 - AMD Radeon R7 M260","309 - AMD Radeon R7 M340","310 - AMD Radeon 520","311 - AMD Radeon R6 M340DX","312 - AMD Radeon RX Vega 6","313 - Intel UHD Graphics 630","314 - Intel HD Graphics 630","315 - Intel HD Graphics P630","316 - Intel HD Graphics 530","317 - Intel HD Graphics P530","319 - AMD Radeon R5 (Bristol Ridge)","320 - Intel UHD Graphics 620","321 - Intel HD Graphics 620","322 - AMD Radeon R6 (Carrizo)","334 - AMD Radeon R6 (Kaveri)","343 - AMD FirePro W2100","353 - Intel HD Graphics 5600","360 - AMD Radeon R6 M255DX","361 - AMD Radeon HD 7660D","363 - NVIDIA Quadro K1000M","379 - AMD Radeon HD 8650G","385 - AMD Radeon HD 7560D","387 - AMD Radeon R5 M335","388 - AMD Radeon R5 M330","389 - AMD Radeon R5 M430","390 - AMD Radeon R5 M255","392 - NVIDIA GeForce 910M","393 - NVIDIA GeForce 820M","394 - AMD Radeon RX Vega 3","395 - Intel HD Graphics 520","396 - Intel Iris Graphics 6100","397 - NVIDIA GeForce GT 720M","398 - AMD Radeon R5 (Stoney Ridge)","400 - AMD Radeon R5 M240","401 - AMD Radeon R5 M320","402 - AMD Radeon R5 M230","403 - AMD Radeon R5 M315","409 - Intel HD Graphics 6000","410 - NVIDIA Quadro K610M","412 - Intel Iris Graphics 5100","414 - AMD Radeon HD 8610G","417 - Intel HD Graphics 4600","419 - Intel HD Graphics 5500","426 - 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=["259 - Apple A11 Bionic GPU","260 - Apple A10X Fusion GPU / PowerVR","295 - Apple A9X / PowerVR Series 7XT","318 - NVIDIA Tegra X1 Maxwell GPU","404 - Apple A10 Fusion GPU / PowerVR","420 - Qualcomm Adreno 630","421 - Qualcomm Adreno 540","422 - ARM Mali-G72 MP18","423 - ARM Mali-G71 MP20","424 - ARM Mali-G72 MP12","425 - 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:"fxos",get:function(){return(this.match("(mobile;")||this.match("(tablet;"))&&this.match("; rv:")}},{key:"fxosPhone",get:function(){return this.fxos&&this.match("mobile")}},{key:"fxosTablet",get:function(){return this.fxos&&this.match("tablet")}},{key:"meego",get:function(){return this.match("meego")}},{key:"mobile",get:function(){return this.androidPhone||this.iphone||this.ipod||this.windowsPhone||this.blackberryPhone||this.fxosPhone||this.meego}},{key:"tablet",get:function(){return this.ipad||this.androidTablet||this.blackberryTablet||this.windowsTablet||this.fxosTablet}}]),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 l});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},d=new i,c=function(e){var o=document.createElement("canvas"),r=o.getContext("webgl",e)||o.getContext("experimental-webgl",e);return!!(r&&r instanceof window.WebGLRenderingContext)&&r}(),A=c.getExtension("WEBGL_debug_renderer_info"),I=A&&c.getParameter(A.UNMASKED_RENDERER_WEBGL).toLowerCase(),R=parseInt(I.replace(/[\D]/g,""),10);function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return D(this,e),this.benchmarkTierPercentagesMobile=[15,35,30,20],this.benchmarkTierPercentagesDesktop=[15,35,30,20],function(e,o){var r=M(a,e),t=M(n,o),i=/(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(I);if(!c||i)return d.mobile||d.tablet?"GPU_MOBILE_TIER_0":"GPU_DESKTOP_TIER_0";if(!I)return d.mobile||d.tablet?"GPU_MOBILE_TIER_1":"GPU_DESKTOP_TIER_1";if(d.mobile||d.tablet){var D=I.includes("adreno"),A=I.includes("apple"),l=I.includes("mali")&&!I.includes("mali-t"),s=I.includes("mali-t"),G=I.includes("nvidia"),u=I.includes("powervr"),h=void 0;return r.some(function(e,o){return e.some(function(e){var r=e.toLowerCase().split("- ")[1].split("/")[0];(r.includes("adreno")&&D||r.includes("apple")&&A||r.includes("mali")&&!r.includes("mali-t")&&l||r.includes("mali-t")&&s||r.includes("nvidia")&&G||r.includes("powervr")&&u)&&r.includes(R)&&(h="GPU_MOBILE_TIER_"+o)})}),void 0===h&&(console.log("Matching GPU tier could not be found, using fallback: GPU_MOBILE_TIER_1"),h="GPU_MOBILE_TIER_1"),h}var p=I.includes("intel"),V=I.includes("amd"),P=I.includes("nvidia"),m=void 0;return t.forEach(function(e,o){return e.forEach(function(e){var r=e.toLowerCase().split("- ")[1].split("/")[0];(r.includes("intel")&&p||r.includes("amd")&&V||r.includes("nvidia")&&P)&&r.includes(R)&&(m="GPU_DESKTOP_TIER_"+o)})}),void 0===m&&(console.log("Matching GPU tier could not be found, using fallback: GPU_DESKTOP_TIER_1"),m="GPU_DESKTOP_TIER_1"),m}(this.benchmarkTierPercentagesMobile,this.benchmarkTierPercentagesDesktop)}}])}); |
{ | ||
"name": "detect-gpu", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Classify GPU's based on their benchmark score in order to provide an adaptive experience.", | ||
@@ -5,0 +5,0 @@ "main": "dist/detect-gpu.js", |
@@ -37,4 +37,4 @@ # Detect GPU | ||
// [TIER_0, TIER_1, TIER_2, TIER_3] | ||
BENCHMARK_TIER_PERCENTAGES_MOBILE: [15, 35, 30, 20], | ||
BENCHMARK_TIER_PERCENTAGES_DESKTOP: [15, 35, 30, 20] | ||
benchmarkTierPercentagesMobile: [15, 35, 30, 20], | ||
benchmarkTierPercentagesDesktop: [15, 35, 30, 20] | ||
}); | ||
@@ -41,0 +41,0 @@ ``` |
@@ -17,23 +17,2 @@ // Data | ||
// Blacklisted GPU | ||
// const renderer = 'radeon hd 6970m'; | ||
// Example GTX 1080 Ti | ||
// const renderer = 'NVIDIA GeForce GTX 1080 Ti (Desktop)'.toLowerCase(); | ||
// S6 | ||
// const renderer = 'Mali-T760'.toLowerCase(); | ||
// S8 | ||
// const renderer = 'Mali-G72'.toLowerCase(); | ||
// Pixel 2 | ||
// const renderer = 'Adreno (TM) 540'.toLowerCase(); | ||
// iPhone 5s | ||
// const renderer = 'WebGL 1.0 (OpenGL ES 2.0 Apple A8 GPU - 50.6.11)'.toLowerCase(); | ||
// iPhone 6S | ||
// const renderer = 'Apple A7 GPU'.toLowerCase(); | ||
function getGPUTier(mobileBenchmarkPercentages, desktopBenchmarkPercentages) { | ||
@@ -164,3 +143,3 @@ const mobileBenchmarkTiers = getBenchmarkByPercentage( | ||
// 20% TIER_3 | ||
this.BENCHMARK_TIER_PERCENTAGES_MOBILE = [15, 35, 30, 20]; | ||
this.benchmarkTierPercentagesMobile = [15, 35, 30, 20]; | ||
@@ -172,7 +151,7 @@ // Mobile GPU percentages | ||
// 20% TIER_3 | ||
this.BENCHMARK_TIER_PERCENTAGES_DESKTOP = [15, 35, 30, 20]; | ||
this.benchmarkTierPercentagesDesktop = [15, 35, 30, 20]; | ||
const GPU_TIER = getGPUTier( | ||
this.BENCHMARK_TIER_PERCENTAGES_MOBILE, | ||
this.BENCHMARK_TIER_PERCENTAGES_DESKTOP, | ||
this.benchmarkTierPercentagesMobile, | ||
this.benchmarkTierPercentagesDesktop, | ||
); | ||
@@ -179,0 +158,0 @@ |
@@ -13,3 +13,2 @@ export function isWebGLSupported(attributes) { | ||
// Get benchmark entry's by percentage of the total benchmark entries | ||
// This is used for effectively future-proofing new GPU's | ||
export function getBenchmarkByPercentage(benchmark, percentages) { | ||
@@ -19,3 +18,3 @@ let chunkOffset = 0; | ||
const BENCHMARK_TIERS = percentages.map((percentage) => { | ||
const benchmarkTiers = percentages.map((percentage) => { | ||
const chunkSize = Math.round((reversedBenchmark.length / 100) * percentage); | ||
@@ -29,3 +28,3 @@ const chunk = reversedBenchmark.slice(chunkOffset, chunkOffset + chunkSize); | ||
return BENCHMARK_TIERS; | ||
return benchmarkTiers; | ||
} |
Sorry, the diff of this file is too big to display
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
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
258788
1098