What is DirectX 12?

DirectX 12

DirectX 12 is the new 3D graphics API in Windows 10. This allows games to make better use of GPUs for both graphics and computation purposes.

DirectX 12’s asynchronous compute features enable GPUs to work on multiple tasks simultaneously without scheduling delays – allowing for significant progress to be made in short amounts of time.

Asynchronous Compute

DirectX 11 featured one queue that processed graphics, compute, and copy workloads; with DirectX 12, however, multiple queues can now be created depending on what work needs to be completed – an approach known as Asynchronous Compute that enables more parallel operations for improved CPU-bound performance.

Asynchronous compute allows shader and compute commands to be submitted simultaneously yet asynchronously to a GPU, using multi-threaded command buffers like deferred contexts and graphics queues as conduits for this process. Once launched on the GPU, graphics and compute stages run asynchronously alongside one another on its memory; with results from compute stage being updated in real-time by graphics work in deferred context – all made possible thanks to fences used to coordinate command queues across GPU.

As one of the more significant hardware features unveiled by DX12 and Vulkan APIs (and Mantle before them) to game developers, this one has gained significant attention – particularly from AMD, who has taken an outspoken stance against it.

Though async compute may offer benefits to some games, its effectiveness depends on their respective CPU workloads and how easily they can be moved onto GPU. Unfortunately, complex tasks cannot always be transferred over to this feature and may only experience minor performance gains from it.

Before incorporating intraframe async compute into their games, game developers are strongly advised to conduct extensive intraframe async compute tests at various resolutions to ensure sufficient overlap potential to justify any additional GPU work load. They should also observe how higher end GPUs feature more SM units which increase the probability of compute workload overlaps.

Helldivers 2 is one game which already uses async compute, developed and published by Arrowhead Game Studios and Sony, that utilizes it. Enabling this setting may improve performance on older or weaker CPUs while disabling it may result in better frame rates for some players.

Shader Model 3.

Shader models play an essential part in how well your graphics card performs when rendering games and other graphics-intensive applications. They determine the capabilities and performance of GPUs in certain tasks such as displaying images with high quality and realism; with more advanced shader models offering additional features and capabilities resulting in increased performance, higher image realism, and overall improved quality and realism of rendered images or graphics.

A new shader model allows hardware to access a larger number of layers in multisampled textures, providing support for higher resolution and more detailed visuals as well as more efficient buffer fetching to reduce CPU utilization while increasing GPU performance.

DirectX 12 Ultimate is Microsoft’s newest API designed to give developers everything they need to develop games and other graphics-intensive apps, from games with ray tracing and mesh shading support, all the way up to hardware-accelerated shaders for improved performance and efficiency. It supports an array of graphics-intensive features such as ray tracing and mesh shading; additionally it is the first to introduce shaders that offer significant gains in efficiency.

The latest version of API brings improvements to its programmable shader model. DirectX uses its shader model as a programming model for GPUs using High Level Shading Language (HLSL), and each successive shader model builds upon previous ones to offer more functionality while eliminating restrictions.

Shader model 1 only supported a limited set of C-like instructions and had various restrictions imposed by early programmable hardware in DirectX-compatible GPUs, whereas shader model 2 allowed more complex operations and increased instruction counts, but still had limitations imposed by its early programmable hardware architecture. Shader model 3 offered more capability while having less restrictions while providing performance benefits like software vertex shaders that ran at speeds similar to fast shader hardware on fast CPUs.

Your best option to determine the programmable shader model of your hardware is running the DirectX Diagnostic Tool in Windows by typing “dxdiag” in Run dialog, GPU-Z is another freeware program which displays details about GPU and displays its programmable shader model, or you could visit NVIDIA or AMD websites and get their specs for your GPU directly.

DirectX Raytracing

With Nvidia’s recent introduction of its RTX GPUs, Microsoft is finally making ray tracing part of DirectX as a first-class feature, opening it up for widespread experimentation by developers compared to current mainstream methods (rasterization). Ray tracing can provide more realistic reflections and shadows compared to its alternative, rasterization.

At its core, a ray-tracing pipeline involves having your geometry, shaders and an acceleration structure all working in concert to calculate each pixel of a scene. When rendering begins, GPU execution of these shaders in parallel will calculate the ray-traced pixels before rendering them out onscreen. Writing one in C++ may prove challenging; therefore it would likely be wiser to first gain experience with basic graphics programming techniques (transformation matrices, vertex arrays, depth buffers etc) before taking on such an ambitious endeavor. Previous experience using simpler APIs like OpenGL will further ease this task.

DirectX 12 includes an abstraction layer that allows developers to specify graphs of work with shader code at each node without being concerned with which hardware they’re running on. Thanks to their asynchronous nature, the system can decide the optimal way for each node’s shader code execution based on specific hardware types – increasing overall performance across a spectrum of systems.

Performance in computer graphics can vary considerably depending on the hardware in use and other factors. Wccftech’s tests have revealed that some games do not see any benefit from asynchronous compute while others like Dying Light 2 and Civilization VI can experience dramatic speedups due to asynchronous compute – although, it should be noted that these synthetic tests focus solely on high-level features like how many draw calls occur per second.

Developers’ primary concern regarding DirectX 12 is how well it supports real-world ray-tracing. One title which recently tested this theory out was Oxide Games’ real-time strategy game Ashes of the Singularity; recently it was confirmed that Oxide’s game proved its suitability for this kind of work; even if you don’t plan to explore ray tracing yourself, DirectX 12 can still make for low overhead graphics applications.

Adapters

DirectX 12 API offers an adapter class which enables you to easily create devices and other important data structures, particularly useful when searching for GPUs that support various rendering or ray tracing functions. Furthermore, this class also helps debug API usage by creating a Debug Controller alongside factory which validates API usage validation; however it should only be used during debug builds as the adapter class may cause some performance overhead.

Implementing an adapter class should adhere to the Single Responsibility Principle by isolating interface or data format conversion from your primary business logic, making changes or extensions simpler without disrupting core functionality. This approach is known as the Adapter Pattern.

DirectX 12 allows PC gamers to utilize multiple physical GPUs for improved game performance by linking them together. Microsoft’s DirectX 12 multiadapter technology attempts to establish a unique link among all available GPUs on one PC – even those from different manufacturers or configurations such as Crossfire or SLI – creating an optimal linkage that lets gamers take full advantage of their GPU hardware by unlocking features previously impossible or very challenging to implement.

DirectX 12 takes this one step further by offering multiadapter support that allows your application to select its adapter of choice – unlike with SLI-style multiadapters, which required specifying bit masks – instead, simply selecting adapter class allows your app to take advantage of features such as Unified Memory and Linked Mode.

Press ESC to close