CONCEPT Cited by 1 source
Compute shader¶
A compute shader is a GPU program that performs general compute work independent of the fixed-function rendering pipeline. Where vertex/fragment shaders are constrained to produce pixels along a rasterization pipeline, a compute shader is a standalone kernel the application dispatches over a grid of workgroups — closer in spirit to CUDA / OpenCL than to classical graphics shaders.
Why it matters for web graphics apps¶
Browser graphics APIs historically (via WebGL) had no compute shaders — the only GPU work you could ask the GPU to do was draw-call-shaped. Work that didn't fit that shape had to run on the CPU, cross the JS↔Wasm boundary, sometimes round-trip to a Web Worker, and then ship results back to the GPU.
WebGPU adds compute shaders as a first-class concept. That unlocks moving a category of work from CPU → GPU:
- Image filters (blur, convolution kernels) — highly parallelisable per-pixel.
- Parameter transforms — physics-like updates on large object collections.
- Data reductions (parallel prefix sum, histogram) — computed on the GPU instead of the CPU.
In the Figma WebGPU migration¶
Figma's 2026-04-21 post calls this out as one of the core rationales for the WebGPU migration:
"compute shaders that can be used to move work off the CPU and onto the GPU to take advantage of its parallel processing."
Specifically, Figma plans to optimize blur rendering using compute shaders post-WebGPU migration — framed as future work at publication time.
Trade-offs¶
- Compute shaders are not magic free parallelism. Dispatches have overhead. Short kernels often lose to CPU on small inputs.
- Bandwidth matters. Compute shaders that write large output buffers can be memory-bound, not compute-bound.
- Debugging is harder than CPU code — GPU debuggers are substrate-specific (RenderDoc, Metal frame capture, etc.).
Seen in¶
- sources/2026-04-21-figma-rendering-powered-by-webgpu — compute shaders named as a core motivation for Figma's WebGPU migration and as the substrate for planned blur-rendering optimizations.