webgpu-impl-compute-usecases
Installation
SKILL.md
WebGPU Compute Use Cases
Map four common GPGPU workloads, image processing, particle systems, physics simulation, and reduction or prefix-sum, onto the WebGPU compute pipeline with the correct resources, buffering, and synchronization.
Quick Reference
WebGPU 1.0-stable (Chrome 113+, Safari 26+, Firefox 141+).
| Use case | Input resource | Output resource | Buffering | Synchronization |
|---|---|---|---|---|
| Image processing | Sampled or storage texture | Storage texture (STORAGE_BINDING) |
Two textures if in-place | workgroupBarrier after tile load |
| Particle system | Storage buffer (STORAGE) |
Same storage buffer | Single buffer, integrate in place | None within a workgroup if no shared state |
| Physics simulation | Storage buffer A (read) |
Storage buffer B (read_write) |
Double-buffer, swap each step | workgroupBarrier / storageBarrier |
| Reduction / scan | Storage buffer | Partials buffer, then final | Multi-pass, one buffer per level | workgroupBarrier between tree steps |
Rules that ALWAYS hold: