Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. GPUPipelineError

GPUPipelineError

Limited availability

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

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

Note: This feature is available inWeb Workers.

TheGPUPipelineError interface of theWebGPU API describes a pipeline failure. This is the value received when aPromise returned by aGPUDevice.createComputePipelineAsync() orGPUDevice.createRenderPipelineAsync() call rejects.

DOMException GPUPipelineError

Constructor

GPUPipelineError()

Creates a newGPUPipelineError object instance.

Instance properties

Inherits properties from its parent,DOMException.

reasonRead 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 aGPUComputePipeline usingGPUDevice.createComputePipelineAsync(). However, we have misspelt our compute pipelineentryPoint as"maijn" (it should be"main"), therefore pipeline creation fails, and ourcatch 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 givenreason is"Validation", and themessage is"Entry point "maijn" doesn't exist in the shader module [ShaderModule]."

Specifications

Specification
WebGPU
# gpupipelineerror

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp