Skip to content

Instantly share code, notes, and snippets.

@Frankie-B
Forked from markbrouch/webgl-debug.js
Created March 12, 2023 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Frankie-B/14e6ae80bba3e757a199df4fcc5f3746 to your computer and use it in GitHub Desktop.
Save Frankie-B/14e6ae80bba3e757a199df4fcc5f3746 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