Skip to content

PipelineLayoutDescriptor: make elements in bind_group_layouts optional #7985

@reima

Description

@reima

Is your feature request related to a problem? Please describe.
Sometimes it is convenient to "skip" bind groups in a pipeline (see gpuweb/gpuweb#2043). PiplineLayoutDescriptor::bind_group_layouts does not allow skipping bind groups. The corresponding WebGPU type GPUPipelineLayoutDescriptor enables this by allowing null elements in bindGroupLayouts.

Describe the solution you'd like
Change the type of PipelineLayoutDescriptor::bind_group_layouts to &'a [Option<&'a BindGroupLayout>]. The semantics of None values should be the same as null in WebGPU.

Describe alternatives you've considered
What already works is supplying an "empty" bind group layout (without any entries) where a None is desired in the pipeline layout descriptor, and setting an "empty" bind group (without any entries) in the render pass.

Additional context
WebGPU has allowed null in GPUPipelineLayoutDescriptor.bindGroupLayouts since the Working Draft, 5 November 2024.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions