v150 · WebGPU

Colour Animation

Adjust the sliders to change the fragment colour in real time. Each frame, four floats (RGBA) are passed directly to the GPU shader via setImmediateData() — no buffer writes, no bind group rebinds.

Feature detection: checking…
R 0.20 G 0.50 B 0.90 A 1.00
// Each frame, sliders feed 4 floats directly to the shader
// In a real app using immediates this skips buffer allocation entirely

// Traditional approach (before immediates):
device.queue.writeBuffer(colorBuffer, 0, colorData); // memory write
pass.setBindGroup(0, bindGroupWithColor);            // descriptor overhead

// With setImmediateData() (Chrome 150):
pass.setImmediateData(0, colorData);  // direct — no buffer, no bind group

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