WebGL drew everything through WebGL, which carries OpenGL's early-1990s design into the browser: one global state machine that the driver re-validates at every draw call, and no way to compute except by disguising the work as drawing. WebGPU is the web's second GPU API, designed around the way Direct3D 12, Metal and Vulkan drive today's hardware. Pipelines are immutable objects built up front, commands are recorded into buffers, and the same API runs compute shaders.
Chrome 1 and Edge have shipped WebGPU since version 113, Safari 10 since 26, and Firefox 555 on Windows and Apple Silicon Macs. This chapter goes from first principles to production practice, showing the WebGPU way of doing what WebGL covered rather than re-deriving it. BookNest's six books become a GPU-computed catalog, drawn as instanced covers on a shelf and sorted, filtered and culled by compute shaders, built on one small helper introduced in Adapters and Devices.
Every render and compute dispatch in this chapter ran in headless Chrome 154 on an NVIDIA GeForce GTX 1650, which WebGPU reports only as vendor nvidia, architecture turing (Chrome blanks the full name for privacy). Where something could not run here, such as a second GPU or the Deno 60,577 runtime, the text says so.
What you will learn:
Why WebGPU exists, how it is standardized, and where browsers support it in 2026
How Dawn 1,149 and wgpu translate WebGPU to native APIs inside a sandboxed GPU process
How to request adapters and devices, read limits and features, and handle errors and device loss
How to write WGSL, from types and address spaces to bindings and diagnostics
How buffers, bind groups, pipelines, depth, multisampling, textures and mipmaps fit together
How to draw many objects with instancing, indirect draws and render bundles
How to write compute shaders for reductions, prefix sums, sorting, image filters, particles and culling
How to profile WebGPU, port WebGL code, and choose among WebGPU libraries
Sections
- Why WebGPU Exists
- Architecture
- Adapters and Devices
- Errors and Device Loss
- Canvas and Presentation
- WGSL Types
- Functions and Entry Points
- Bindings and Diagnostics
- Buffers and Bind Groups
- Render Pipelines
- Depth and Multisampling
- Textures and Samplers
- Mipmaps and Loading
- Uniforms and Instancing
- Indirect Draws and Bundles
- Compute and Workgroups
- GPGPU Patterns
- Particles and Culling
- Profiling and Beyond
- Libraries and Ecosystem
- Test Yourself!