这是indexloc提供的服务,不要输入任何密码
Skip to content

Validation rules for WGSL modules: binding collisions #889

@kvark

Description

@kvark

We want to do shader translation at createShaderModule time, so we need to ensure that the WGSL module is valid to start with. So the first question is whether we are going to have the formal validation rules for WGSL modules.

The second question, derived from the first, is whether we allow binding collisions in this validation:

[[set = 0, binding = 1]] Texture1D<f32> MyTexture1;
[[set = 0, binding = 1]] Texture2D<u32> MyTexture2;
[[set = 0, binding = 1]] Texture3D<i32> MyTexture3;

Background: this question stems from #573 and the fact SPIR-V doesn't separate between comparison and regular samplers at the declaration level. If we want to be able to translate the whole SPIR-V module into WGSL, we'll need to allow binding collisions for WGSL module validation.

Alternatives considered: don't validate WGSL module as a whole, only validate specific entry points at pipeline creation time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issueswgsl resolvedResolved - waiting for a change to the WGSL specification

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions