playcanvas / playcanvas/engine
feat(graphics): adopt WGSL sized_binding_array once Chrome ships it unflagged
@mvaligursky is already working on this.
Since May 27, 2026.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Background
The sized_binding_array WGSL proposal adds a binding_array<T, N> type that supports dynamic indexing across an array of bindings — closing one of the major WebGL → WebGPU porting gaps, and enabling bindless-style patterns for textures, samplers, and buffers.
Example:
```wgsl
@group(0) @binding(0) var textures: binding_array<texture_2d, 8>;
@group(0) @binding(1) var samp: sampler;
@fragment
fn fs(in: VsOut) -> @location(0) vec4f {
let idx = in.materialIndex;
return textureSample(textures[idx], samp, in.uv);
}
```
Status
As of Chrome 148 (May 2026 investigation), the feature appears to still be behind flags / not exposed via navigator.gpu.wgslLanguageFeatures as a stable entry. This issue is a placeholder — do not act on it until Chrome ships it unflagged.
What to do when it ships
- Add the standard WGSL feature cap infrastructure (
supportsSizedBindingArray,CAPS_SIZED_BINDING_ARRAY,requires sized_binding_array;) — same shape as #8785, #8786, #8787. - Evaluate use cases: candidate consumers in the engine include material variants (texture atlas/array indirection), gsplat tile lookups, IBL chains, anything currently working around fixed binding slots with branching or duplicated shaders.
- Consider adding a
BindGroupFormatAPI extension for declaring binding arrays on the JS side.
Triggers to revisit
- Chrome release notes announce
sized_binding_arrayis on by default (no flags) navigator.gpu.wgslLanguageFeatures.has('sized_binding_array')returnstruein stable Chrome
References
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.