gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.18k stars 896 forks source link

Implement `unrestricted_pointer_parameters` wgsl extension #5158

Open guusw opened 7 months ago

guusw commented 7 months ago

I tried searching a bit but could find out which is correct/outdated, some previous comments seem to mention that pointers to storage are illegal however I couldn't find anything about it in the spec (if so, please point me to it, thanks)

From the spec https://www.w3.org/TR/WGSL/#example-eab7f633

fn baz2(p : ptr<storage, f32>) {
}

which seems to not be accepted by naga:

Function [1] 'baz2' is invalid:
        Argument 'p' at index 0 is a pointer of space Storage { access: StorageAccess(LOAD) }, which can't be passed into functions.
teoxoy commented 7 months ago

We haven't yet implemented the unrestricted_pointer_parameters WGSL language extension.

Alphapage commented 2 months ago

Any news about this crucial feature ? When do you plan to release the unrestricted_pointer_parameters WGSL language extension ? Is there a way to bypass the limitation ?