WebGPU

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:

Sections