Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept only {f,i,u}32s when in strict WebGPU compliance #7017

Open
ErichDonGubler opened this issue Jan 28, 2025 · 0 comments
Open

Accept only {f,i,u}32s when in strict WebGPU compliance #7017

ErichDonGubler opened this issue Jan 28, 2025 · 0 comments
Labels
area: correctness We're behaving incorrectly area: ecosystem Help the connected projects grow and prosper area: validation Issues related to validation, diagnostics, and error handling kind: diagnostics Error message should be better type: bug Something isn't working

Comments

@ErichDonGubler
Copy link
Member

Description

While writing #7016, I noticed that the diagnostic there stated that f64 and bool are accepted sampled types. That's great!…except that they shouldn't be allowed on strictly WebGPU-compliant environments. Section 6.5.2 of the WebGPU spec. states (in relation to sampled texture types):

The texture is parameterized by a sampled type and must be f32, i32, or u32.

Remedying this might require a new native-only feature, though one might already exist that I'm not aware of.

Repro steps

  1. Run naga-cli on the following:

    @group(0) @binding(0) var texture: texture_2d<rgba32float>;

    Observe that it prints the following:

    Could not parse WGSL:
    error: unknown scalar type: `rgba32float`
      ┌─ ../in.wgsl:1:47
      │
    1 │ @group(0) @binding(0) var texture: texture_2d<rgba32float>;
      │                                               ^^^^^^^^^^^ unknown scalar type
      │
      = note: Valid scalar types are f32, f64, i32, u32, bool
    

Expected vs observed behavior

The set of "valid scalar types" (which could stand to be called "sampled types" instead) should f32, i32, and u32 when only the feature flags in wgpu::Features::all_webgpu_mask is set.

@ErichDonGubler ErichDonGubler added area: correctness We're behaving incorrectly area: ecosystem Help the connected projects grow and prosper area: validation Issues related to validation, diagnostics, and error handling kind: diagnostics Error message should be better type: bug Something isn't working labels Jan 28, 2025
@jimblandy jimblandy changed the title Only accept {f,i,u}32s when in strict WebGPU compliance Accept only {f,i,u}32s when in strict WebGPU compliance Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: correctness We're behaving incorrectly area: ecosystem Help the connected projects grow and prosper area: validation Issues related to validation, diagnostics, and error handling kind: diagnostics Error message should be better type: bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

1 participant