Atlaslog
Atlaslog / luma.gl / API reference / ComputePipeline
luma.gl · API reference

ComputePipeline

Quick answer

ComputePipeline is a compiled compute shader bound to an entry point, created by device.createComputePipeline({shader, entryPoint}). It has no vertex inputs or color attachments, and all data arrives through bindings. Build it once, cache it, and record a ComputePass for each dispatch.

Last verified 2026-11-03 · luma.gl 9.4 · Cite this page
device. createComputePipeline ({ shader, entryPoint }) → ComputePipeline
Key points
Example
const wgsl = `
@group(0) @binding(0) var<storage, read_write> values: array<f32>;

@compute @workgroup_size(64)
fn main(@builtin(global_invocation_id) id: vec3<u32>) {
  let i = id.x;
  if (i < arrayLength(&values)) {
    values[i] = values[i] * 2.0;
  }
}
`;

const cs = device.createShader({
  stage: 'compute',
  language: 'wgsl',
  source: wgsl
});

const pipeline = device.createComputePipeline({
  shader: cs,
  entryPoint: 'main'
});
if (device.type !== 'webgpu') {
  console.warn('当前后端不支持计算管线');
}
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). ComputePipeline. https://www.jingweizhi.com/en/lumagl/api/compute-pipeline.html (accessed 2026-11-03).