Skip to content

Instantly share code, notes, and snippets.

@NickDeckerDevs
Created March 20, 2025 17:14
Show Gist options
  • Save NickDeckerDevs/0ea0669084f9cfa64bcd7914db04330d to your computer and use it in GitHub Desktop.
Save NickDeckerDevs/0ea0669084f9cfa64bcd7914db04330d to your computer and use it in GitHub Desktop.
const canvas = document.createElement("canvas");
const gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
if (gl) {
const debugInfo = gl.getExtension("WEBGL_debug_renderer_info");
if (debugInfo) {
const renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
console.log("WebGL renderer:", renderer);
// If renderer string contains "SwiftShader" or "Software", hardware acceleration may be disabled.
} else {
console.log("WEBGL_debug_renderer_info not available.");
}
} else {
console.log("WebGL not supported.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment