GPUPipelineError

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

The GPUPipelineError interface of the WebGPU API describes a pipeline failure. This is the value received when a Promise returned by a GPUDevice.createComputePipelineAsync() or GPUDevice.createRenderPipelineAsync() call rejects.

DOMException GPUPipelineError

Constructor

GPUPipelineError() Experimental

Creates a new GPUPipelineError object instance.

Instance properties

Inherits properties from its parent, DOMException.

reason Experimental Read only

An enumerated value that defines the reason the pipeline creation failed in a machine-readable way.

Examples

In the following snippet we are attempting to create a GPUComputePipeline using GPUDevice.createComputePipelineAsync(). However, we have misspelt our compute pipeline entryPoint as "maijn" (it should be "main"), therefore pipeline creation fails, and our catch block prints the resulting reason and error message to the console.

js
// ...

let computePipeline;

try {
  computePipeline = await device.createComputePipelineAsync({
    layout: device.createPipelineLayout({
      bindGroupLayouts: [bindGroupLayout],
    }),
    compute: {
      module: shaderModule,
      entryPoint: "maijn",
    },
  });
} catch (error) {
  // error is a GPUPipelineError object instance
  console.error(error.reason);
  console.error(`Pipeline creation failed: ${error.message}`);
}

// ...

In this case, the given reason is "Validation", and the message is "Entry point "maijn" doesn't exist in the shader module [ShaderModule]."

Specifications

Specification
WebGPU
# gpupipelineerror

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
GPUPipelineError
Experimental
GPUPipelineError() constructor
Experimental
message parameter is optional
Experimental
reason
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
In development. Supported in a pre-release version.
In development. Supported in a pre-release version.
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.

See also