Microsoft’s next generation of multimedia libraries was drawing near, and the coming update was expected to make a far bigger impact than its predecessors. Here’s why.
Most people have heard of DirectX. Many install it without giving much thought to what it does—and, for everyday use, they don’t really need to know. If it helps games run, that is often enough. Still curious? DirectX is a collection of APIs used to program multimedia features. An API (Application Programming Interface) provides programming resources—such as functions and routines—that let software interact with a particular device.
DirectX includes APIs such as Direct3D for 3D graphics, DirectSound for audio and DirectPlay for network communications. The latest version available to ordinary users at the time was DirectX 9.0c, whose specifications included support for Shader Model 3.0. With DirectX 10 on the horizon, Microsoft had also distributed a test version to developers so they could explore its features and report bugs. For background on Shader Model 3.0 and shaders in general—which come up repeatedly in this article—see the article “Pixel and Vertex Shaders” in this section.
The name of DirectX 10’s 3D graphics API had not yet been finalized. It might therefore appear under names such as Windows Graphics Foundation, DirectX Next or Direct3D 10. This article focuses on that graphics API, but uses DirectX 10 to refer to the package as a whole.
The DirectX diagnostic window can reveal potential problems with its operation.
The latest version of DirectX can be downloaded from Microsoft’s website.
From DirectX 3 to DirectX 9
Microsoft released the first version of DirectX quite some time ago: DirectX 3. Versions 5, 6 and 7 followed, each with different changes, and together they helped establish DirectX as a Windows standard. The real revolution began with DirectX 8, which introduced shader instructions. Before then, developers were limited to the built-in operations a GPU could perform. Programmable shaders opened up far more freedom in creating 3D scenes.
There were still constraints, however, in the resources available to programs: variables, constants and registers, particularly how many of each they could use. With DirectX 9.0c—after several intervening releases—this was no longer a serious obstacle for developers. In fact, even today, applications do not fully exploit what Shader Model 3.0, included with DirectX 9.0c, can do.
That does not mean the latest DirectX revision was without serious limitations. Graphics processors were the current performance bottleneck, but some underlying design issues could cause trouble in the future if left unaddressed. DirectX 10 was meant to tackle them. First, though, it helps to understand what those issues were.
Take a look at what DirectX 3 could do. What were you expecting—a Far Cry?
Version 7 was the step before the big change.
If Shader Model 2.0 (DirectX 9) can do this, imagine what version 4.0 might manage.
DirectX 8 introduced shaders. Here, 3DMark 2001 puts them to work.
The small batch bottleneck and idle shader units
One limitation is known as the small batch problem. When rendering a 3D scene, an application first calls the API, which communicates with the video driver; the driver then sends instructions to the GPU. The CPU handles these preliminary steps, consuming valuable processing cycles. This overhead was estimated to take up as much as 40% of execution time.
The cost becomes especially significant when many distinct objects must appear on screen at once. At a given moment, the estimated limit was about 500 objects per frame. Exceeding it could create a CPU bottleneck and noticeably hurt performance. Developers therefore had to balance the workload using various techniques. For example, a forest in a game might be built by reusing one tree model many times, with small variations between instances. Even so, this was a problem in need of a timely fix.
The other major limitation lay in how shaders worked. In computer GPUs of the time—unlike the Xbox 360—there were fixed numbers of pixel processors (Pixel shader units) and a considerably smaller number of vertex processors (Vertex shader units). Because of the architecture, the two kinds of processor worked separately, with their workload depending on the scene.
Games were making increasingly heavy use of shaders. When a scene demanded a lot of work from one type of unit, those processors could be pushed to their limits while the other type sat idle. A scene requiring extensive vertex processing, for instance, could keep the Vertex shader units busy while the Pixel shader units waited; the reverse could happen in a pixel-intensive scene. DirectX 10 was expected to address this waste by supporting unified shaders.
This diagram clearly shows the wasted time known as “small batch.”
Shader-intensive scenes expose weaknesses in the current architecture.
Unified shaders and the Geometry shader
Combining vertex and pixel processors in a single unit was a logical response to these shortcomings. That is what unified shaders means. DirectX 10 was also expected to support another kind of shader in that same unit: the Geometry shader, one of the most interesting additions planned for the new DirectX release.
The Geometry shader adds a stage to the image-generation pipeline. It receives triangles and manipulates them using their vertex data, then passes the result to the Pixel shader unit to have its color filled in. In simple terms, it works like a considerably more capable Vertex shader. Effects such as real-time deformation could become more precise and striking, while familiar effects such as motion blur could also benefit.
Once the Geometry shader joined the unified-shader unit, the architecture would no longer keep Pixel and Vertex shader processors in separate groups. But all those resources would need to be coordinated. That was the job of the arbitration unit: it would receive instructions for the GPU and arrange them into execution threads according to which resources—Pixel, Vertex or Geometry shaders—were most needed to render the scene. In shader-heavy applications, that should make better use of every part of the unified unit.
This capability also suggested a broader role for the GPU. Rather than handling only image processing, it might take on other tasks, including physics calculations, artificial intelligence and animation—something like a chip combining CPU and GPU capabilities. That idea was theoretical at the time, but an exciting prospect.
ATI had taken the first major step in this direction by making Xenos, the GPU in the Xbox 360, with unified shaders. Its X1000 line used a hybrid architecture, a kind of stepping stone toward the full unification planned for the upcoming R600. The experience ATI gained through its work with Microsoft on the console was expected to help make unified shaders in its future GPU more efficient.
So where did DirectX 10 fit in? It was to be the first API providing a platform for using the benefits of unified shaders. That did not mean it required a GPU with unified hardware: a GPU with separate units could also be compatible, provided it included a Geometry shader unit to complete every stage of the pipeline.
Xenos, the GPU ATI made for the Xbox 360, was the first attempt at unifying shaders.
Need for Speed Underground used motion blur to heighten the sense of speed.
This is how a GPU without unified shaders would need to be arranged to support DirectX 10.
The arbitration unit organizes processing between the parts of the unified-shader unit.
Windows Vista and the road ahead
DirectX 10 and unified shaders were presented as the near future of 3D graphics processing. Hardware would have to advance accordingly, so that it did not hold developers back when working with the API. The possibilities seemed enormous—far beyond what anyone could predict at the time.
Unfortunately, one factor cast a shadow over those promises: Windows Vista. Microsoft apparently had no plans to support the new API on Windows XP, making a move to Vista necessary for anyone who wanted to use the features described here. A compatible graphics card and a game designed to take advantage of DirectX 10 would also be needed. Microsoft itself claimed the API would be up to eight times faster than its predecessor at performing its task.
DirectX 10 would not be backward-compatible with DirectX 9.0. To preserve support for graphics processors capable of handling Shader Model 2.0, Windows Vista would also include DirectX 9.0L. The two libraries would coexist in the operating system, allowing games that used the older features to keep working.
Microsoft’s intentions were plain. Windows XP was firmly established despite persistent criticism of its security, making it hard to persuade users to upgrade their computers and adopt Vista. Bundling DirectX 10 with Vista, withholding compatibility from earlier Windows versions, and securing exclusive support from some game developers all pointed to a strategy for positioning Vista as the better choice over XP.
For all that, DirectX 10 promised advances that had seemed unimaginable not long before. PC games might become significantly more realistic, provided developers did their part. It felt like the beginning of something big—very big. If Microsoft’s estimates held up, users would begin to see what DirectX 10 could do around the beginning of the following year, when Vista was due to launch. There was plenty to look forward to.
Windows Vista is key to bringing DirectX 10 successfully to users.
Leaving Windows XP behind will be difficult, but it is a necessary step to stay at the cutting edge of technology.
DirectX Developer Center