Skip to content

Instantly share code, notes, and snippets.

@ayamflow
Last active January 12, 2021 08:25
Show Gist options
  • Save ayamflow/c8f41a493d459b2151b05eeca9a5b8d9 to your computer and use it in GitHub Desktop.
Save ayamflow/c8f41a493d459b2151b05eeca9a5b8d9 to your computer and use it in GitHub Desktop.
GPU infos
// https://stackoverflow.com/questions/31775686/is-there-a-way-to-know-anything-about-hardware-resources-of-platform-accessing/31896597#31896597
// https://stackoverflow.com/questions/15464896/get-cpu-gpu-memory-information
var canvas = document.createElement('canvas')
var gl = canvas.getContext('experimental-webgl');
var params = [gl.RENDERER, gl.VENDOR, gl.VERSION, gl.SHADING_LANGUAGE_VERSION];
var infos = gl.getExtension('WEBGL_debug_renderer_info');
params.push(infos.UNMASKED_RENDERER_WEBGL, infos.UNMASKED_VENDOR_WEBGL);
params.forEach(function(param) {
console.log(gl.getParameter(param))
});
var extensions = gl.getSupportedExtensions();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment