Investigate support for WebGPU Immediates (push constants)
维护者通常 1 天内回复
@mvaligursky 已经在做这个了。
开始于 2026年6月17日。
评估
这个 Issue 还没有评估数据。
描述
Feature
Investigate Immediates (a.k.a. push/root constants), shipped in Chrome 149/150.
Immediates let you pass small, frequently-changing data directly to a shader without creating a GPU buffer or bind group. The values are injected straight into the pass encoder, avoiding a memory write and a bind-group lookup per update.
API surface:
- WGSL — declare via the
immediateaddress space:var<immediate> color: vec4f; - JS — set before a draw call:
passEncoder.setImmediates(/*rangeOffset=*/0, new Float32Array([1, 0, 0, 1])); passEncoder.draw(3); - Pipeline layout —
layout: 'auto'infersimmediateSizefrom the WGSL module; explicit layouts declare it. - Capability detection —
navigator.gpu.wgslLanguageFeatures.has('immediate_address_space').
Benefit
- Reduce CPU overhead for per-draw data that changes every draw call (object IDs, small per-draw transforms/params) by skipping uniform-buffer writes and bind-group rebinds.
- A potential fast path for the kind of redundant state churn discussed in #7656 / #7880, where WebGPU's per-draw binding cost lags WebGL2.
Notes
- Chrome 149/150 only at the moment; WebGPU-only with no WebGL2 equivalent, so it requires capability detection and a graceful fallback to uniform buffers.
- Strictly for small values — large arrays, complex lighting structures, and big matrices should stay in uniform/storage buffers (push-constant size budget is small).
- Requires plumbing the
immediateaddress space through shader generation and the WebGPU pipeline-layout/draw path. - Ref: https://developer.chrome.com/blog/new-in-webgpu-149-150#immediates
- 主要语言
- JavaScript
- 星标
- 17.2k
- 派生
- 2k
- 平均合并
- 6 小时 39 分钟
- 30 天内合并 PR
- 222
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
playcanvas/engine 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 80/100
playcanvas/engine#9769 ·
维护者通常 1 天内回复
-
XrInputSource#elementEntity holds the ElementComponent, not the Entity its docs and type promise未关闭area: xr
难度 2/5 1-3 小时 新手友好度 75/100
playcanvas/engine#9660 ·
维护者通常 1 天内回复
-
Isotropic GGX specular visibility term uses alpha^4 instead of alpha^2可能已有人在做 @Yahiro025 于 36 天前认领。 未关闭area: gltf area: graphics
难度 2/5 1-3 小时 新手友好度 86/100
playcanvas/engine#9510 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
playcanvas/engine#9335 ·
维护者通常 1 天内回复
-
area: ui enhancement
难度 1/5 1 小时以内 新手友好度 72/100
playcanvas/engine#5777 ·
维护者通常 1 天内回复
查看 playcanvas/engine 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
-
tech-debt
难度 2/5 1-3 小时 新手友好度 72/100
srikanth235/centraid#1155 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
microsoft/monaco-editor#5563 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复