Created
July 11, 2014 00:18
-
-
Save bsy/d4379adeb7b0837bd6a2 to your computer and use it in GitHub Desktop.
Obtain GPU card info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var canvas = document.createElement('canvas'); | |
canvas.setAttribute("id", "gltestcanvas"); | |
gl = null; | |
try { | |
// Try to grab the standard context. If it fails, fallback to experimental. | |
gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl"); | |
} | |
catch(e) { | |
console.warn(e); | |
} | |
if (gl) { | |
var ext = gl.getExtension('WEBGL_debug_renderer_info'); | |
if(ext) { | |
console.log(gl.getParameter(ext.UNMASKED_RENDERER_WEBGL)); | |
LYT.GoogleAnalytics.trackEvent("WebApp", "GLInfo", {label: "GPU", value: gl.getParameter(ext.UNMASKED_RENDERER_WEBGL)}); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment