Open Bug 1822096 Opened 1 year ago Updated 20 hours ago

Support WGSL const-expressions and override-expressions in Naga

Categories

(Core :: Graphics: WebGPU, task, P2)

task

Tracking

()

ASSIGNED

People

(Reporter: jimb, Assigned: teoxoy)

References

(Depends on 1 open bug, Blocks 8 open bugs)

Details

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.

Status: NEW → ASSIGNED

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):

  • deferredRendering
  • imageBlur
  • reversedZ
  • shadowMapping
  • videoUploadingWebCodecs

Upstream for const declarations: https://github.com/gfx-rs/naga/issues/2316
Upsteram for override declarations: https://github.com/gfx-rs/naga/issues/1426

I noticed that some shaders at https://compute.toys are failing because of this issue, i.e., https://compute.toys/view/153.

Duplicate of this bug: 1834097
Blocks: 1852491
Blocks: 1852492
Depends on: 1859999
Blocks: 1886808
Depends on: 1873687

Oh, derp, sorry, wrong bug link! This is the most recent re-vendoring that should unblock overrides. 🙂

Depends on: 1891754
No longer depends on: 1873687
You need to log in before you can comment on or make changes to this bug.