Skip to content

Clarify .getBindGroupLayout() behavior #5559

@teoxoy

Description

@teoxoy

Current spec wording:

Image

I'm not sure what is meant by "Initialize layout so it is a copy of this.layout.bindGroupLayouts[index]." because entries in bindGroupLayouts can be GPUBindGroupLayout or null.

Relevant PRs:

Looking at #5042 what seems intended is to return an empty BGL when encountering a null in bindGroupLayouts.

This is a small improvement found while implementing the "empty BGLs are equivalent to null" in Dawn. Basically any BGL in the pipeline is fine to query, even once past what's specified in the pipeline layout, because it's as if they are null/empty.

from #5042 (comment)

One rather minor consequence of #4946 is that the label on empty BGLs passed to createPipelineLayout is effectively discarded since they get replaced with null entries in bindGroupLayouts. It might be worth adding this as a note.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIapi resolvedResolved - waiting for a change to the API specificationbug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions