-
-
Save artmsv/902fd1c8e02d41624c13b54f19a56a17 to your computer and use it in GitHub Desktop.
use JavaScript to detect GPU used from within your browser
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
| 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); | |
| } | |
| // Sample output: | |
| // | |
| // » console.log(renderer); | |
| // ATI Technologies Inc. AMD Radeon R9 M370X OpenGL Engine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment