← Blog

On Windows, Punktfunk encodes inside the display driver

Punktfunk's Windows display driver encodes each frame as Windows composes it, and the host only sends the result. On an RTX 4090 at 4K120 that means 4–8 ms end to end.

On a Windows host, Punktfunk encodes video inside its display driver. The host process never touches a pixel: it reads finished, compressed frames from shared memory and sends them.

The path of a frame

  1. Windows composes the desktop for Punktfunk's virtual display and hands the frame to the driver.
  2. The driver makes one GPU pass into a three-slot pool, already in the encoder's input format, and returns the surface to Windows.
  3. An encode thread in the driver takes the newest frame from the pool and encodes it.
  4. The encoded frame lands in shared memory, where the host picks it up.

No frame is read back to the CPU or crosses a process boundary.

The driver carries NVENC, AMF, QSV, Media Foundation and PyroWave on x64, and Media Foundation only on ARM64. The host picks by GPU vendor, and PyroWave when the client asks for it. If the vendor's encoder won't open an 8-bit SDR H.264 or HEVC session, the driver falls back to Media Foundation.

Windows never waits for the encoder

The driver runs inside Windows' driver host process, so it must not hold Windows up. Between receiving a frame and returning it, it does only that one pass. If the encoder falls behind, the pool recycles the oldest waiting frame, so the encoder always takes the freshest picture and a slow encoder costs a stream frame, never the desktop.

The encode loop sleeps until the encoder signals a finished frame, so a frame leaves as soon as it is encoded. With NVENC at 4K120 on an RTX 4090, the worst wait in any test window was 6.2 ms; polling on a timer had let one frame sit 48 ms. Timed waits use a high-resolution timer, because Windows' default 15.6 ms tick would cap cursor updates on a still desktop near 64 per second.

If a stream stalls anyway, the host works up a recovery ladder: encoder reset, swap chain, presentation, and last a driver reload.

Latency

On an RTX 4090 test host at 4K, 120 Hz and HDR, end-to-end latency measured 4–8 ms, against 9–17 ms when the host encoded in its own process. The host's share fell from 6–9 ms to effectively zero.

PyroWave and overlay tools

The driver runs in session 0, which has no desktop. Overlay tools such as RivaTuner load a Vulkan layer into every Vulkan program, and those layers hang there, so the driver switches implicit Vulkan layers off for its PyroWave encoder.

What you need

  • Windows 11 22H2 (build 22621) or newer.
  • Host and driver from the same installer. Setup updates both; expect a brief black screen while the driver reloads. A host that meets a driver it can't talk to reports "driver outdated".

Setup: Windows host. Related: low latency when the game maxes out your GPU.