GPU Compositor Layers and will-change
Promotion of a DOM subtree to a dedicated GPU texture allowing the Compositor Thread to animate transform and opacity without Layout or Paint.
About this page
VRAM Cost of GPU Layer Promotion
Adjust the number of animated elements and toggle static will-change.
Under the Hood#
Like pre-printing actors onto transparent acetate cels before filming, layer promotion caches a subtree's rasterized bitmap in VRAM so the GPU only shifts or fades the cel instead of redrawing the entire scene.
- During the
Layerizephase of the Browser Rendering Pipeline, Blink decides whichPaintLayerobjects receive their ownCompositedLayer(transform: translate3d,will-change: transform,<video>,<canvas>). - The engine rasterizes each layer's tiles and uploads them to GPU memory (VRAM).
- Subsequent frames only update the layer's transformation matrix on the GPU without recalculating Style, Layout, or Paint.
/* Promote only on intent, not permanently across 500 cards */
.card:hover {
will-change: transform;
}
.card.is-animating {
transform: translate3d(0, -4px, 0);
transition: transform 180ms cubic-bezier(0.2, 0, 0, 1);
}Problem Genealogy#
- 2011 (
translateZ(0)hack): Developers discovered that a zeroed 3D transform tricked WebKit into GPU promotion, soon copy-pasted onto* { transform: translateZ(0); }with predictable VRAM consequences. - 2015 (
will-change): Standardized hint warning the engine before an animation starts. - 2022+ (Blink Auto-compositing): Automatic promotion strictly for the active duration of CSS/WAAPI animations.
Production Pitfalls#
- Layer Explosion: Elements overlapping an animated layer inside the same CSS Stacking Context are often promoted as well, silently multiplying VRAM consumption on mobile GPUs.
- Blurry text or lost subpixel antialiasing: On some operating systems, a promoted layer switches from LCD subpixel rendering to grayscale antialiasing, and fractional transforms misalign Device Pixel Ratio & Subpixel boundaries.
Where this connects
Prerequisites
Browser Rendering Pipeline (Critical Rendering Path)
Promotion happens after Paint during the Layerize phase prior to GPU upload.
Device Pixel Ratio & Subpixel Rendering
Compositor layer textures rasterize at devicePixelRatio scale and snap subpixel transforms to physical pixels.
Next & related
Scroll-Driven Animations
Scroll progress updates on the Compositor Thread without main-thread scroll listeners.
View Transitions API
The ::view-transition pseudo-element tree animates captured textures on the compositor.
Web Animations API (WAAPI)
Compositor-friendly properties (transform, opacity) run off the main thread.
Seen in Architecture Autopsies
Autopsy #05: 2,147,483,647 Loses to 10
Applying transform or will-change promotes the parent to a GPU compositor layer, implicitly sealing its stacking context.
Autopsy #09: Smooth on the MacBook, Dead on the Bus
Blanket will-change: transform promotes 80 cards into permanent GPU textures, exhausting mobile tile memory.