Firefox Tomorrow

web api interface

GPUComputePipeline

View on MDN ↗

Secure contextAvailable in workers

The GPUComputePipeline interface of the WebGPU API represents a pipeline that controls the compute shader stage and can be used in a GPUComputePassEncoder.

A GPUComputePipeline object instance can be created using the createComputePipeline() or createComputePipelineAsync() methods.

Instance properties

  • label
    • : A string providing a label that can be used to identify the object, for example in GPUError messages or console warnings.

Instance methods

Examples

[!NOTE] The WebGPU samples feature many more examples.

Basic example

Our basic compute demo shows a process of:

// …

const bindGroupLayout = device.createBindGroupLayout({
  entries: [
    {
      binding: 0,
      visibility: GPUShaderStage.COMPUTE,
      buffer: {
        type: "storage",
      },
    },
  ],
});

const computePipeline = device.createComputePipeline({
  layout: device.createPipelineLayout({
    bindGroupLayouts: [bindGroupLayout],
  }),
  compute: {
    module: shaderModule,
    entryPoint: "main",
  },
});

// …

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also