Tutorials

▷ Directx 12 vs vulkan: the fight for the best graphics engine?

Table of contents:

Anonim

Currently for the PC world there are two first-class graphical APIs that manage the market with authority. For this reason we bring you the DirectX 12 Vs Vulkan comparison.

Both have a long history behind them and a whole horde of defenders and detractors. Today we will see the differences, the keys of each one and we will try to offer some light on them.

Index of contents

Low level graphic API and “Driver overhead”

API stands for "application programming interface" and is a set of subroutines that can be used by a developer that also includes communication protocols and utilities that facilitate software development. We can find them for almost everything and it is common for each service provider to have this type of aid to implement their systems in a simple and accessible way.

Low-level APIs take better advantage of the GPU's resources, relieving the CPU, but are also able to take better advantage of the multi-core processors that we have today.

Both DirectX 12 and Vulkan 1.1 are APIs oriented to the development of games and applications that require the assistance of modern graphics engines. At the same time, they are APIs supported by the drivers of the most important graphic chipset designers and therefore a fast and economical way to access their features without having to know their design at a very low level.

A low-level API, such as these, allows working with the hardware with a very light interpretation layer, which allows the developer to take better advantage of the hardware, achieving better results in terms of performance and efficiency, also allowing other subsystems to be freed of additional load. In the world of the PC, or mobile phones, it is less dependent on the general CPU of the system.

The two APIs that we will talk about today can be considered low-level APIs and both developments have resulted in a less and less dependence on the system's CPU while achieving better results at the performance level and access to more graphical functions. advanced. They are two live APIs that are receiving updates annually to keep them in line with what the general public and developers expect.

Low-level APIs have a direct effect on another computational concept that we know as “driver overhead”, which is, in short, the secondary resources that we need to execute certain types of operations on a computer. In the case of graphics it refers to the extra resources that the graphics card requires to do its job and in this case it is fundamentally central CPU process times. The low-level APIs we will describe here reduce this dependency and in fact the dependency tends to 0.

Microsoft DirectX

DirectX arises as a necessity to standardize different Windows multimedia subsystems and is the substitute for WinG for Windows 3.1. It is adopted in Windows 95 as an add-on package and its second version, DirectX 2.0, becomes a fundamental component of Windows 95 OSR2.

Within DirectX we find multiple independent APIs such as Direct3D, which is really the one in question, DirectDraw, DirectMusic, DirectPlay and DirectSound. DirectX was a way to name common advancements across all of these sub-APIs. It is an API for Windows but it is also used for the development of games on its Xbox consoles so we can consider it a Multiplatform API but not free, as is the case with Vulkan.

DirectX 12, its latest version, has been with us since 2014 and has not stood still and a few months ago received important improvements such as the Direct Ray Tracing (DXR) subroutine that was included in the 1809 october update version of Windows 10.

Low-level APIs like DirectX 12 have a fundamental advantage, which is the reduction of the driver overhead. Programmers are now empowered to design how the GPU will behave in their programs and can better manage GPU resources, especially by taking advantage of process parallelization. This includes better support for multiple GPUs in one system and even if they are not from the same manufacturer.

They can execute different types of operations, usually "integer" or "floating point" taking advantage of the capabilities of the compatible graphics and also dividing complex operations into simpler ones by processing them in parallel on those larger buses. A good example is how AMD or Nvidia can now process 16-Bit operations on their 32-Bit buses, substantially improving the efficiency of their graphics.

This API has brought the efficiency of use of a console GPU closer, where the developers know perfectly the available hardware, up to the heterogeneous ecosystem that forms a PC with infinite different hardware possibilities.

Currently DirectX 12 is available, by surprise, for Windows 7 and Windows 10 and although it is not directly compatible with Xbox One, the truth is that practically 90% of its functionality is used for PC, the differences are minimal and that has allowed developers quick adaptations of their PC games for Xbox One and vice versa.

Vulkan of Khronos

