device.pushErrorScope("validation");
let sampler = device.createSampler({
maxAnisotropy: 0, // Invalid, maxAnisotropy must be at least 1.
});
device.popErrorScope().then((error) => {
if (error) {
// error is a GPUValidationError object instance
sampler = null;
console.error(`An error occurred while creating sampler: ${error.message}`);
}
});GPUValidationError / notebook
GPUValidationError
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.