Skip to main content

What is the difference between DXGI and WGC? What should I use?

Before modern APIs, screen capture on Windows was notoriously difficult. Legacy methods like BitBlt and driver hooks were unreliable, failed to capture GPU-accelerated content like games and videos, and often broke with updates. In response, Microsoft introduced two modern, robust APIs:

  • DXGI Desktop Duplication API: A low-level, high-performance API introduced in Windows 8.
  • Windows Graphics Capture (WGC): A secure, high-level API introduced in Windows 10 (v1803).

DXGI Desktop Duplication API

A low-level API for full-screen monitor capture with minimal latency.

  • Pros:
    • Full control and low latency.
  • Cons:
    • Complex implementation.
    • No window-level capture.
    • The cursor is not included by default.

Windows Graphics Capture (WGC)

A modern, high-level API for window or screen capture with built-in security.

  • Pros:
    • Simple, secure, and robust.
    • Captures occluded or moved windows accurately.
    • Ideal for app-level recording and streaming.
  • Cons:
    • Slightly more overhead than DXGI (usually negligible).

Key Factors

  • a. Multi-Plane Overlay (MPO):
    • DXGI: Can cause issues in certain cases.
    • WGC: Recomposes MPO layers correctly.
  • b. Multiple GPUs:
    • DXGI: Requires manual handling of adapter/device matching.
    • WGC: GPU abstraction is handled transparently by the OS.
  • c. D3D Versions:
    • DXGI: Requires interop to work between D3D11 and D3D12.
    • WGC: Works natively with D3D11 or D3D12.
  • d. DRM / Protected Content:
    • Both APIs return black frames for DRM content (e.g., Netflix, Hulu).
    • LS Workaround for Browsers: Disable Hardware Acceleration.

Use Cases & Conclusion

Use DXGI if you need ultra-low-latency, full-display mirroring (e.g., for VDI or remote desktop). DXGI is ultra-efficient for full-screen capture but is also complex and limited. It offers extensive compatibility across all Windows versions, including 10 22H2, 11 23H2, and 24H2 (with the KB5046617 update). It is generally considered a reliable option, with some users reporting a more stable experience than WGC on 24H2. However, since the DXGI output itself cannot be captured, screenshots cannot be taken using tools like Snipping Tool.

Use WGC for everything else (streaming, screen recording, user apps, gaming). WGC is superior for modern needs, offering better security, simplicity, and rendering support. It currently only works correctly on Windows 11 24H2, due to a long-standing bug on other versions where it fails to capture at the target application's framerate. WGC offers the advantage of being capturable, allowing users to take screenshots of the Lossless Scaling window with tools like Snipping Tool, while also providing greater flexibility for screen recording.

Running Lossless Scaling as an administrator is recommended to ensure it can capture games that require admin privileges or incorporate anti-cheat systems, such as HoYoVerse games. Without administrative rights, Lossless Scaling may fail to overlay itself or register the scaling shortcut while the game is running. This also helps when scaling OBS to record the LS window.

WGC is the recommended API for all current and future screen capture applications.

Credits - Sage & NotAce