Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Investigate support for WebGPU Immediates (push constants)

Chiusa
#8,917 0 commenti 2 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@mvaligursky ci sta già lavorando.

Dal 17/6/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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
Lingua principale
JavaScript
Stelle
17.2k
Fork
2k
Merge medio
6h 54m
PR unite (30g)
217

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di playcanvas/engine

Tutte le issue di playcanvas/engine

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.