What is the Differences Between The DirectX 11 and DirextX 12?
DirectX 12 was released two years ago. Higher quality in performance and efficiency was among the most important features offered to users during this period. Features included better CPU utilization and closer metal access. Additionally, ray tracing and DXR (DirectX ray tracing) technologies were also among them. So what is DirectX 12? And what kind of differences exist between DirectX 11 and DirectX12? On this page, you can take a look at detailed information on the subject.
What is DirectX? : DirectX In Its Simplest Definition Is An Application Programming Interface (API)
DirectX is an API or application programming interface that enables video games to be run on computers. At this point, we can say that DirectX is similar to Vulkan and OpenGL interfaces. Unlike its other examples, DX is a platform built to run at Microsoft. This platform can only operate locally at Microsoft. OpenGL and Vulkan, on the other hand, can run on Mac as well as Linux operating systems.
So, what does DirectX, a graphical application programming interface, do? It works as an intermediary between the DirectX graphics driver and the game engine. It also interacts with the kernel. Graphics application interfaces take place in game design and mechanics. This can be thought of as the Microsoft Paint application. Painting and using paint in game paint can also be considered as a programming interface. But unlike paint, the graphics API output program can only be read by the API used in the design. Usually APIs are designed for a specific operating system. For example, this is also the reason why PS4 games cannot run on Xbox One.
DirectX 12 Ultimate is the first API to break this generalization. DirectX 12 will be available on both Windows and Xbox Series X. So DirectX Ultimate combines the two platforms.
DirectX 11 vs DirectX 12: What PC Gamers Should Know
Some API improvements make these gains simpler:
Per Call Programming Interface Content
As with any application, DirectX-like graphics APIs include core threading features such as resources, allocation, and availability tracking internal API status. With DirectX 9 or 11, this reaches a global scale. Games running on PC change this state through draw calls to the API and then send it to the GPU for application. Since there is only one global context and thread in its operation, draw calls can prevent multi-threading as they can throw constant errors. Changing the global state with status calls is a slower process and can complicate the whole process.
With DirectX 12, draw calls become flexible. Instead of a single global state, each draw call of the application has its own smaller state. These draw calls host the required data and associated pointers and operate independently of other calls and their states. This creates the environment for different draw calls to use multiple threads.
Pipeline State Objects
In DirectX 11, objects in the GPU pipeline take place in a wide range of states such as,
- Vertex
- Shader
- Hull Shader
- Geometry Shader.
These states are often dependent on each other, and the next stage cannot begin until the previous stage is terminated. When geometry in a scene is sent to the graphics processing unit for rendering, the required resources and hardware may vary in terms of blending, depth patterning, and splitting.
All objects in DirectX must be individually defined at runtime. Also, the other state cannot start before the previous state terminates because they require different hardware parts such as shader, TMU and ROPs. In this case, the hardware becomes insufficient and the draw calls decrease as the load increases.
In the above comparison, the HW 1 state represents the shader code, while 2 is a combination of the rasterizer and control flow and connects the rasterizer and shaders. Case 3 also represents the link between the blend and the pixel shader. Vertex shader affects HW 1 and 2 states, rasterizer 2 states, and pixel shader 1 and 3 states. As mentioned earlier, additional CPU loads come into play as the driver often waits for connections to be resolved.
Replaces Pipeline State Objects (PSO) that are committed after DirectX 12 is created, with various states. Simply defined, Pipeline State Objects is an object that specifies the state of the draw call it represents. An application can create the required amount of PSO and switch between them according to the needs. These PSOs contain bytecode for all shaders, including vertex, pixel, domain, hull, and geometric shader, and can be converted to any other state or object-independent state per need.
The latest GPUs from AMD and NVIDIA offer Task and Network Shaders with the help of DirectX 12. The recently introduced shaders replace the different heavy-handed shader stages in the DX 11 Pipeline for a more flexible approach.
The mesh shader performs the same task as the domain and geometric shaders, but internally it uses a multi-threaded model rather than a single-threaded model. The task shader works in a similar way. The biggest difference at this point is that the input and output of the body shader is patches and the output of the mosaic object, while the input and output of the task shader are defined by the users.
In the section below, there are thousands of objects that need to be processed. In the traditional model, each requires a separate draw call from the CPU. But thanks to the task shader, different objects are using a single call sent. The task shader then processes these objects in parallel and forwards the work to the network shader running concurrently. The scene is then sent to the rasterizer for 3D or 2D conversion.
This approach helps to significantly reduce the amount of draw calls per scene, increasing the level of detail.
Another feature of mesh shaders is making it easy to select unused triangles via the amplification shader. This phase occurs before the shadow shader and determines the required number of network shader thread groups. These test various mesh for possible interactions and screen visibility and perform the desired extractions. Geometry extraction at this early stage of machining largely proves performance quality.
Scripting
DirectX 11 only has one string sent to the GPU. This can cause an uneven distribution of CPU cores and break multi-threaded CPUs.
This can be mitigated to a certain extent through the term context, but even then there is a stream of commands sent to the CPU in the final stage. DirectX 12 introduces a new model that increases multi-use by using scripts that can be applied separately. This model allows simultaneous execution by dividing the workload into smaller commands that need different resources. Asynchronous computing also works in a similar way by dividing graph and calculation instructions into different sequences and executing them at the same time.
Resource Binding
Resource binding in DirectX 11 is rather abstract and useful, if not hardware usage. So much so that some other hardware components were unused or left idle. Most game engines use view objects to allocate resources and connect them to various shader stages in the GPU pipeline.
Objects are connected to slots along the pipeline while drawing. Shaders also generate needed data from these slots. This model also has a downside. That is, when the game engine needs a different resource, the bindings become dysfunctional and have to be reallocated.
DirectX 12 replaces source views with descriptive stacks and tables. An identifier is a small object that contains information about a resource. These are grouped together to form descriptive tables that are sequentially stored in heaps.
In the best-case scenario, the descriptor table stores information about some type of resource. In addition, the stack contains all the tables needed to create one to more frames. The GPU pipeline provides access to this data with the help of the descriptive table index.
The descriptor stack already contains the necessary descriptor data. Descriptive tables are changed when a different collection of resources is needed, which is much more efficient than linking resources from scratch.
Other features of DirectX 12 are the new graphic effects smoke, fire and lighting, and a low CPU load with a low level API.
DirectX Ray Tracing (DXR): NVIDIA calls ray tracing RTX and is an API support for real-time ray tracing.
Variable Rate Shading: Variable rate shading helps focus the GPU on the parts of the screen that are more visible and affected per frame. For example, in a marksman, this area is the area around the crosshair. In contrast, the area near the screen border is often out of focus and may be ignored up to a certain point.
This allows developers to focus on parts that affect significant visual quality and reduces surrounding shading.
DHG is divided into two: Content Adaptive Shading and Motion Adaptive Shading
The IUG 16×16 allows all of the screen tiles to be individually shaded, allowing the GPU to increase the shader ratio in salient parts and decrease in other parts.
Motion-adaptive shading, as the name suggests, increases the shading rate of objects in motion. In addition, it also reduces the shading rate of stationary objects. For example, in racing games, the shading of cars will increase, and the sky and areas off the road will not have priority.
Multi-GPU Support: DirectX 12 has two types of multi-GPU support, on and off. What is closed is essentially SLI/XFX and leaves the job to the vendor driver. The open one is more interesting and allows the game engine to control how two GPUs work in parallel. This allows for scaling, mixing and matching of different GPUs, including those from different vendors (including dGPU and iGPU).
Another major advantage is that the VRAM images of the two GPUs are not mirrored and can be stored to double the video memory. These and many other features make DirectX 12 an important advancement in the software space of PC gaming.
What are the Differences Between DirectX 12 Ultimate and DirectX 12?
DirectX 12 Ultimate is a progressively upgraded version of the existing DirectX 12. Its main advantage is that it is cross-platform supported. New Xbox Series X games and PC games can use it together. Also, DirectX 12 Ultimate simplifies porting between platforms, making it easy for developers to optimize their games for the latest hardware.
When the Xbox Series X came out last year, developers had long been using hardware that worked with the same graphics APIs (NVIDIA Turing). This made the migration and optimization process much easier. In addition, it increases performance, allowing the use of the latest PC hardware. In conclusion, we can characterize DirectX 12 as a step in which Microsoft aims to bring the Xbox and PC gaming platforms together.
In addition, DirectX ray tracing 1.1, sampler feedback, mesh shaders and variable rate shading concepts are also introduced to users with this step. Network shader and variable rate shader were previously supported on NVIDIA's RTX Turing GPUs but will now be adopted by developers as well as for upcoming games.
Texture Sampler Feedback: DOGB is an issue that Microsoft attaches great importance to. We can say that DÖGB keeps track of the textures that are shown and not shown in the game. Then the unused textures are discarded from memory and contribute to the net VRAM usage up to 2.5 times. For global without DOGB, all texture resources are loaded into memory. In the case of DÖGB, only the parts seen on the screen are kept, while the unused bits are discarded and valuable memory is preserved.
This can also be done temporarily between frames. Objects that are far away in a mostly static image may use reshading over many frames (for example, 2 to 4 or more frames). Saved graphics performance can be used to improve the quality of nearby objects or places that have a noticeable effect on quality.
DXR 1.1 is a minor improvement over the existing 1.0 version:
In this, ray tracing is completely controlled by the GPU and draw calls from the CPU are not needed. Thus, the CPU load is reduced and performance is increased.
New ray tracing shaders can be installed as needed, depending on the player's position in the game world.
One of the main additions to DirectX 12 is line ray tracing. Developers become more authoritative over the ray tracing process. This feature, which can be used at any stage of the rendering pipeline, may be preferred when the shading complexity is minimal.