Skip to content

Instantly share code, notes, and snippets.

@markbrouch
Created January 14, 2021 16:15
Show Gist options
  • Save markbrouch/f1f634514f34ada0aa9e8971775128e4 to your computer and use it in GitHub Desktop.
Save markbrouch/f1f634514f34ada0aa9e8971775128e4 to your computer and use it in GitHub Desktop.
WebGL debug info
const webgl = document.createElement('canvas').getContext('webgl');
const webgl2 = document.createElement('canvas').getContext('webgl2');
const contexts = [webgl, webgl2];
contexts.forEach(gl => {
const debugRendererInfo = gl.getExtension('WEBGL_debug_renderer_info');
console.log('renderer:', gl.getParameter(debugRendererInfo.UNMASKED_RENDERER_WEBGL));
console.log('vendor:', gl.getParameter(debugRendererInfo.UNMASKED_VENDOR_WEBGL));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment