He said that in the early 1980s through the early 1990s, there was competition between PHIGS and IRIS GL APIs. Now, there is competition between DX11 and OpenGL, DirectX 12 and Vulkan. However, “one is not necessarily better than the other,” he explained.
Back in the early days of computer graphics, there were only applications communicating directly with graphics hardware through the use of setting hardware registers. As operating systems became more complex and applications no longer had direct access to hardware, some standards had to be defined.
As games became more complex, the game “logic code” that changed the state of a game world was supplemented by the game rendering engine – or code that called on-screen objects to be implemented using low-level graphics API commands - meshes, shaders and textures, etc.
Modern graphics drivers are now very large, in that they must implement many APIs (DirectX 9, 10, 11, OpenGL). They are also required to have backward compatibility that often does not reflect the most efficient GPU operation, resulting in performance overheads.
High-level vs low-level APIs
Spitzer explains that higher-level APIs allow developers to optimize the driver “under the covers,” while low-level APIs restrict driver optimizations.
High-level APIs, including Java 3D, Java FX, OPEN GL Performer, OpenSceneGraph and others, give the most priority to the driver at the lowest end, followed by the API in the middle and the application at the top.
On the other hand, low-level APIs (Direct3D, Mantle, Metal, OpenGL, Vulkan, etc) give most priority to applications, followed by the API in the middle, and then the driver. The biggest drawback is that using a low-level API takes a lot more expertise and more effort, and there is a lot of opportunity for mismanagement without proper knowledge of how to code for specific GPU architectures.
DirectX 11 debuted with Windows 7 and is a high-level API that offers “hundreds of engineer years of driver-side optimizations,” with most resource management handled by the driver. It also has mature tools, and the SLI average frame rate yields good performance.
DirectX 12 was introduced with Windows 8.1 as a low-level API that offers asynchronous compute, advanced dispatch and synchronization, separate graphics, compute and copy queues. It uses multi-core CPUs and generally provides better performance on low-end CPUs. While this release can more efficiently handle SLI draw requests and determine which work is best done on each GPU, there is still a common drawback among many developer teams of not properly making the best use of each CPU core. One of its main advantages is the introduction of asynchronous compute, which allows GPUs to run non-graphics workloads for effects such as post-processing, lighting and physics.
Battlefield 1 performance has doubled as developers discover how to use DX12
During the presentation, one of the games highlighted for reference with its DirectX 12 support was Battlefield 1. Since the EA game was released in July as an alpha until its retail debut in October, performance improvements made to the app itself had effectively doubled as developers fine-tuned their training and understanding of how to best apply DX12 draw calls, and making the most effective use of asynchronous shaders to handle several tasks concurrently.
“With Battlefield 1, performance has nearly doubled since the alpha release in finding how to make the most out of the DX12 low-level API. It takes an enormous amount of effort to take full advantage of it.”
Vulkan API performance has increased by over 60 percent
When the company introduced its Vulkan API in February of last year, it wanted to differ from DirectX and Mantle by being a considerably lower-level API with reduced driver overhead and CPU workloads. However, performance was not nearly where the company wanted it to be in comparison with OpenGL. In September 2016, performance was about on par with OpenGL, though it has now increased by over 60 percent as the company looks to offer it as a much more parallelized successor to OpenGL.