files/en-us/web/api/gpupipelinelayout/index.md
{{APIRef("WebGPU API")}}{{SecureContext_Header}}{{AvailableInWorkers}}
The GPUPipelineLayout interface of the {{domxref("WebGPU API", "WebGPU API", "", "nocode")}} defines the {{domxref("GPUBindGroupLayout")}}s used by a pipeline. {{domxref("GPUBindGroup")}}s used with the pipeline during command encoding must have compatible {{domxref("GPUBindGroupLayout")}}s.
A GPUPipelineLayout object instance is created using the {{domxref("GPUDevice.createPipelineLayout()")}} method.
{{InheritanceDiagram}}
[!NOTE] The WebGPU samples feature many more examples.
The following snippet:
GPUPipelineLayout based on the {{domxref("GPUBindGroupLayout")}}.// …
const bindGroupLayout = device.createBindGroupLayout({
entries: [
{
binding: 0,
visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT,
buffer: {},
},
{
binding: 1,
visibility: GPUShaderStage.FRAGMENT,
texture: {},
},
{
binding: 2,
visibility: GPUShaderStage.FRAGMENT,
sampler: {},
},
],
});
const pipelineLayout = device.createPipelineLayout({
bindGroupLayouts: [bindGroupLayout],
});
// …
{{Specifications}}
{{Compat}}