Skip to content

Multiple bindings with different sizes are erroneously rejected #7359

@andyleiserson

Description

@andyleiserson

This failure is distilled from https://bugzilla.mozilla.org/show_bug.cgi?id=1850202. I have a standalone test case which I will submit shortly. The test case is: cargo nextest run -- gpu-test -- wgpu_gpu_test::bind_groups::multiple_bindings_with_different_sizes.

The conditions for the failure are:

  • Two bind groups are created, for two shaders, within the same compute pass.
  • The bind groups are created against the same bind group layout.
  • The bindings have different sizes.

The failure symptom is:

thread '<unnamed>' panicked at wgpu/src/backend/wgpu_core.rs:2828:26:
wgpu error: Validation Error

Caused by:
  In ComputePass::end
    In a dispatch command, indirect:false
      Buffer is bound with size 4 where the shader expects 8 in group[0] compact index 0

The binding sizes are correct for the shaders they target, so unless there is something illegal about creating these bindings against the same layout, the rejection is erroneous. Even if this case is not legal, the error message could be improved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions