Closed Bug 1822096 Opened 1 year ago Closed 2 months ago

Support WGSL const-expressions and override-expressions in Naga

Categories

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

task

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: jimb, Assigned: teoxoy)

References

(Blocks 8 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.

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: webgpu-v1
No longer blocks: webgpu-v1-cts-blockers
Blocks: 1852491
Blocks: 1852492
Depends on: 1859999
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
Pushed by ttanasoaia@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/49aba74b154f
[webgpu] add plumbing for pipeline-overridable constants. r=webgpu-reviewers,webidl,smaug,nical,ErichDonGubler
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: