Skip to content

BindGroupLayout dedupe can lead to confusing error messages #7862

@tychedelia

Description

@tychedelia

Description

We encountered a confusing error while debugging a bind group compatibility issue:

The BindGroupLayout with 'StandardMaterial' label of current set BindGroup with 'StandardMaterial' label at index 3 is not compatible with the corresponding BindGroupLayout with 'prepass_empty_layout' label of RenderPipeline with 'with 'opaque_mesh_pipeline' label

The error referenced prepass_empty_layout, which exists in our codebase but is never actually used and relates to an entirely different render phase and logical bind group. This led us to investigate pipeline layouts and render pipeline configuration, assuming there was an architectural issue. When we removed the unused layout code, the error started referencing a completely different, equally irrelevant empty layout.

The real issue was much simpler -- we were retrieving the wrong bind group from our cache. However, because layout deduplication causes empty layouts to share the same internal object, error messages randomly reference whichever label happens to be associated with the deduplicated layout, rather than the one actually involved in the compatibility failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions