-
Notifications
You must be signed in to change notification settings - Fork 329
Closed
Labels
wgslWebGPU Shading Language IssuesWebGPU Shading Language Issueswgsl resolvedResolved - waiting for a change to the WGSL specificationResolved - waiting for a change to the WGSL specification
Milestone
Description
Compute shaders are often parameterized by key sizing knobs: workgroup size, and internal shared storage sizes.
It's important to be able to parameterize the size of an array in workgroup storage. A good pattern for this is to use a pipeline-overridable constant as the size of the array.
(Also following #1272, to allow certain expressions over pipeline-overrideable constants).
FYI, for other environments the resizable workgroup array is supported like this:
- OpenCL C supports this idiom via a pointer-to-local kernel argument, and on the API side the dispatch specifies the size of the underlying array. (The contents are uninitialized
- MSL supports this via pointer-to-threadgroup (buffer) kernel argument. On the API side (if I understand it correctly), you supply a regular buffer object, which has a max length (e.g. see here)
- SPIR-V for Vulkan: Use a specialization constant to size the array.
- HLSL: I haven't looked. I think we agreed the normal pattern would be to use a #define
bjornbyteskvark and bjornbytes
Metadata
Metadata
Assignees
Labels
wgslWebGPU Shading Language IssuesWebGPU Shading Language Issueswgsl resolvedResolved - waiting for a change to the WGSL specificationResolved - waiting for a change to the WGSL specification