explaingit

something-mighty/vk_dxgi

24C++Audience · developerComplexity · 4/5Setup · hard

TLDR

Single-header C++ library that gives Vulkan applications on Windows direct control over DXGI presentation, unlocking frame-latency waitable objects, variable refresh rate, and HDR output without the standard compatibility layer.

Mindmap

mindmap
  root((vk_dxgi))
    What it does
      Vulkan DXGI bridge
      Direct presentation
      Frame latency control
    Features
      Variable refresh rate
      HDR formats
      Blit mode fallback
    Tech Stack
      C++ single header
      Vulkan
      DXGI D3D12
    Use Cases
      Games
      Graphics engines
      Input lag reduction
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Reduce input lag in a Vulkan game on Windows by using DXGI frame-latency waitable objects directly instead of the default compatibility layer.

USE CASE 2

Enable variable refresh rate support for a Vulkan renderer on G-Sync or FreeSync displays.

USE CASE 3

Integrate a Vulkan swap chain into a larger Windows application that already expects a standard DXGI interface.

USE CASE 4

Add 10-bit HDR or 16-bit float output to an existing Vulkan-based graphics engine on Windows.

Tech stack

C++VulkanDXGID3D12

Getting it running

Difficulty · hard Time to first run · 1h+

Requires specific Vulkan device extensions enabled at creation time and a working Vulkan plus D3D12 interop environment on Windows.

In plain English

This is a small C++ library for Windows application developers who are building graphics programs using Vulkan, a low-level graphics programming interface. The specific problem it solves involves how those programs display their rendered images on screen. Windows has its own system for managing display output called DXGI (DirectX Graphics Infrastructure), and by default Vulkan programs use a compatibility layer to work with it. This library replaces that layer and gives the Vulkan application direct control over the DXGI side of presentation. The main reason to use direct DXGI control is access to features that the compatibility layer does not expose. These include frame-latency waitable objects (a way to precisely control how many frames ahead the GPU works, which reduces input lag), support for variable refresh rate displays, and control over tearing behavior. Programs that need to interact with other code expecting a standard DXGI interface also benefit from this approach. The library is distributed as a single header file, which means there is no separate build step. Developers add one file to their project and enable the implementation in exactly one source file. The setup involves creating a Vulkan device with specific extension support enabled, then calling the library's functions to create a swap chain (the structure that manages the frames being shown on screen), acquire each frame's image for rendering, and present the finished frame to the display. The library supports two modes. In the default mode, the application renders directly into the DXGI backbuffer images, which avoids an extra copy step. In the alternative blit mode, the application renders into a single shared image and the library copies it into the appropriate backbuffer, which is more compatible with different driver configurations. Synchronization between Vulkan and the D3D12 side is handled through a shared fence object imported as a Vulkan timeline semaphore. Supported color formats include standard 8-bit formats, 16-bit float, and 10-bit HDR.

Copy-paste prompts

Prompt 1
Add vk_dxgi to my Vulkan renderer so I can create a swap chain that uses DXGI frame-latency waitable objects to reduce input lag.
Prompt 2
Show me how to enable variable refresh rate in my Vulkan application using vk_dxgi on a Windows machine with a FreeSync display.
Prompt 3
Walk me through setting up vk_dxgi's blit mode for a driver configuration that doesn't support rendering directly into DXGI backbuffers.
Prompt 4
Configure vk_dxgi to output HDR using the 10-bit RGBA1010102 format in my existing Vulkan swap chain.
Prompt 5
Explain the shared fence synchronization mechanism vk_dxgi uses between Vulkan and D3D12 and how to import it as a timeline semaphore.
Open on GitHub → Explain another repo

← something-mighty on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.