Directx 12 11: What is the Difference Between DirectX 11 and DirectX 12

What is the Difference Between DirectX 11 and DirectX 12

DirectX 12 debuted two years back, promising significant performance and efficiency boosts across the board. This includes better CPU utilization, closer to metal access as well as a host of new features most notably ray-tracing or DXR (DirectX Ray-tracing). But what exactly is DirectX 12 and how is it different from DirectX 11. Let’s have a look.

What is DirectX: It’s an API

Like Vulkan and OpenGL, DirectX is an API that allows you to run video games on your computer. However, unlike its counterparts, DX is a Microsoft proprietary platform and only runs on Windows natively. OpenGL and Vulkan, on the other hand, run on Mac as well as Linux.

Now, what does a graphics API like DirectX do? It acts as an intermediate between the game engine and the graphics drivers, which in turn interact with the OS Kernel. A graphics API is a platform where the actual game designing and mechanics are figured out. Think of it as MS Paint where the game is the painting and the paint application is the API. However, unlike paint, the output program of a graphics API is only readable by the API used to design it. In general, an API is designed for a specific OS. That’s the reason why PS4 games don’t run on the Xbox One and vise versa.

DirectX 12 Ultimate is the first graphics API that breaks that rule. It will be used on both Windows as well as the next-gen Xbox Series X. With DX12 Ultimate, MS is basically integrating the two platforms.

DirectX 11 vs DirectX 12: What Does it Mean for PC Gamers

There are three main advantages of the DirectX 12 API for PC gamers:

Better Scaling with Multi-Core CPUs

CPU overhead with DX11 and 12 (lower is better)

One of the core advantages of low-level APIs like DirectX 12 and Vulkan is improved CPU utilization. Traditionally with DirectX 9 and 11 based games, most games only used 2-4 cores for the various mechanics: Physics, AI, draw-calls, etc. Some games were even limited to one. With DirectX 12 that has changed. The load is more evenly distributed across all cores, making multi-core CPUs more relevant for gamers.

Maximum hardware utilization

Many of you might have noticed that in the beginning, AMD GPUs favored DirectX 12 titles more than rival NVIDIA parts. Why is that?

The reason is better utilization. Traditionally, NVIDIA has had much better driver support while AMD hardware has always suffered from the lack thereof. DirectX 12 adds many technologies to improve utilization such as asynchronous compute which allows multiple stages of the pipeline to be executed simultaneously (read: Compute and Graphics). This makes poor driver support a less pressing concern.

Closer to Metal Support

Another major advantage of DirectX 12 is that developers have more control over how their game utilizes the hardware. Earlier this was more abstract and was mostly taken care of by the drivers and the API (although some engines like Frostbyte and Unreal provided low-level tools as well).

Source: PCWorld

Now the task falls to the developers. They have closer to metal access, meaning that most of the rendering responsibilities and resource allocation are handled by the game engines with some help from the graphics drivers.

This is a double-edged sword as there are multiple GPU architectures out in the wild and for indie devs, it’s impossible to optimize their game for all of them. Luckily, third-party engines like Unreal, CryEngine, and Unity do this for them and they only have to focus on designing.

How DirectX 12 Improves Performance by Optimizing Hardware Utilization

Again, there are a few main API advances that facilitate this gain:

Per-Call API Context

Like every application, graphics APIs like DirectX also feature a primary thread that keeps track of the internal API state (resources, their allocation, and availability). With DirectX 9 and 11, there’s a global state (or context). The games you run on your PC modify this state via draw calls to the API, after which it’s submitted to the GPU for execution. Since there’s a single global state/context (and a single main thread on which it’s run), it makes it difficult to multi-thread as multiple draw calls simultaneously can cause errors. Furthermore, modifying the global state via state calls is a relatively slower process, further complicating the entire process.

With DirectX 12, the draw calls are more flexible. Instead of a single global state (context), each draw call from the application has its own smaller state (see PSOs below for more). These draw calls contain the required data and associated pointers within and are independent of other calls and their states. This allows the use of multiple threads for different draw calls.

Pipeline State Objects

In DirectX 11, the objects in the GPU pipeline exist across a wide range of states such as Vertex Shader, Hull Shader, Geometry shader, etc. These states are often interdependent on one another and the next successive one can’t progress unless the previous stage is defined. When the geometry from a scene is sent to the GPU for rendering, the resources and hardware required can vary depending on the rasterizer state, blend state, depth stencil state, culling, etc.

Each of the objects in DirectX 11 needs to be defined individually (at runtime) and the next state can’t be executed until the previous one has been finalized as they require different hardware units (shaders vs ROPs, TMUs, etc). This effectively leaves the hardware under-utilized resulting in increased overhead and reduced draw calls.

In the above comparison, HW state 1 represents the shader code, 2 is a combination of the rasterizer and the control flow linking the rasterizer to the shaders. State 3 is the linkage between the blend and pixel shader. The Vertex Shader affects HW states 1 & 2, the Rasterizer state 2, Pixel shader states 1-3, and so on. As already explained in the above section, this introduces some additional CPU overhead as the driver generally prefers to wait till the dependencies are resolved.

DirectX 12 replaces the various states with Pipeline State Objects (PSO) which are finalized upon creation itself. A PSO in simple words is an object that describes the state of the draw call it represents. An application can create as many PSOs as required and can switch between them as needed. These PSOs include the bytecode for all shaders including, vertex, pixel, domain, hull, and geometry shader and can be converted into any state as per requirement without depending on any other object or state.

SourceNVIDIA’s Mesh and Task Shaders (Turing uarch)

NVIDIA and AMD’s latest GPUs, with the help of DirectX 12 introduce Task Shaders and Mesh Shaders. These two new shaders replace the various cumbersome shader stages involved in the DX11 pipeline for a more flexible approach.

The mesh shader performs the same task as the domain and geometry shaders but internally it uses a multi-threaded instead of a single-threaded model. The task shader works similarly. The major difference here is that while the input of the hull shader was patches and the output of the tessellated object, the task shader’s input and output are user-defined.

In the below scene, there are thousands of objects that need to be rendered. In the traditional model, each of them would require a unique draw call from the CPU. However, with the task shader, a list of objects using a single draw call is sent. The task shader then processes this list in parallel and assigns work to the mesh shader (which also works synchronously) after which the scene is sent to the rasterizer for 3D to 2D conversion.

This approach helps reduce the number of CPU draw calls per scene significantly, thereby increasing the level of detail.

Mesh shaders also facilitate the culling of unused triangles. This is done using the amplification shader. It runs prior to the mesh shader and determines the number of mesh shader thread groups needed. They test the various meshlets for possible intersections and screen visibility and then carry out the required culling. Geometry culling at this early rendering stage significantly improves performance. You can read more here…

NVIDIA’s Mesh and Hull Shaders also leverage DX12

  • AMD Radeon RDNA 2 “Big Navi” Architectural Deep Dive: A Focus on Efficiency

Command Queue

With DirectX 11, there’s only a single queue going to the GPU. This leads to uneven distribution of load across various CPU cores, essentially crippling multi-threaded CPUs.

Continue reading on the next page…

1 2Next page

How is DirectX 12 Different From 11?

SOURCE: Xbox

DirectX is an API (Application Programming Interface) thats used for virtually all Windows games and the Xbox console family (originally the DirectX Box). DirectX 12 hardware is now common and thanks to the Xbox Series consoles, games for DirectX 12 are quickly becoming the norm, but how is 12 better than 11?

First, Whats a DirectX?

DirectX is the middleman between computer hardware and software. Video games or other high-performance applications that need to use hardware like the GPU are written according to the specifications set out by DirectX. In turn, DirectX-compatible GPUs (which are all of them today) are also designed to comply with the DirectX standards.

This means that, unlike the old days of DOS games and IRQ settings, no developer has to write software for a specific GPU or sound card. As long as everything is DirectX-compatible, it will work.

More Cores = More Better With DirectX 12

Source: Microsoft

For years gamers had no reason to get CPUs with more than four cores. Developers found it difficult to take advantage of multiple threads in their games and only recently, with octa-core consoles, have we really started to see games that are designed with multiple concurrent threads to run different systems.

DirectX 12 moves a lot of the work to get games working over multiple CPUs away from developers and builds it into the API itself. This is part of the drive with DirectX 12 to get the most out of your PC hardware, rather than only using a portion of its potential.

Asynchronous Compute

GPUs can do a lot more than graphics these days, from running machine learning algorithms to accelerating data decompression from a high-speed SSD, there seems to be nothing these mini supercomputers cant do.

The problem is that when you try to do graphics and general computer jobs concurrently, you get performance inconsistencies as the GPU switches between the two contexts. The asynchronous compute feature of DX12 allows access to the different specialized engines of the GPU that do tasks like shading pixels, or running ML tasks.

DirectX 12 Gets Down to Bare Metal

SOURCE: Nvidia

One of the biggest changes in DirectX 12 is that developers have much more direct control of the computers hardware. In other words, the layer of abstractions that DirectX represents is much thinner with DirectX 12.

This means game developers and other graphics software creators get access to the GPU at a low level, making it possible to get more performance out of a computer and achieve visuals that would not have been possible before.

This is however a double-edged sword since developers who dont have the right expertise can end up with games that have performance problems or inconsistencies without the built-in optimizations that DirectX 11 does in the background at the cost of taking some control from the coders.

What is DirectX 12 Ultimate?

DirectX 12 Ultimate is the latest version of DirectX 12 and includes new features that only the latest hardware can offer. Examples of these include support for ray tracing. That is, ray tracing for any DirectX 12 Ultimate compatible GPU, not just Nvidias proprietary RTX technology.

Another key feature of Ultimate is Variable Rate Shading (VRS) where the shading quality in a scene is dynamically altered so that resources are not wasted on pixels that dont need them. VRS is already a part of regular DirectX 12 but adds more features to it such as mesh shaders and sampler feedback.


is there a difference between them? / Video cards and monitors / iXBT Live

Video cards, games, processors are changing, and the change from DX11 to DX12 has been dragging on since 2015, so many have forgotten how these versions differ from each other, and what the new API will bring. For the most part, this is the fault of Microsoft itself, since they made DX12 the property of Win10 exclusively, stating that it was impossible to implement DX12 on older systems, but not so long ago there was information that DX12 support will still appear on win7, and the first game will be World of Warcraft. As a result, for a long time there were very few computers with support for DX12, so that game developers should generally pay attention to this segment. Perhaps only Microsoft itself and its subsidiaries have switched to a full-fledged release of games on DX12, but there were no significant masterpieces among them, and perhaps the most recognizable series is Forza Horizon.

However, at the beginning of 2019 the situation began to change, and, first of all, we already see in the STEAM statistics that the majority of computers (64.53%) already have both a video card and an operating system compatible with DX12, and it is worth recalling that the latter Microsoft and Sony generation of consoles also support DX12, which ultimately gives us the vast majority of gaming devices DX12 ready.

As a result, we see that at the end of 18 and the beginning of 19 more and more games are abandoning DX11 as the main API in favor of both DX12 and Vulkan. Here is their list:

  • Lara Croft Shadow of the Tomb Raider
  • Resident evil 2 (remake)
  • Crackdown 3
  • Metro Exodus
  • The Division2
  • Devil may cry 5

Vulkan or DX12

  • DOOM Eternal
  • Wolfenstein Youngblood
  • Serious Sam 4
  • Star wars fallen order
  • Rage 2

— in large projects, it is worth refreshing knowledge about this API. Most likely, you think that the main difference between DX12 and its predecessor is the possibility of ray tracing, and this is where all the differences end, but this is not at all the case. Let’s take a look at the differences between the two versions so we can better understand what these versions can and cannot do and what DX12 will really bring.

In addition to the mentioned ray tracing, DX12 included such technology as Multi Gpu — this is the ability to combine several video cards, even from different manufacturers, for image processing. Sounds great, but in my opinion, the technology has little chance of widespread adoption, and here’s why. For a game developer, you will first have to make just an incredible number of different variations of video cards work, then test it all, and this is a lot of time and a lot of costs, and the benefits from the introduction are doubtful. For a GPU developer, this will mean that you can buy a less powerful video card and install it in parallel, and this can be a video card from their competitor, as a result, this will affect the average price of devices purchased from them — in order to achieve the desired performance, it will be possible to buy a video card of a lower class. In general, it is worth remembering SLI and CrossFire — how many games support these technologies? So we got to the most significant differences between DX12 and its predecessor — work with CPU threads.

This is how an example of a game with DX11 looks like: one thread is responsible for video processing, other parts of the engine work on the rest, for example, the sound engine, the network part, NPC calculation, and so on, the main thing is that only 1 is responsible for the most capacious and complex part processor core. Theoretically, DX11 can work with a maximum of two threads, but, unfortunately, as practice shows, this remains only a theory. DX12 is already capable of working with eight threads, and it looks like this:

DX12 distributes the largest task of data preparation and subsequent processing on the GPU among threads / cores, which positively affects performance. Performance, of course, does not increase by 8 times, since this process is not ideally scalable, and there are other bottlenecks. It’s funny to note that the results of work in the case of only one thread or eight are sent to the GPU and processed by thousands of CUDA or CU cores, depending on the GPU vendor.

What happens to the data that gets into the GPU?

At the top you can see the DX11 data processing sequence, which occurs in a strictly established order, and without completing the previous tasks, the next ones cannot be implemented, while DX12 has the ability to separate and execute these tasks on different cores of our GPU, which ensures a large load on the GPU itself and leads to a decrease in delays and an increase in FPS. It is important to note that the speed of execution of the elements themselves, which make up the entire task, does not increase. The entire performance gain is achieved only by optimizing the queue — this is called asynchronous computing.

Now let’s take a look at what specifically prepares the CPU for further processing on the GPU, if we see the final image in this form: than appropriate.

Each of the polygons is processed on the CPU and is called a draw call or draw call. Accordingly, the more polygons in the frame we see, the greater the load on the CPU, such situations are most typical for open world games and the appearance of a large number of objects in the frame, especially if these are very detailed objects like NPCs. In other cases — when we look at the sky or see a small number of polygons in some limited space, for example, a corridor, where there are not so many draw calls, the advantages of DX12 fade. Let’s move on to the conclusions from the theoretical part of getting to know DX12.

  1. Visually, DX12 has very few advantages over DX11 — rays are the most striking difference.

  2. Programming under DX12 is more difficult, and the full benefits of the new API are only fully realized when the engine is initially developed, not adapted for it.

  3. For simple scenes, where there are few objects / objects and polygons in the frame, DX12 may show lower performance compared to DX11, since all draw calls are perfectly processed on 1 processor core, and in the case of DX12, the results of eight threads still needs to be synced. This can be true for entire games, not just scenes, as long as they have simple graphics at their core.

  4. DX12 does not reduce the load on the processor, but, on the contrary, increases it, only in this case the load is distributed up to 8 processor cores / threads and does not fall on 1 core.

  5. The gain from switching to DX12 will be for processors with low performance per core, but a large number of them, for example, like the FX series from AMD. 3D mark Api Overhead Test https://3dnews.ru/911658 that this is a synthetic test.

    Game tests

    Test configuration

    • FX 6300 @4500
    • DDR3 2133
    • RX 580 8GB
    Lara Croft Shadow Raider

    for consideration, for consideration, for consideration, take the latter for the consideration number of draw calls.

    Pay attention to the processor load: on the left DX11 74%, on the right DX12 100%.

    The first 3 values ​​refer to the last test scene, the fourth value is the result for all three scenes. It is noteworthy that the maximum frame that was noted was at the time of displaying exactly a piece of the sky, and there is no difference between the APIs, while the largest difference was noted in the minimum frames, and it reaches an impressive 43%. That is, in the most graphically loaded complex scenes, we see the greatest benefit from switching to DX12.

    Resident Evil 2 remake

    In this test, we see much less trivial results: a drop in the maximum and average frames, but also an increase in the minimum values ​​by as much as 33%. That is, in moments where the performance of 1 thread is enough, DX11 is even faster, but as soon as the scene becomes more complicated and the performance of 1 thread is not enough, DX12 opens up, which transfers the entire gameplay to 60+ frames, and DX11 drops to conditionally unplayable 45. I’m afraid It is precisely with such results that testers dislike DX12 because it may have fewer maximum frames, and even, which may seem completely unacceptable, medium frames, however, paradoxically, DX12 is more comfortable for the game.

    Let’s move on to pairing with other video cards and processors and see the results. To do this, we will choose 4 games:

    • Lara Croft Shadow of the Tomb Raider
    • Resident Evil 2 remake
    • Division2
    • Metro Exodus

    All these games work in both DX11 and DX12 modes. Let’s compare what will be the changes from changing the API. In all tests, the 9900K was used as a CPU overclocked to 5.0. In other words, we will see a situation where the processor did not limit our performance.

    The data in the table is the % change between APIs. Interestingly, Pascal family video cards respond differently to DX12, despite the same architecture they are based on, there is no increase on lower models, whether this is due to the driver or hardware is beyond the scope of this blog. Only one thing needs to be stated: on video cards that formally support DX12_1, there may not be an increase from switching to the new API. On the other hand, the RX 580 video card, which formally supports only DX12_0, gives an increase of 9% as the top GTX 2080, the increase in Vega video cards reaches 17%, which is simply an amazing result. In any case, we are seeing performance gains of 5% to almost 20% on the latest series of graphics cards, and this is a very significant change. What can I say — even in conjunction with a powerful processor on modern video cards, switching to DX12 is justified and increases performance, if you run similar tests with a less productive processor, the differences will be even more significant.

    It’s fair to say that Nvidia has traditionally had good performance under DX11, and one would argue that DX12 simply might not offer the same benefits as the competition. Let’s digress a bit from the topic of API comparison and take a closer look at the video cards themselves.

    Well, in DX11 we see the total dominance of Nvidia products, and only Vega 56 is slightly ahead of its counterpart in the form of the GTX1070.

    However, when switching to DX12, the situation changes dramatically, and Vega 56 is already 13% ahead of the GTX 1070 and 7.6% behind the GTX1080, while Vega 64 is ahead of the GTX 1080 by 5. 4% and falls short of the RTX 2070 by only 2%! Yes, it looks like AMD paid a lot of attention to DX12 in its presentations — indeed, their products feel much better under the new API.

    As a conclusion, we can say that for owners of old processors who have purchased one of the latest series of video cards, switching to DX12 in their favorite game will give a noticeable increase in performance up to 50%, when using DX12 on top video cards and processors, the gain in DX12 can be 10 -20%, which is also extremely high, so more and more developers are paying attention to the new API, and if in 19 at least 50% of the large, so-called AAA games came out with DX12 support, then with the release of new generation consoles both from Microsoft and Sony, the gaming industry will finally switch to a new standard, so when buying a video card, you should already pay attention mainly to tests in this API. Therefore, say, the new Turing series in the form of 1660 1660ti 1650 1650ti can be much more attractive than it might seem at first glance. compared to 1050ti, 1060, 1070 they really work faster under the new API.

    Latest test results taken from gamegpu.com

    You can find more of my tests and reviews on my youtube channel.

    P.S. Speaking about the differences between Vulkan and DX12, it should be mentioned that the latter includes DirectX Audio, which standardizes work with audio, which greatly simplifies development, there is nothing like this in Vulkan. Also, these APIs differ in the topology of their work, and programming under them is somewhat different, but the main goal of DX12 and Vulkan is to decouple the work of drawing calls from the core alone, and both APIs cope with this task.

    How to install the latest version of DirectX

    Windows 8.1 Windows 8.1 Enterprise Windows 8.1 Pro Windows 8 Windows 8 Enterprise Windows 8 Pro Windows RT Windows 7 Enterprise Windows 7 Home Basic Windows 7 Home Premium Windows 7 Professional Windows 7 Starter Windows 7 Ultimate Windows Server 2008 R2 Datacenter Windows Server 2008 R2 Enterprise Windows Server 2008 R2 for Itanium-Based Systems Windows Server 2008 R2 Standard Windows Vista Business Windows Vista Enterprise Windows Vista Home Basic Windows Vista Home Premium Windows Vista Starter Windows Vista Ultimate Windows Server 2008 Datacenter Windows Server 2008 Enterprise Windows Server 2008 for Itanium-Based Systems Windows Server 2008 Standard Microsoft Windows XP Service Pack 3 Microsoft Windows Server 2003 Service Pack 1 Microsoft Windows Server 2003 Service Pack 2 Windows 10 More. ..Less

    What is DirectX?

    DirectX is a set of components in the Windows operating system that allows software, primarily computer games, to communicate directly with video and audio hardware. Games that use DirectX can make better use of the media acceleration features built into your hardware, resulting in improved performance for multimedia tasks.

    Determining the version of DirectX installed on the computer

    The DxDiag tool provides detailed information about the DirectX components and drivers that are installed on your system and available for use.

    1. Click the Start button, type dxdiag in the search box, and then press Enter.

    2. Check line DirectX Version on the first page of the report under System Information .

    1. Swipe in from the right edge of the screen to the center and tap the Search button. Enter request dxdiag in the search field. Or type dxdiag into the search bar in the start menu.

    2. Select item dxdiag in the list of search results

    3. Click the Start button and type dxdiag into the search field.

    4. Select item dxdiag in the list of search results

    5. Check line DirectX Version on the first page of the report under System Information .

    DirectX Versions and Updates Through the Operating System

    These versions of Windows have DirectX 11. 3 and 12 pre-installed.

    Updates will be available through Windows Update. There is no separate DirectX version data pack.

    • DirectX 11.1 is preinstalled on Windows 8, Windows RT, and Windows Server 2012 There is no separate update package for DirectX 11.1. You can only install this version of DirectX through Windows Update on Windows 8, Windows RT, and Windows Server 2012 systems.0003

    • DirectX 11.2 is preinstalled on Windows 8.1, Windows RT 8.1, and Windows Server 2012 R2 systems. There is no separate update package for DirectX 11.2. This version of DirectX can only be installed through Windows Update on Windows 8.1, Windows RT 8.1, and Windows Server 2012 R2.

    Note. To continue updating DirectX, you need to update your operating system.

    • DirectX 11.0 is preinstalled on Windows 7 and Server 2008 R2 systems. There is no separate update package for this version. You can update DirectX by installing the service pack as well as the updates listed below.

    • DirectX 11.1

      is available for installation on Windows 7 SP1 and Windows Server 2008 RS SP1 systems with the Platform Update for Windows 7 and Windows Server 2008 (KB2670838).

    Note. To continue updating DirectX, you need to update your operating system.

    • DirectX 10 is preinstalled on Windows Vista systems. There is no separate update package for this version. You can update DirectX by installing the service pack as well as the updates listed below.

    • DirectX 10.1 is preinstalled on Windows Vista SP1 or later and Windows Server SP1 or later. There is no separate update package for this version. You can update DirectX by installing the service pack as well as the updates listed below.

    • DirectX 11.0 is available for installation on Windows Vista SP2 and Windows Server 2008 SP2 with KB9 installed71512.

    Note. To continue updating DirectX, you need to update your operating system.

    DirectX 9.0c is available for installation on Windows XP and Windows Server 2003 systems using the DirectX 9.