keepcalculator

06 Numbers and Powers

DirectX vs Vulkan: Which One Should You Use?

Card No. 06·56578 · Updated · Standard formula, shown below

The short answer: DirectX is Microsoft’s graphics API for Windows and Xbox, while Vulkan is a cross-platform API that works on Windows, Linux, and other systems. The one you should use depends on your platform and whether you prioritize compatibility (DirectX) or low-level performance and control (Vulkan).

Background: Why Two Graphics APIs?

Graphics APIs are the software layer between your game or application and the GPU. They tell the graphics card what to draw, when to draw it, and how to manage memory. For decades, the dominant API was OpenGL, an open standard that ran on many platforms but had grown bulky and inefficient on modern multi-core CPUs.

In the mid-2010s, two new APIs emerged to replace OpenGL: DirectX 12 (Microsoft) and Vulkan (Khronos Group, the same consortium behind OpenGL). Both are “low-level” APIs, meaning they give developers much more direct control over the GPU than older APIs like DirectX 11 or OpenGL. This control allows for better performance, but it also makes the APIs more complex to program.

How Each API Works

DirectX 12 is part of the larger DirectX suite (including DirectSound, DirectInput, etc.). It is proprietary to Microsoft and is the native API for Windows, Xbox, and (via translation layers) some other platforms. DirectX 12 introduced features like explicit multi-GPU support, asynchronous compute, and a redesigned command list system that reduces CPU overhead.

Vulkan is an open standard, maintained by the Khronos Group. It is essentially a cleaned-up version of AMD’s Mantle API, which was donated to Khronos. Vulkan works on Windows, Linux, Android, Nintendo Switch, and other platforms. It is also used in non-gaming fields like CAD, video editing, and machine learning because of its low overhead and cross-platform nature.

Both APIs let developers manage GPU resources explicitly, which is a double-edged sword: it can yield big performance gains, but it also requires far more programming effort and is easier to get wrong.

Performance: Which Is Faster?

In theory, there is no inherent speed difference between DirectX 12 and Vulkan—both are low-level and can achieve similar performance on the same hardware. In practice, the difference depends on the game, the GPU, and how well the developers optimized for each API.

  • CPU overhead: Both APIs drastically reduce CPU overhead compared to DirectX 11, which helps in CPU-bound scenarios (e.g., many objects on screen).
  • GPU driver: NVIDIA and AMD both optimize their drivers for both APIs, but there have been cases where one API is faster on a specific GPU generation.
  • Game-specific: Some games show a 5-10% improvement with Vulkan, others with DirectX 12. For example, Doom Eternal runs well on both, but Vulkan often edges out DirectX 12 on AMD GPUs.

For most gamers, the difference is small. If you’re deciding between two versions of the same game, the best approach is to check current benchmarks for your specific GPU model.

Compatibility and Platform Support

This is where the two APIs diverge most significantly.

  • Windows: Both work perfectly. DirectX 12 is native, and Vulkan works through the GPU driver.
  • Linux: Vulkan is the primary modern API. DirectX 12 does not work natively; games using it must go through a translation layer like Proton (which converts DirectX 12 to Vulkan).
  • macOS: Neither API is officially supported. Apple uses its own Metal API. Vulkan can run through a translation layer (MoltenVK), but DirectX 12 does not have a viable path.
  • Console: Xbox uses DirectX 12, while the Nintendo Switch uses Vulkan. PlayStation uses its own proprietary API, though it is similar in concept.
  • Mobile: Vulkan is the only one of the two that works on Android. iOS uses Metal.

If you are developing for multiple platforms, Vulkan is the clear choice. If you are targeting Windows and Xbox exclusively, DirectX 12 is simpler and better integrated.

How to Choose: For Gamers and Developers

For gamers: You usually don’t have to choose—the game picks the API for you. Some games offer a setting (e.g., “API: DirectX 12 / Vulkan”). If you have an older GPU or a CPU that is not very powerful, try both and see which gives better frame rates. On Linux, Vulkan is the only realistic option. On Windows, DirectX 12 is the default for most games, but Vulkan can be better for some titles, especially if you have an AMD GPU.

For developers: If you are building a game or application that must run on multiple platforms (Windows, Linux, Android), Vulkan is the safer choice. If you are building exclusively for Windows and Xbox, DirectX 12 will be easier to integrate with other Microsoft tools like Visual Studio and DirectX’s debugging utilities. DirectX 12 also has a slightly more mature set of features for ray tracing (DXR), though Vulkan has its own ray tracing extension.

Common Problems and Misconceptions

Misconception: Vulkan is always faster than DirectX 12. This is not true. Performance is game-specific and hardware-specific. Some games are better optimized for one API.

Misconception: DirectX 12 is only for Windows. While that is true for the official API, there are translation layers (like Wine and Proton) that allow DirectX 12 games to run on Linux by converting to Vulkan. This is not perfect but works surprisingly well.

Common problem: Vulkan games crash on older GPUs. Vulkan requires a GPU that supports at least Vulkan 1.0. If your GPU is older than about 2015, it may not support Vulkan. Check the GPU’s spec sheet.

Common problem: DirectX 12 games stutter on Windows. This is often due to shader compilation stutter, which is a known issue with DirectX 12. Vulkan also has this issue, but some games implement background shader compilation to reduce it.

Cost and Ecosystem

Both APIs are free to use. DirectX 12 is part of the Windows SDK, which is free. Vulkan is an open standard, and the SDK is free from Khronos. The costs come in development time: both APIs require significant expertise to use effectively.

DirectX 12 benefits from Microsoft’s extensive documentation, tools (like PIX for debugging), and integration with Visual Studio. Vulkan has a more fragmented toolset, but the community is active, and there are good third-party libraries (like Vulkan-Hpp) that simplify development.

Frequently Asked Questions

Is Vulkan better than DirectX 12?

Not universally. Vulkan is better for cross-platform development and often has lower CPU overhead on Linux. DirectX 12 is better for Windows/Xbox exclusives and has more mature ray tracing support. For a specific game, the best API is the one the developers optimized best.

Can DirectX 12 games run on Vulkan?

Not directly. They are different APIs. However, on Linux, Proton (a compatibility layer) can run DirectX 12 games by translating them to Vulkan. This works for many games, but not all.

Which API should I use for my game?

If you are targeting Windows only, use DirectX 12. If you want to reach Linux, Android, or Switch, use Vulkan. If you are a beginner, you might start with a higher-level API (like DirectX 11 or WebGPU) and learn the low-level concepts later.

Does Vulkan work on NVIDIA GPUs?

Yes. Vulkan is a vendor-neutral API, and NVIDIA, AMD, and Intel all provide Vulkan drivers for their GPUs. NVIDIA has supported Vulkan since 2016.

Is DirectX 12 only for gaming?

No, it is also used for scientific computing, CAD, and other GPU-accelerated applications. However, its primary use is gaming.

Will Vulkan replace DirectX?

Unlikely. DirectX is deeply integrated into Windows and Xbox, and Microsoft has no incentive to replace it. Vulkan will continue to be the standard for cross-platform and Linux gaming.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →