Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Investigate support for WebGPU Immediates (push constants)

クローズ
#8,917 コメント 0 件 リアクション 2 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@mvaligursky がすでに取り組んでいます。

2026年6月17日 から。

評価

この issue はまだ評価されていません。

説明

area: graphics enhancement
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 immediate address 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' infers immediateSize from 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 immediate address 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分
マージ済み PR(30日)
222

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

playcanvas/engine のほかの issue

playcanvas/engine の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。