Screen Tearing and DXGI_PRESENT_ALLOW_TEARING in VRR

This article explains the mechanics of screen tearing, the limitations of traditional synchronization methods, and how the DXGI_PRESENT_ALLOW_TEARING flag operates within modern DirectX pipelines. By decoupling frame presentation from fixed refresh cycles, this flag allows modern graphics engines to fully leverage Variable Refresh Rate (VRR) hardware, eliminating visual artifacts while minimizing input latency.

Understanding Screen Tearing

Screen tearing is a visual artifact that occurs when a display shows information from multiple frames in a single screen refresh cycle. Displays draw images line-by-line from top to bottom at a set frequency (for example, 60Hz or 144Hz).

If a graphics processing unit (GPU) finishes rendering a new frame while the monitor is mid-scanout, the display buffer updates immediately in non-synchronized pipelines. As a result, the top half of the screen displays the older frame while the bottom half displays the newer frame. The boundary where these two distinct frames meet appears as a horizontal split or "tear."

The Problem with Traditional VSync

Historically, the primary solution to tearing has been Vertical Synchronization (VSync). VSync forces the GPU to synchronize its frame presentation with the monitor's Vertical Blanking Interval (VBLANK)—the brief pause between the end of one refresh cycle and the start of the next.

While VSync eliminates tearing, it introduces significant drawbacks:

  • Input Latency: Frames are held back in the render queue until the monitor is ready to scan them, resulting in a noticeable delay between player input and on-screen response.
  • Stuttering: If the GPU fails to render a frame before the next VBLANK interval, the monitor must re-display the previous frame, causing frame rates to drop in stepped increments (e.g., dropping directly from 60 FPS to 30 FPS).

How Variable Refresh Rate (VRR) Solves the Dilemma

Variable Refresh Rate technologies—such as NVIDIA G-SYNC, AMD FreeSync, and VESA Adaptive-Sync—alter the display hardware mechanism. Instead of the GPU conforming to a rigid display timing cycle, the monitor adjusts its refresh rate dynamically to match the exact moment the GPU delivers a finished frame.

To achieve this, the monitor waits to refresh until a new frame is presented, provided the frame rate remains within the display's supported VRR range. This prevents tearing entirely without enforcing the artificial delays that create VSync-induced input latency.

The Role of DXGI_PRESENT_ALLOW_TEARING

In modern Windows display architectures using the DirectX Graphics Infrastructure (DXGI) and the modern Flip Presentation Model (DXGI_SWAP_EFFECT_FLIP_DISCARD or DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL), the operating system's Desktop Window Manager (DWM) tightly manages composition. By default, the flip model enforces VSync-like behavior to prevent artifacts across windowed applications.

The DXGI_PRESENT_ALLOW_TEARING flag is an explicit presentation instruction passed to the IDXGISwapChain::Present call. It informs the graphics driver and the OS compositor that the application intends to bypass standard synchronization barriers.

To implement this flag correctly, developers must satisfy specific technical conditions:

  1. The swap chain must be created using the DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING flag.
  2. The application must run in a modern flip model.
  3. The display subsystem must support variable refresh rates or unbuffered presentation, verified via IDXGIFactory5::CheckFeatureSupport with DXGI_FEATURE_PRESENT_ALLOW_TEARING.

Enabling Ultra-Low-Latency VRR Gaming

Passing DXGI_PRESENT_ALLOW_TEARING is the software key that unlocks optimal VRR functionality in modern PC games:

  • Direct Scanout in Borderless Windows: It permits borderless windowed modes to achieve the low-latency performance historically exclusive to legacy exclusive fullscreen mode. The DWM steps aside, allowing the game swap chain to directly drive display scanout.
  • Immediate Delivery Inside the VRR Window: When the GPU renders a frame, it is presented immediately without queuing behind a timer. The VRR display refreshes instantly upon receiving the frame buffer, resulting in true zero-wait synchronization and minimal input latency.
  • Predictable Behavior Outside the VRR Window: When frame rates exceed the maximum refresh rate of a VRR monitor, developers can allow the application to tear rather than forcing standard VSync. For competitive esports titles where millisecond response times supersede visual fidelity, allowing tearing past the display limit guarantees that the game never buffers frames, preserving the lowest possible control-to-display latency.