createComputePipeline method
A pipeline from a compute stage of this device's shader library.
Implementation
@override
ComputePipelineHandle createComputePipeline(ShaderHandle shader) {
final stage = shader.backend;
if (stage is! WebGpuComputeShader) {
throw ArgumentError.value(
shader.name,
'shader',
'is not a compute stage on this device',
);
}
return ComputePipelineHandle(
backend: guard(
'the compute pipeline for ${shader.name}',
() => webgpuCreateComputePipeline(gpuDevice, stage),
),
shader: shader,
);
}