Skip to content

Instantly share code, notes, and snippets.

@oboshto
Forked from cvan/webgl-detect-gpu.js
Created May 22, 2017 12:03
Show Gist options
  • Save oboshto/abd1414811a30bda3b02dc4112c44a71 to your computer and use it in GitHub Desktop.
Save oboshto/abd1414811a30bda3b02dc4112c44a71 to your computer and use it in GitHub Desktop.
var canvas = document.createElement('canvas');
var gl;
var debugInfo;
var vendor;
var renderer;
try {
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
} catch (e) {
}
if (gl) {
debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
vendor = gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL);
renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
}
console.log(debugInfo, vendor, renderer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment