Vulkan vs DirectX: What’s the Difference?
![VulkanvsDirectX](https://golftech.pl/wp-content/uploads/2024/05/Vulkan-vs-DirectX-Whats-the-Difference.jpg)
Regardless of PC or console, at least one graphics API plays a role in the development process of every game you play. You usually see DirectX (DX11, DX12) options, but now game developers are starting to offer more options. In some games, you should be presented with a settings screen that allows you to choose between DirectX 12 and Vulkan.
Are you going to choose between these but have no idea? Now we will try to answer all the questions in your mind. Frankly, the answers are not entirely clear. If you ask which one provides the best gaming experience, this answer varies depending on the situation. We will try to explain everything possible.
DirectX, backed by Microsoft, and Vulkan, developed by Khronos Group, are two popular graphics APIs used by most game developers today. Essentially, Vulkan and DirectX make it easy to properly allocate hardware resources (CPU and GPU). The aim is to ensure that the game communicates with the operating system and hardware in the best possible way. Thus, frame rates increase in the games you play and rendering times can be accelerated.
DirectX still has a very widely used version, DirectX 11. DirectX 12 is becoming more widespread every day. So what are these graphics APIs called Vulkan and DirectX? How do they perform? Let’s first explain what API means, then let’s dive deeper.
What is API?
In the world of computing interfacerepresents the bridge created between two or more aspects of a computing system. This bridge can be in the form of hardware (e.g. USB) or software.
Essentially, the interface allows computing elements to send information to each other; Sometimes it acts as a bridge in one way (e.g. a mouse sending input signals to a laptop using a USB socket). However, interfaces, which we also call interfaces, generally work in two directions.
API, which stands for Application Programming Interface, can be used for web applications, operating systems, databases, hardware, graphics and software libraries. As we will go into detail in a moment, API is not just for application development.
When it comes to an API, much more than just transferring data happens behind the scenes. The rules regarding which data requests can be made are determined here, how the requests will be made is defined, and the format in which the data should be is stated. In summary, APIs, which act as a tool, perform many important functions and help us make programming much easier.
Thanks to APIs, the operation of the computer system and all background details are hidden from the programmer, and only the necessary tools are easily accessed. While some programming interfaces are very broad in scope, some have more specific roles to serve a more limited purpose.
Graphics APIs
If you play PC games, you must be familiar with the leading APIs used to create 3D graphics; OpenGL, Direct3D and Vulkan. These act as the basic scaffolding for any rendering code, allowing programmers to create complex visuals with relative ease.
Graphics APIs lay out specific rules for how things should be formatted and structured, and provide simple instructions for manipulating routine mathematical algorithms. These have all been significantly updated over the years and can be used to do more than create beautiful images thanks to computational shaders.
Gaming platforms other than computers also make use of APIs: Microsoft uses a modified version of Direct3D for the Xbox, while Nintendo (Switch) and Sony (PlayStation) use their own APIs. tiring. But both of these ultimately rely on OpenGL. If you are playing games on your phone, there are various graphics APIs available, such as Metal, which is exclusive to Apple products.
You may remember that in the 1990s, some video card manufacturers had their own APIs; 3dfx had Glide and S3 Graphics had S3D APIs. This was because OpenGL was relatively new and lacked the feature set and performance that manufacturers needed.
For a time, Glide was the leader in graphics APIs because it was easy to program and made the best possible use of 3dfx’s Voodoo architecture. Glide and S3D had a very short lifespan because they were not open source but rather proprietary APIs. In fact, Direct3D is not open source either, but except that it is limited to Windows, any GPU manufacturer can create drivers to support it in their products.
However, proprietary graphics APIs are still used in various areas today. While NVIDIA’s CUDA API is specific to on-premises GPUs, it’s geared toward general-purpose computing rather than 3D rendering.
In 2013, AMD began working to create a ‘low-level’ API in collaboration with the developers of the Battlefield games. AMD’s goal for Mantle was to be less CPU dependent than Direct3D and OpenGL while also offering more programmability. Development of the project was stopped in 2015 and ended in 2019 due to the red team transferring its work free of charge to the Khronos Group, the organization responsible for Vulkan. It was completely shelved until now.
DirectX 12 vs DirectX 11
The most important difference between DirectX 11 and DirectX 12 is that DirectX 11 is a high-level API while DirectX 12 is a low-level API. There are several layers between your game and your hardware. Low-level APIs are closer to the hardware, while high-level APIs are further away and more general.
In short, DirectX 12 allows game developers to target optimizations closer to the hardware, reducing overhead from the API and graphics driver. In turn, it is also harder for developers to work.
When DirectX 12 was released, it showed slightly lower performance than DirectX 11 due to its complex structure. However, over the past few years, developers have, somewhat out of necessity, focused more on DirectX 12 and made more optimizations. We will come to performance tests in a moment, but we can say that DirectX 12 performs better than DirectX 11 in most games, although not in every game.
Although there are many technical differences between DirectX 11 and DirectX 12, gamers look directly at performance. In some games, DX 12 and in some games, DX 11 API provides better performance. shows. By the way, API is not the only factor in performance. Some games do not benefit much from DirectX 12 because these games generally have low-level optimization. For example, there is basically no change in the performance of Dying Light 2. However, a major improvement is seen in Civilization VI, which features massive AI workloads that take advantage of asynchronous computation. Shadow of the Tomb Raider and Tiny Tina’s Wonderlands are also games that work better with DX12.
DirectX vs Vulkan
In fact, when making comparisons, it is necessary to consider DirectX 11 and DirectX 12 separately. There are significant differences between the two DX versions, including significant performance differences. Everything varies even between DX versions, but let’s take a look at the differences between DirectX and Vulkan in general. First, let’s discuss the development processes and dates.
PC Gaming World Created with DirectX
Originally, DirectX was developed by a team at Microsoft for the purpose of helping developers play games on Windows-based PCs. Before DirectX appeared, developers preferred to make games for DOS and did not think about releasing new games for Windows.
The period we are talking about coincides with the release of Windows 95. At that time, console games were growing as well as DOS games. DirectX 1.0 was released in September 1995 and was called Windows Game SDK.
Alex St John, who is part of the DirectX team, explained in an interview that Microsoft had to persistently persuade game developers to start using DirectX. Developers’ concerns were listened to and subsequently used as integral feedback to improve gaming on Windows, allowing developers to begin making new games for the operating system used by millions. dÄ ±.
In the early days of DirectX, some crazy marketing tactics were adopted to encourage the gaming industry to use the API and motivate developers to make Windows PC games. Thanks to DirectX, game developers have the opportunity to use PC hardware without having to deal with the operating system too much.
DirectSound (responsible for audio processing), DirectPlay (handling in-game communications) and DirectDraw (graphics rendering) are all part of DirectX 1.0, which was then called “Game SDK” or “Project Manhattan”. It was the chassis. Nowadays DirectX is known as a collection of APIs and is widely used for many games. In other words, DirectX is a collection of APIs that contain more than one thing. As we mentioned, DX11 is very widely used. The latest version is DX12.
Vulcan’s Adventure
As for Vulkan, its foundations date back to the introduction of the Mantle API by American chip manufacturer AMD. AMD worked with DICE to create Mantle. Vulkan was used in games such as Sniper Elite III, Battlefield 4 and Civilization: Beyond Earth.
Vulkan has been touted to have better performance than DirectX 11. Moreover, there were claims that it increased performance in situations where the CPU was clogged. More game engines started using Mantle as an API. However, despite all the efforts and advantages, Vulkan was not adopted as quickly as expected. Over time, the chip maker transferred the Mantle API (as a “donation”) to Khronos Group.
Later, Khronos introduced Vulkan as a new graphics API at GDC 2015. Today, Vulkan is more widely known and is finding a place in more and more games. In addition to DirectX 11/12, it is used in many games.
The most important difference of Vulkan compared to DirectX is that it is a cross-platform API (desktop and mobile). So, while DirectX is exclusive to Windows PCs, Vulkan is compatible with many different platforms besides Windows: Linux, Android, Nintendo and macOS. In this way, developers can do things more easily when they want to release a game to more than one platform.
In the long run, this could be a win-win factor for Vulkan. As games continue to shift away from traditional PC and consoles towards mobile and cloud-based gaming, focusing on Vulkan could become much more attractive for developers.
Both DirectX and Vulkan have improved greatly in the last five years and have their own advantages. Now let’s discuss these and compare the performance of DirectX and Vulkan in various games today.
What are the differences?
It is known that Vulkan uses its hardware resources more efficiently. In other words, it is stated that the use of CPU, GPU and RAM is more “balanced” compared to DirectX 12. Vulkan is a lower level API and open source. It is also an API that works cross-platform, so developers can save time if they want to publish their games on both PC and mobile platforms. Besides, some say that Vulkan is more complex to use, which can increase the total time spent compared to other APIs.
From a developer’s perspective, Vulkan’s open source and cross-platform nature makes it very attractive to use. However, there is also a lot of educational material for those new to graphics and game development to learn Vulkan. Some even say that the Vulkan API has better documentation, is easier to use and cleaner than DirectX. As we mentioned, in some games we have the chance to choose between the two.
On the other hand, DirectX is used for Windows PCs and Xbox game consoles. However, Vulkan can be used on Linux, Windows and mobile platforms. Nintendo Switch has an Nvidia Tegra GPU, which is also known to support Vulkan. Sony, the name behind PlayStation, reportedly has better APIs than those on PC: PlayStation APIs are very direct and impose very low overhead.
Which one should be chosen?
You may see DirectX 12, Vulkan, or both in many modern games and applications. You are given a choice between these before starting or installing. If you’re asking which one is best, the answer depends on your PC hardware, the genre of the game, and various factors like whether you care more about visual effects or a high frame rate. Depends.
It also depends on the way game developers use APIs and their application skills. Developing games for DirectX 12 is more difficult, but since it has been around longer than Vulkan, developers are more familiar with it.
As we mentioned, Vulkan is a low-load API: Depending on the scenario, it may require less system resources than DirectX in terms of CPU calculation, memory and bandwidth. This makes it a better option than DirectX 12 on low-spec computers. Or at least with a weaker CPU.
Most benchmark tests show Vulkan slightly ahead in frame rates, but it should be noted that there is more frequent FPS fluctuation. So the general opinion is that even if Vulkan performs better, DirectX offers a much more stable gaming experience.
Visually, you can see perhaps very minor differences between a game running Vulkan and DirectX 12. If the same in-game graphics settings are applied, there is no difference between Vulkan and DirectX in a game like Red Dead Redemption 2.
On paper, DirectX 12 (and DX 12 Ultimate) looks like a better API for CPU/GPU intensive games. If your computer can run a game in DX 12 without any problems, there is no reason not to use it. If there is no graphics API option, the user has to play with whatever the game uses. However, if you have the option, it would be beneficial to test your games using different APIs. Test both for 10 minutes and see for yourself which one offers the best gaming experience.
Some people may say that Vulkan runs better in a game, while others may say that DirectX is more successful. Answers will vary from game to game, hardware to hardware. Graphics cards are the most important component at this point. Some people say that Vulkan performs better when using AMD graphics cards.
Vulkan can be used with both AMD and NVIDIA graphics cards. But as we just said, the Vulkan API is derived from an older AMD API called Mantle. For this reason, we can consider it normal that Vulkan works a little better with AMD GPUs than with NVIDIA cards.
Vulkan Supported Games and Applications
You can access the current list of games and applications developed with Vulkan below: