Skip to content

WGSL: Support the pointer_composite_access language extension #6192

Closed
@rcoreilly

Description

Description

The WGSL spec has a requires directive to request language extensions, such as pointer_composite_access https://www.w3.org/TR/WGSL/#language-extensions-sec

When I put that at the top of my .wgsl shader, it barfs:

[wgpu] [Error] Device::create_shader_module error: 
Shader 'squares' parsing error: expected global item ('struct', 'const', 'var', 'alias', ';', 'fn') or the end of the file, found 'requires'
  ┌─ wgsl:2:1
  │
2 │ requires pointer_composite_access;
  │ ^^^^^^^^ expected global item ('struct', 'const', 'var', 'alias', ';', 'fn') or the end of the file

I would particularly be interested in when that specific language extension pointer_composite_access will be included as well -- huge improvement in usability. Also unrestricted_pointer_parameters seems rather important if I understand it properly, which I'm not sure I do..

Repro steps
add that line to the top of any .wgsl code.

Expected vs observed behavior

didn't work.

Platform

Mac OS, latest trunk HEAD 26398ea using naga cli, and v0.19.4.1 of wgpu-native.

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions