device.pushErrorScope("internal");
let module = device.createShaderModule({
code: shader, // REALLY complex shader
});
device.popErrorScope().then((error) => {
if (error) {
// error is a GPUInternalError object instance
module = null;
console.error(`An error occurred while creating shader: ${error.message}`);
}
});GPUInternalError / notebook
GPUInternalError
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.