detect-gpu
Advanced tools
Comparing version 0.0.20 to 0.0.21
@@ -131,3 +131,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
"use strict"; | ||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // Data\n\n\n// Device\n\n\n// Utilities\n\n\nexports.getGPUTier = getGPUTier;\n\nvar _benchmark = __webpack_require__(/*! ./benchmark */ \"./benchmark.js\");\n\nvar _device = __webpack_require__(/*! ./device */ \"./device.js\");\n\nvar _device2 = _interopRequireDefault(_device);\n\nvar _utilities = __webpack_require__(/*! ./utilities */ \"./utilities.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Device detection\nvar device = new _device2.default();\n\nfunction cleanEntryString(entryString) {\n return entryString.toLowerCase() // Lowercase all for easier matching\n .split('- ')[1] // Remove prelude score (`3 - `)\n .split(' /')[0]; // Reduce 'apple a9x / powervr series 7xt' to 'apple a9x'\n}\n\nfunction getEntryVersionNumber(entryString) {\n return entryString.replace(/[\\D]/g, ''); // Grab and concat all digits in the string\n}\n\nfunction cleanRendererString(rendererString) {\n // Strip off ANGLE and Direct3D version\n if (rendererString.includes('angle (') && rendererString.includes('direct3d')) {\n rendererString = rendererString.replace('angle (', '').split(' direct3d')[0];\n }\n\n // // Strip off the GB amount (1060 6gb was being concatenated to 10606 and because of it using the fallback)\n if (rendererString.includes('nvidia') && rendererString.includes('gb')) {\n rendererString = rendererString.split(/\\dgb/)[0];\n }\n\n return rendererString.toLowerCase();\n}\n\nfunction getGPUTier() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this.mobileBenchmarkPercentages = [15, 35, 30, 20];\n this.desktopBenchmarkPercentages = [15, 35, 30, 20];\n this.forceRendererString = false;\n this.forceMobile = false;\n\n _extends(this, options);\n\n var isMobile = device.mobile || device.tablet || this.forceMobile;\n var isDesktop = !isMobile;\n\n var renderer = void 0;\n\n if (this.forceRendererString === false) {\n var gl = (0, _utilities.getWebGLContext)({\n failIfMajorPerformanceCaveat: true\n });\n\n var glExtensionDebugRendererInfo = gl.getExtension('WEBGL_debug_renderer_info');\n\n renderer = glExtensionDebugRendererInfo && gl.getParameter(glExtensionDebugRendererInfo.UNMASKED_RENDERER_WEBGL);\n } else {\n renderer = this.forceRendererString;\n }\n\n renderer = cleanRendererString(renderer);\n var rendererVersionNumber = renderer.replace(/[\\D]/g, '');\n\n // GPU BLACKLIST\n // - https://wiki.mozilla.org/Blocklisting/Blocked_Graphics_Drivers\n // - https://www.khronos.org/webgl/wiki/BlacklistsAndWhitelists\n // - https://chromium.googlesource.com/chromium/src/gpu/+/master/config/software_rendering_list.json\n var 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);\n\n if (isGPUBlacklisted) {\n if (isMobile) {\n return {\n tier: 'GPU_MOBILE_TIER_0',\n type: 'BLACKLISTED'\n };\n }\n\n return {\n tier: 'GPU_DESKTOP_TIER_0',\n type: 'BLACKLISTED'\n };\n }\n\n if (isMobile) {\n var mobileBenchmark = (0, _utilities.getBenchmarkByPercentage)(_benchmark.BENCHMARK_SCORE_MOBILE, this.mobileBenchmarkPercentages);\n\n var isRendererAdreno = renderer.includes('adreno');\n var isRendererApple = renderer.includes('apple');\n var isRendererMali = renderer.includes('mali') && !renderer.includes('mali-t');\n var isRendererMaliT = renderer.includes('mali-t');\n var isRendererNVIDIA = renderer.includes('nvidia');\n var isRendererPowerVR = renderer.includes('powervr');\n\n var tier = void 0;\n var type = void 0;\n\n mobileBenchmark.forEach(function (benchmarkTier, index) {\n return benchmarkTier.forEach(function (benchmarkEntry) {\n var entry = cleanEntryString(benchmarkEntry);\n var entryVersionNumber = getEntryVersionNumber(entry);\n\n if (entry.includes('adreno') && isRendererAdreno || entry.includes('apple') && isRendererApple || entry.includes('mali') && !entry.includes('mali-t') && isRendererMali || entry.includes('mali-t') && isRendererMaliT || entry.includes('nvidia') && isRendererNVIDIA || entry.includes('powervr') && isRendererPowerVR) {\n if (entryVersionNumber.includes(rendererVersionNumber)) {\n tier = 'GPU_MOBILE_TIER_' + index;\n type = 'BENCHMARK - ' + entry;\n }\n }\n });\n });\n\n if (!tier) {\n tier = 'GPU_MOBILE_TIER_1';\n type = 'FALLBACK';\n }\n\n return {\n tier: tier,\n type: type\n };\n }\n\n if (isDesktop) {\n var desktopBenchmark = (0, _utilities.getBenchmarkByPercentage)(_benchmark.BENCHMARK_SCORE_DESKTOP, this.desktopBenchmarkPercentages);\n\n var isRendererIntel = renderer.includes('intel');\n var isRendererAMD = renderer.includes('amd');\n var _isRendererNVIDIA = renderer.includes('nvidia');\n\n var _tier = void 0;\n var _type = void 0;\n\n desktopBenchmark.forEach(function (benchmarkTier, index) {\n return benchmarkTier.forEach(function (benchmarkEntry) {\n var entry = cleanEntryString(benchmarkEntry);\n var entryVersionNumber = getEntryVersionNumber(entry);\n\n if (entry.includes('intel') && isRendererIntel || entry.includes('amd') && isRendererAMD || entry.includes('nvidia') && _isRendererNVIDIA) {\n if (entryVersionNumber.includes(rendererVersionNumber)) {\n _tier = 'GPU_DESKTOP_TIER_' + index;\n _type = 'BENCHMARK - ' + entry;\n }\n }\n });\n });\n\n if (!_tier) {\n _tier = 'GPU_DESKTOP_TIER_1';\n _type = 'FALLBACK';\n }\n\n return {\n tier: _tier,\n type: _type\n };\n }\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9pbmRleC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0RldGVjdEdQVS9zcmMvaW5kZXguanM/MTJkNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBEYXRhXG5pbXBvcnQgeyBCRU5DSE1BUktfU0NPUkVfREVTS1RPUCwgQkVOQ0hNQVJLX1NDT1JFX01PQklMRSB9IGZyb20gJy4vYmVuY2htYXJrJztcblxuLy8gRGV2aWNlXG5pbXBvcnQgRGV2aWNlIGZyb20gJy4vZGV2aWNlJztcblxuLy8gVXRpbGl0aWVzXG5pbXBvcnQgeyBnZXRXZWJHTENvbnRleHQsIGdldEJlbmNobWFya0J5UGVyY2VudGFnZSB9IGZyb20gJy4vdXRpbGl0aWVzJztcblxuLy8gRGV2aWNlIGRldGVjdGlvblxuY29uc3QgZGV2aWNlID0gbmV3IERldmljZSgpO1xuXG5mdW5jdGlvbiBjbGVhbkVudHJ5U3RyaW5nKGVudHJ5U3RyaW5nKSB7XG4gIHJldHVybiBlbnRyeVN0cmluZ1xuICAgIC50b0xvd2VyQ2FzZSgpIC8vIExvd2VyY2FzZSBhbGwgZm9yIGVhc2llciBtYXRjaGluZ1xuICAgIC5zcGxpdCgnLSAnKVsxXSAvLyBSZW1vdmUgcHJlbHVkZSBzY29yZSAoYDMgLSBgKVxuICAgIC5zcGxpdCgnIC8nKVswXTsgLy8gUmVkdWNlICdhcHBsZSBhOXggLyBwb3dlcnZyIHNlcmllcyA3eHQnIHRvICdhcHBsZSBhOXgnXG59XG5cbmZ1bmN0aW9uIGdldEVudHJ5VmVyc2lvbk51bWJlcihlbnRyeVN0cmluZykge1xuICByZXR1cm4gZW50cnlTdHJpbmcucmVwbGFjZSgvW1xcRF0vZywgJycpOyAvLyBHcmFiIGFuZCBjb25jYXQgYWxsIGRpZ2l0cyBpbiB0aGUgc3RyaW5nXG59XG5cbmZ1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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFRQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFqQkE7QUFDQTtBQWtCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFkQTtBQUNBO0FBZUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBSUE7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./index.js\n"); | ||
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // Data\n\n\n// Device\n\n\n// Utilities\n\n\nexports.getGPUTier = getGPUTier;\n\nvar _benchmark = __webpack_require__(/*! ./benchmark */ \"./benchmark.js\");\n\nvar _device = __webpack_require__(/*! ./device */ \"./device.js\");\n\nvar _device2 = _interopRequireDefault(_device);\n\nvar _utilities = __webpack_require__(/*! ./utilities */ \"./utilities.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Device detection\nvar device = new _device2.default();\n\nfunction cleanEntryString(entryString) {\n return entryString.toLowerCase() // Lowercase all for easier matching\n .split('- ')[1] // Remove prelude score (`3 - `)\n .split(' /')[0]; // Reduce 'apple a9x / powervr series 7xt' to 'apple a9x'\n}\n\nfunction getEntryVersionNumber(entryString) {\n return entryString.replace(/[\\D]/g, ''); // Grab and concat all digits in the string\n}\n\nfunction cleanRendererString(rendererString) {\n // Strip off ANGLE and Direct3D version\n if (rendererString.includes('angle (') && rendererString.includes('direct3d')) {\n rendererString = rendererString.replace('angle (', '').split(' direct3d')[0];\n }\n\n // // Strip off the GB amount (1060 6gb was being concatenated to 10606 and because of it using the fallback)\n if (rendererString.includes('nvidia') && rendererString.includes('gb')) {\n rendererString = rendererString.split(/\\dgb/)[0];\n }\n\n return rendererString.toLowerCase();\n}\n\nfunction getGPUTier() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this.mobileBenchmarkPercentages = [15, 35, 30, 20];\n this.desktopBenchmarkPercentages = [15, 35, 30, 20];\n this.forceRendererString = false;\n this.forceMobile = false;\n\n _extends(this, options);\n\n var isMobile = device.mobile || device.tablet || this.forceMobile;\n var isDesktop = !isMobile;\n\n var renderer = void 0;\n\n if (this.forceRendererString === false) {\n var gl = (0, _utilities.getWebGLContext)({\n failIfMajorPerformanceCaveat: true\n });\n\n var glExtensionDebugRendererInfo = gl.getExtension('WEBGL_debug_renderer_info');\n\n renderer = glExtensionDebugRendererInfo && gl.getParameter(glExtensionDebugRendererInfo.UNMASKED_RENDERER_WEBGL);\n } else {\n renderer = this.forceRendererString;\n }\n\n // WebGL support is missing\n if (!renderer) {\n return {\n tier: 'GPU_MOBILE_TIER_0',\n type: 'WEBGL_UNSUPPORTED'\n };\n }\n\n renderer = cleanRendererString(renderer);\n var rendererVersionNumber = renderer.replace(/[\\D]/g, '');\n\n // GPU BLACKLIST\n // - https://wiki.mozilla.org/Blocklisting/Blocked_Graphics_Drivers\n // - https://www.khronos.org/webgl/wiki/BlacklistsAndWhitelists\n // - https://chromium.googlesource.com/chromium/src/gpu/+/master/config/software_rendering_list.json\n var 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);\n\n if (isGPUBlacklisted) {\n if (isMobile) {\n return {\n tier: 'GPU_MOBILE_TIER_0',\n type: 'BLACKLISTED'\n };\n }\n\n return {\n tier: 'GPU_DESKTOP_TIER_0',\n type: 'BLACKLISTED'\n };\n }\n\n if (isMobile) {\n var mobileBenchmark = (0, _utilities.getBenchmarkByPercentage)(_benchmark.BENCHMARK_SCORE_MOBILE, this.mobileBenchmarkPercentages);\n\n var isRendererAdreno = renderer.includes('adreno');\n var isRendererApple = renderer.includes('apple');\n var isRendererMali = renderer.includes('mali') && !renderer.includes('mali-t');\n var isRendererMaliT = renderer.includes('mali-t');\n var isRendererNVIDIA = renderer.includes('nvidia');\n var isRendererPowerVR = renderer.includes('powervr');\n\n var tier = void 0;\n var type = void 0;\n\n mobileBenchmark.forEach(function (benchmarkTier, index) {\n return benchmarkTier.forEach(function (benchmarkEntry) {\n var entry = cleanEntryString(benchmarkEntry);\n var entryVersionNumber = getEntryVersionNumber(entry);\n\n if (entry.includes('adreno') && isRendererAdreno || entry.includes('apple') && isRendererApple || entry.includes('mali') && !entry.includes('mali-t') && isRendererMali || entry.includes('mali-t') && isRendererMaliT || entry.includes('nvidia') && isRendererNVIDIA || entry.includes('powervr') && isRendererPowerVR) {\n if (entryVersionNumber.includes(rendererVersionNumber)) {\n tier = 'GPU_MOBILE_TIER_' + index;\n type = 'BENCHMARK - ' + entry;\n }\n }\n });\n });\n\n if (!tier) {\n tier = 'GPU_MOBILE_TIER_1';\n type = 'FALLBACK';\n }\n\n return {\n tier: tier,\n type: type\n };\n }\n\n if (isDesktop) {\n var desktopBenchmark = (0, _utilities.getBenchmarkByPercentage)(_benchmark.BENCHMARK_SCORE_DESKTOP, this.desktopBenchmarkPercentages);\n\n var isRendererIntel = renderer.includes('intel');\n var isRendererAMD = renderer.includes('amd');\n var _isRendererNVIDIA = renderer.includes('nvidia');\n\n var _tier = void 0;\n var _type = void 0;\n\n desktopBenchmark.forEach(function (benchmarkTier, index) {\n return benchmarkTier.forEach(function (benchmarkEntry) {\n var entry = cleanEntryString(benchmarkEntry);\n var entryVersionNumber = getEntryVersionNumber(entry);\n\n if (entry.includes('intel') && isRendererIntel || entry.includes('amd') && isRendererAMD || entry.includes('nvidia') && _isRendererNVIDIA) {\n if (entryVersionNumber.includes(rendererVersionNumber)) {\n _tier = 'GPU_DESKTOP_TIER_' + index;\n _type = 'BENCHMARK - ' + entry;\n }\n }\n });\n });\n\n if (!_tier) {\n _tier = 'GPU_DESKTOP_TIER_1';\n _type = 'FALLBACK';\n }\n\n return {\n tier: _tier,\n type: _type\n };\n }\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9pbmRleC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL0RldGVjdEdQVS9zcmMvaW5kZXguanM/MTJkNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBEYXRhXG5pbXBvcnQgeyBCRU5DSE1BUktfU0NPUkVfREVTS1RPUCwgQkVOQ0hNQVJLX1NDT1JFX01PQklMRSB9IGZyb20gJy4vYmVuY2htYXJrJztcblxuLy8gRGV2aWNlXG5pbXBvcnQgRGV2aWNlIGZyb20gJy4vZGV2aWNlJztcblxuLy8gVXRpbGl0aWVzXG5pbXBvcnQgeyBnZXRXZWJHTENvbnRleHQsIGdldEJlbmNobWFya0J5UGVyY2VudGFnZSB9IGZyb20gJy4vdXRpbGl0aWVzJztcblxuLy8gRGV2aWNlIGRldGVjdGlvblxuY29uc3QgZGV2aWNlID0gbmV3IERldmljZSgpO1xuXG5mdW5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BQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQWRBO0FBQ0E7QUFlQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFJQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./index.js\n"); | ||
@@ -134,0 +134,0 @@ /***/ }), |
@@ -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";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]);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=d(e),n=c(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=d(e),n=c(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 d(e){return e.toLowerCase().split("- ")[1].split(" /")[0]}function c(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})}}])}); | ||
!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;if(!t)return{tier:"GPU_MOBILE_TIER_0",type:"WEBGL_UNSUPPORTED"};var I=(t=function(e){e.includes("angle (")&&e.includes("direct3d")&&(e=e.replace("angle (","").split(" direct3d")[0]);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"),P=void 0,V=void 0;return R.forEach(function(e,o){return e.forEach(function(e){var r=d(e),n=c(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)&&(P="GPU_MOBILE_TIER_"+o,V="BENCHMARK - "+r)})}),P||(P="GPU_MOBILE_TIER_1",V="FALLBACK"),{tier:P,type:V}}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=d(e),n=c(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 d(e){return e.toLowerCase().split("- ")[1].split(" /")[0]}function c(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.20", | ||
"version": "0.0.21", | ||
"description": "Classify GPU's based on their benchmark score in order to provide an adaptive experience.", | ||
@@ -25,3 +25,3 @@ "main": "dist/detect-gpu.js", | ||
"babel-preset-env": "^1.7.0", | ||
"concurrently": "^3.6.1", | ||
"concurrently": "^4.0.0", | ||
"eslint": "^5.1.0", | ||
@@ -28,0 +28,0 @@ "eslint-config-airbnb-base": "^13.0.0", |
@@ -47,6 +47,7 @@ # Detect GPU | ||
```js | ||
const GPUTier = DetectGPU.register({ | ||
verbose: true, // enable logging to the console | ||
benchmarkTierPercentagesMobile: [15, 35, 30, 20], // [TIER_0, TIER_1, TIER_2, TIER_3] | ||
benchmarkTierPercentagesDesktop: [15, 35, 30, 20] // [TIER_0, TIER_1, TIER_2, TIER_3] | ||
const GPUTier = DetectGPU.getGPUTier({ | ||
mobileBenchmarkPercentages: [15, 35, 30, 20], // [TIER_0, TIER_1, TIER_2, TIER_3] | ||
desktopBenchmarkPercentages: [15, 35, 30, 20], // [TIER_0, TIER_1, TIER_2, TIER_3] | ||
forceRendererString: "Apple A11 GPU", // (Development) Force a certain renderer string | ||
forceMobile: true // (Development) Force the use of mobile benchmarking scores | ||
}); | ||
@@ -68,2 +69,4 @@ ``` | ||
$ npm run parse-analytics | ||
$ npm run update-benchmarks | ||
@@ -77,1 +80,3 @@ ``` | ||
`detect-gpu` uses both mobile and desktop benchmarking scores from [https://www.notebookcheck.net/](https://www.notebookcheck.net/). | ||
The unmasked renderers have been gathered using the analytics script that one can find in `scripts/analytics_embed.js`. |
@@ -64,2 +64,10 @@ // Data | ||
// WebGL support is missing | ||
if (!renderer) { | ||
return { | ||
tier: 'GPU_MOBILE_TIER_0', | ||
type: 'WEBGL_UNSUPPORTED', | ||
}; | ||
} | ||
renderer = cleanRendererString(renderer); | ||
@@ -66,0 +74,0 @@ const rendererVersionNumber = renderer.replace(/[\D]/g, ''); |
@@ -28,2 +28,9 @@ // Application | ||
test(`${deviceType} -> GPUTier returns a benchmark entry`, () => { | ||
if (GPUTier.type === 'WEBGL_UNSUPPORTED') { | ||
console.warn( | ||
`WEBGL_UNSUPPORTED -> Entry: ${rendererEntry}, Tier: ${GPUTier.tier}, Type: ${ | ||
GPUTier.type | ||
}`, | ||
); | ||
} | ||
if (GPUTier.type === 'BLACKLISTED') { | ||
@@ -30,0 +37,0 @@ console.warn( |
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
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
348600
1536
80