Wednesday, October 12, 2011

DirectX

Windows 98 and Windows NT 4.0 both shipped with DirectX. DirectX is a collection of APIs for handling video and gaming programming. Its functionality is provided in the form of COM-style objects and interfaces. The components of DirectX are:
- DirectDraw, Direct3D, Direct2D, DXGI, DirectWrite, DirectCompute,
- DirectInput, DirectPlay, DirectX Diagnostics (DxDiag), DirectSetup
- DirectSound, DirectSound3D, DirectMusic (replaced with XAudio2 and XACT3)
- Direct Media Objects, DirectMedia, DirectShow.

DirectX versions
5.2 (8/97) - Available as a beta for Windows 2000 that would install on NT 4.0
7.0 (2/00) - Windows 2000
8.1 (11/01) - Windows XP, Windows Server 2003 and Xbox
8.2 (02) - same as 8.1b (fix to DirectShow on Win2K) but includes DirectPlay 8.2
9.0 (12/02) - 9.0c Windows XP SP2 (8/04), SP3 (4/08)
10 (11/06) - Windows Vista exclusive
10.1 (4/09) - SP2 for Windows Vista, Windows Server 2008, includes Direct3D 10.1
11 (2/11) - SP1 for Windows 7, Windows Server 2008 R2
11.1 (9/11) - Windows 8 Developer Preview

DirectX 8 & 9
DirectX was also used as a basis for Microsoft's Xbox and Xbox 360 console API. The API was developed jointly between Microsoft and Nvidia. The Xbox API is similar to DirectX version 8.1. In 2002, Microsoft released DirectX 9 with support for the use of much longer shader programs than before with pixel and vertex shader version 2.0. In 2004, DirectX 9.0c was released with shader model 3.0.

DirectX 10
Windows Vista includes a new version of Direct3D, called Direct3D 10. It adds scheduling and memory virtualization capabilities to the graphics subsystem. The Direct3D 10 incorporates Microsoft's High Level Shader Language 4.0. The API introduces unified vertex and pixel shaders. In addition, it also supports Geometry Shaders, which operate on entire geometric primitives (points, lines, and triangles), and can allow calculations based on adjacent primitives as well. The output of the geometry shader can be passed directly onwards to the rasterizer for interpolation and pixel shading, or written to a vertex buffer (known as 'stream out') to be fed back into the beginning of the pipeline.

Direct3D 10 is not backward compatible like prior versions of DirectX. Its functionality requires WDDM (Windows Display Driver Model) and new graphics hardware. The graphics hardware will be pre-emptively multithreaded, to allow multiple threads to use the GPU in turns. It will also provide paging of the graphics memory.

Many former parts of DirectX API were deprecated in the latest DirectX SDK and will be preserved for compatibility only:
- DirectInput was deprecated in favor of XInput,
- DirectSound was deprecated in favor of the Cross-platform Audio Creation Tool system (XACT) and lost support for hardware accelerated audio, since Vista audio stack renders sound in software on the CPU.
- DirectPlay DPLAY.DLL was also removed and was replaced with dplayx.dll; games that rely on this DLL must duplicate it and rename it to dplay.dll.

Direct3D 10.1 is an incremental update of Direct3D 10.0, requires video card supports Shader Model 4.1 or higher and 32-bit floating-point operations - adds support for cube map arrays, separate blend modes per-MRT, coverage mask export from a pixel shader, ability to run pixel shader per sample, access to multi-sampled depth buffers.

DirectX 11
Direct3D 11 is a strict superset of Direct3D 10.1 — all hardware and API features of version 10.1 are retained, and new features are added only when necessary for exposing new functionality. New features: GPGPU support (DirectCompute), and Direct3D11 with tessellation support and improved multi-threading support to assist video game developers in developing games that better utilize multi-core processors. Hardware tessellation and Shader Model 5.0 require Direct3D 11 supporting hardware.

Direct3D 11 runtime introduces Direct3D 9, 10, and 10.1 "feature levels", compatibility modes which allow use of only the hardware features defined in the specified version of Direct3D. For Direct3D 9 hardware, there are three different feature levels, grouped by common capabilities of "low", "med" and "high-end" video cards; the runtime directly uses Direct3D 9 DDI provided in all WDDM drivers.

DirectX 11.1 is included in Windows 8.
It supports WDDM 1.2 for increased performance, features:
- tighter integration of Direct2D, Direct3D, and DirectCompute
- DirectXMath, XAudio2, and XInput libraries from the XNA framework
- features stereoscopic 3D support for gaming and video