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

Should invalid combinations of storage texture formats and access generate a WGSL error #4728

@greggman

Description

@greggman

tangentially related to #4711

These generate WGSL errors

@group(0) @binding(0) var tex: texture_storage_2d<rg32float, read>;
@group(0) @binding(1) var tex: texture_storage_2d<rg32sint, read>;
@group(0) @binding(2) var tex: texture_storage_2d<rg32uint, read>;

We decided at the last meeting that this should too

@group(0) @binding(0) var tex: texture_storage_2d<bgra8unorm, read>;

Should these also generate WGSL errors?

@group(0) @binding(0) var tex1: texture_storage_2d<rgba8unorm, read_write>;
@group(0) @binding(1) var tex2: texture_storage_2d<rgba16sint, read_write>;
@group(0) @binding(2) var tex3: texture_storage_2d<rgba32float, read_write>;
...etc...

read_write access is only allowed with r32uint, r32sint, r32float. This seems the same category of error as the ones at the top. Currently this is only validated at bind group creation time. If the bind group layout requires "read-write" but the format doesn't support read-write then you get an error. But the WGSL shader module creation step doesn't generate an error. Should it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    potentially breakingCould require a breaking change to the APIwgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions