Stay ahead of the evolving digital threats impacting individuals, companies, and governments. Explore reports on data breaches, security flaws, cyber-attacks, privacy legislation, and the tools and tactics designed to protect today’s connected world.
Explore Tech:
Tech
Gadgets
Hardware & Devices
Startups
Software & Apps
Cybersecurity
Innovation
Internet
QUOTE OF THE DAY
Joseph Weizenbaum, 1976
“Joseph Weizenbaum distinguishes computational problem-solving from human judgment rooted in lived experience, responsibility, and moral consequence.”
Read MoreEXPLAINER OF THE DAY
How Does a Swap Chain Present Frames Without Tearing?
Swap Chain Explainer
A swap chain is a collection of image buffers that connects a rendering application to a display system. Instead of drawing directly into the pixels currently being scanned to a monitor, a game or graphical program renders a complete frame into a back buffer. It then asks the window system or graphics API to present that image. The presentation system makes an appropriate queued buffer visible while another becomes available for future rendering. This separation prevents partially drawn work from appearing simply because the display read it too early.
Double buffering uses one front buffer for display and one back buffer for rendering. Triple buffering or deeper queues provide additional room when the processor, graphics unit, and display operate at different rates. The word “swap” is conceptual: modern systems often rotate references or flip which surface is presented rather than copy an entire image. Buffers may also be composed with other windows into a desktop surface before scanout, so a windowed application does not necessarily control the physical front buffer itself.
Tearing occurs when the displayed image changes during a scanout, causing different parts of the screen to show different frames. Synchronizing presentation to a vertical refresh boundary can prevent that visible split. If a frame misses the boundary, traditional vertical synchronization may keep the old frame for another refresh, causing a judder or latency increase. Variable-refresh displays can adjust the next refresh within a supported range, reducing the need to choose between fixed timing and tearing.
Presentation modes define what happens when rendering produces frames faster than they can be shown. A first-in-first-out queue preserves order and normally waits for refresh. A mailbox-like mode can replace an older queued frame with a newer one, reducing latency while keeping complete frames. An immediate mode may allow tearing. API names and exact guarantees differ, but each mode balances smoothness, latency, power use, and whether every rendered frame must reach the display.
Synchronization is essential because the graphics processor may still be writing a buffer when the presentation engine wants to read it, or the display system may still own a buffer the application wants to reuse. Fences, semaphores, and frame-latency limits coordinate those transitions. Formats, dimensions, color spaces, and usage flags must also match the display path. When a window is resized, the device changes, or high-dynamic-range settings shift, the application may need to recreate swap-chain resources.
A deeper queue can keep the graphics processor busy, but it can also increase input latency because more completed frames wait ahead of the newest input. Rendering far above the display rate wastes power and may heat the device without improving visible motion. Applications therefore measure frame time, limit queued work, and select a presentation mode appropriate to the content. A swap chain does not make rendering faster; it organizes completed and in-progress images so the display receives whole frames under a defined timing policy. Its practical value is controlled handoff: render away from the scanout surface, synchronize ownership, and present at a moment that balances tearing, delay, and consistent motion.
Color correctness travels through the same path. A swap-chain format describes channel precision and encoding, while metadata and display configuration may identify standard or high-dynamic-range output. Compositors sometimes convert several windows into a common working space before final scanout. If the application renders with one transfer function and presents as another, brightness and color can be wrong even though synchronization is perfect. Screenshots, overlays, and capture software also need compatible access to presented surfaces. Presentation is therefore both a timing contract and a pixel-format contract between the renderer, compositor, driver, and display.
Both contracts must agree.
Short Answer and Key Terms+
A swap chain rotates several image buffers between rendering and display. Key terms include front buffer, back buffer, double buffering, triple buffering, present, scanout, vertical synchronization, tearing, refresh rate, presentation mode, fence, and frame latency.
Why Can Triple Buffering Increase Latency?+
An extra buffer keeps rendering productive when presentation waits, but completed frames can queue ahead of the newest input. Limiting the number of frames in flight helps balance utilization against response time.
What Causes Screen Tearing?+
Tearing appears when the display begins reading one frame and the presented buffer changes before scanout finishes. Different horizontal regions then come from different frames. Refresh-synchronized presentation avoids that mid-scan change.
Explore more “Explainers”
Discover additional explainers across politics, science, business, technology, and other fields. Each explainer breaks down a complex idea into clear, everyday language—helping you better understand how major concepts, systems, and debates shape the world around us.
Previous ExplainerAll Explainers in TechNext Explainer
Read More