Vulkan is the evolution to OpenGL's low-level API and is supported by the Khronos Corporation. In the PC world they have a secondary role over DirectX 12 but its different adaptations to different platforms, such as Android, have made it a benchmark in graphics for mobility. It is also compatible with Linux being the great alternative of game in free systems.

Its great virtue is its great parallel processing capacity, being extremely efficient in modern CPUs and GPUs, achieving low uses of the former and a great use of the hardware of the latter. It is specially designed to take advantage of multi-core processors achieving an excellent load distribution in this type of processors, in fact, it is so much more efficient for the more cores we can provide.

Vulkan's history dates back to a year after DirectX 12 and Khronos, which is a non-profit company, maintains it as often or more frequently than Microsoft does with its own API. It is based on the API Mantle that AMD developed for its GCN architecture and that was another low-level API for a reduced “overhead driver”. AMD donated its developments to Khronos and these are the foundations of one of the best graphical APIs on the market.

In addition to superior parallelization, this design also allows the precompilation of shading operations on the GPU to be eliminated, being able to have more effects and on screen with higher loading speed, in addition to a more detailed adjustment of how the hardware processes operations or how we access frame buffer available. It is surely the API for PC that is closest to the hardware itself, even better than DirectX 12.

Vulkan also introduces low-level API improvements on Android and other platforms.

Its latest version, Vulkan 1.1, introduced at the end of 2018 adds important improvements such as HLSL support, which is DirectX 12's alternative to managing shader operations without precompilation, better compatibility with DirectX 12 (to its many subroutines apart from the graphics), explicit support for Multi-GPU systems regardless of the manufacturer and, of course, support for RayTracing.

Strengths and weaknesses of DirectX 12 vs Vulkan

In addition to the common features already described, such as better use of hardware, more control of it and better use of parallelization of both GPU and CPU, these two APIs also add the possibility of performing general computation operations with graphics chips with that are compatible. This enables compatible graphics engines, several generations already, to be able to perform complex mathematical operations that can be exploited by programs of all kinds, including those without graphic components.

In games they can also be used for increasingly important secondary operations such as the calculation of realistic physics, artificial intelligence, positional sound effects, etc.

Both APIs have great support by the greats of graphics, both AMD and Nvidia strive to offer these APIs the appropriate drivers to achieve both offer their users the latest improvements and strengthen the performance and stability of games that use one or another API.

The "driver overhead" of both is very low, in fact, as you will see in our tests there are hardly any differences between them, which is also a sign of the important optimization of the drivers of both manufacturers.

We have limited the framerate to 120FPS for a demo of Driver Overhead. In Dota 2 CPU consumption is substantially reduced with the same FPS.

The only more obvious difference is that Vulkan has somewhat less dependency on the CPU, with lower average consumption and that it is also much more open to different platforms, including Windows and Linux and its homogenization with OpenGL ES, which is its mobile version, it is on its way further unifying the platforms on which it moves.

DirectX 12 has in its favor the great acceptance by the developers, who seem to find in this API the perfect ecosystem to reduce their costs since it even has a great integration in frameworks as widespread as the.NET Framework where it integrates with a thousand wonders with little loss of performance.

Performance differences in games with double API

As the movement is demonstrated by walking, we have carried out some performance tests in different games and benchmarks that have the ability to use these two APIs for execution.

3DMark Driver Overhead Test. Results in millions of requests, more is better.

Ashes of the singulity. Results in FPS, more is better.

Strange Brigade. Results in FPS, more is better.

We summarize the best hardware guides that should interest you:

  • Best processors on the market Best motherboards on the market Best RAM memory on the market Best graphics cards on the market Best SSDs on the market Better chassis or PC cases Better power supplies Better heatsinks and liquid coolers

As you can see, the results are even and we see differences between programs for and against one and the other. This leaves us with the question of which is better and the answer is clear, it depends on the program and how its developer knows or wants to take advantage of its benefits. What remains is to think that in each game the developers will use precisely the API that best takes advantage of the benefits of our graphics, although it is clear that both options seem more than competent. What did you think of our article on Directx 12 vs Vulkan ? We want to know your opinion!

Tutorials

Editor's choice

Back to top button