Support WGSL const-expressions and override-expressions in Naga
Categories
(Core :: Graphics: WebGPU, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox127 | --- | fixed |
People
(Reporter: jimb, Assigned: teoxoy)
References
(Blocks 3 open bugs)
Details
Attachments
(1 file)
To implement v1 of the WebGPU spec, Naga needs to support WGSL const-expressions and override-expressions.
The WGSL spec permits expressions in many places that require a value known at shader module creation time or pipeline creation time. These are limited to "const-expressions", which don't depend on variables, buffer contents, etc, or "override-expressions", which are like const-expressions but can also refer to override constants, whose values are supplied at pipeline creation time.
| Assignee | ||
Comment 1•2 years ago
|
||
Upstream meta issue: https://github.com/gfx-rs/naga/issues/2274
Updated•2 years ago
|
Updated•2 years ago
|
Comment 2•2 years ago
•
|
||
This is currently known to block the following demos from webgpu-v1-samples particularly with local const variables (upstream Naga issue: https://github.com/gfx-rs/naga/issues/2316):
deferredRenderingimageBlurreversedZshadowMappingvideoUploadingWebCodecs
| Reporter | ||
Comment 3•2 years ago
•
|
||
Upstream for const declarations: https://github.com/gfx-rs/naga/issues/2316
Upsteram for override declarations: https://github.com/gfx-rs/naga/issues/1426
Updated•2 years ago
|
Comment 4•2 years ago
|
||
I noticed that some shaders at https://compute.toys are failing because of this issue, i.e., https://compute.toys/view/153.
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 6•2 years ago
|
||
const-expressions landed upstream in https://github.com/gfx-rs/naga/pull/2266 & https://github.com/gfx-rs/naga/pull/2309.
This work will be brought in by https://bugzilla.mozilla.org/show_bug.cgi?id=1859999.
| Reporter | ||
Updated•1 year ago
|
Comment 7•1 year ago
|
||
Oh, derp, sorry, wrong bug link! This is the most recent re-vendoring that should unblock overrides. 🙂
| Assignee | ||
Comment 8•1 year ago
|
||
Comment 10•1 year ago
|
||
| bugherder | ||
Description
•