liveBook · Manning

GPGPU

As explained in CSS in Depth, Second Edition

GPU acceleration is rendering computation performed by a graphics processing unit instead of primarily by the central processor.

GPU acceleration moves suitable rendering work from the main CPU to the graphics processing unit. Browsers can promote an element into its own paint layer, send that layer to the GPU, and composite it into the final image. section 16.3.1

The practical trade-offs are:

  • Opacity and transform changes can avoid repeatedly repainting the main layer during animation. section 16.3.1
  • Layer promotion can speed rendering, but additional layers consume more memory. section 16.3.1
  • The benefit matters most for animations that update many times per second, not usually for one-time changes. section 16.3.1
Figure 16.12 The three stages of the rendering pipeline
figure

Trace how layout, painting, and compositing combine painted layers into the displayed image. section 16.3.1

How CSS in Depth, Second Edition covers it

How deep it goes
Explains layers, repainting, compositing, and memory trade-offs, but stops short of implementation code.
Examples
Uses background-color changes, element resizing, and animated opacity or transforms as contrasting rendering cases.
What you can do after
Evaluate when layer promotion and GPU acceleration can improve animated rendering and when memory costs may outweigh benefits.
How it connects
Connects GPU acceleration with rendering pipelines, paint layers, compositing, transforms, opacity, and animation.

Also explained in

Compare how 3 books explain GPGPU →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of CSS in Depth, Second Edition. The section links point to the parts of the book it draws on.