Direct3D

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Direct3D is part of Microsoft's DirectX application programming interface (API). Direct3D is available for Microsoft Windows operating systems (Windows 95 and above), and for other platforms through the open source software Wine. It is the base for the vector graphics API on the Xbox and Xbox 360 console systems. Direct3D is used to render three-dimensional graphics in applications where performance is important, such as games. Direct3D also allows applications to run fullscreen instead of embedded in a window, though they can still run in a window if programmed for that feature. Direct3D uses hardware acceleration if it is available on the graphics card, allowing for hardware acceleration of the entire 3D rendering pipeline or even only partial acceleration. Direct3D exposes the advanced graphics capabilities of 3D graphics hardware, including z-buffering, spatial anti-aliasing, alpha blending, mipmapping, atmospheric effects, and perspective-correct texture mapping. Integration with other DirectX technologies enables Direct3D to deliver such features as video mapping, hardware 3D rendering in 2D overlay planes, and even sprites, providing the use of 2D and 3D graphics in interactive media ties.

Direct3D is a 3D API. That is, it contains many commands for 3D rendering; however, since version 8, Direct3D has superseded the old DirectDraw framework and also taken responsibility for the rendering of 2D graphics.[1] Microsoft strives to continually update Direct3D to support the latest technology available on 3D graphics cards. Direct3D offers full vertex software emulation but no pixel software emulation for features not available in hardware. For example, if software programmed using Direct3D requires pixel shaders and the video card on the user's computer does not support that feature, Direct3D will not emulate it, although it will compute and render the polygons and textures of the 3D models, albeit at a usually degraded quality and performance compared to the hardware equivalent. The API does include a Reference Rasterizer (or REF device), which emulates a generic graphics card in software, although it is too slow for most real-time 3D applications and is typically only used for debugging. A new real-time software rasterizer, WARP, designed to emulate complete feature set of Direct3D 10.1, is included with Windows 7 and Windows Vista Service Pack 2 with the Platform Update; its performance is said to be on par with lower-end 3D cards on multi-core CPUs.[2]

Direct3D's main competitor is OpenGL. There are many features and issues that proponents of either API disagree over, see Comparison of OpenGL and Direct3D for a summary. Attempts by Microsoft and SGI to unify OpenGL and Direct3D were undertaken in the 1990s, but eventually halted.

History[edit]

In 1992, Servan Keondjian started a company named RenderMorphics, which developed a 3D graphics API named Reality Lab, which was used in medical imaging and CAD software. Two versions of this API were released. Microsoft bought RenderMorphics in February 1995, bringing Keondjian on board to implement a 3D graphics engine for Windows 95. This resulted in the first version of Direct3D that shipped in DirectX 2.0 and DirectX 3.0.

Direct3D initially implemented "retained mode" and "immediate mode" 3D APIs. The retained mode was a COM-based scene graph API that attained little adoption. Game developers clamored for more direct control of the hardware's activities than the Direct3D retained mode could provide. Only two games that sold a significant volume, Lego Island and Lego Rock Raiders, were based on the Direct3D retained mode, so Microsoft did not update the retained mode after DirectX 3.0.

The first version of Direct3D immediate mode was based on an "execute buffer" programming model that Microsoft hoped hardware vendors would support directly. Execute buffers were intended to be allocated in hardware memory and parsed by the hardware in order to perform the 3D rendering. They were extremely awkward to program, however, hindering adoption of the new API and stimulating calls for Microsoft to adopt OpenGL as the official 3D rendering API for games as well as workstation applications. (see OpenGL vs. Direct3D)

Rather than adopt OpenGL as a gaming API, Microsoft chose to continue improving Direct3D, not only to be competitive with OpenGL, but to compete more effectively with proprietary APIs such as 3dfx's Glide. A team in Redmond took over development of the Direct3D Immediate mode, while Servan's RenderMorphics team continued work on the Retained mode.

Direct3D 4[edit]

Direct3D 4 was the version of Direct3D that included changes for Microsoft's Talisman project, a novel 3D hardware spec which used sprite-based image composition as a way to boost 3D rendering performance. The basic idea behind Talisman was to render separate 3D objects to offscreen render buffers, and then compose those 2D "sprites" back into the main scene. The primary goal of this approach was that individual objects could be re-used over and over again, which lightens the load dramatically on the 3D rendering hardware. Unfortunately, hardware vendors at the time backed out from adopting the Talisman design and instead chose a brute force approach to improve raw performance of more traditional 3D rendering hardware. As a result, the Talisman project was cancelled before any hardware was sold to the public.

In order to support Talisman, the necessary improvement to Direct3D was the SetRenderTarget API. This API allowed rendering 3D objects to arbitrary offscreen surfaces, rather than being fixed only to the backbuffer. That newly rendered surface could then be used as a texture, allowing for complex, multi-stage effects. Although Talisman, and Direct3D 4, never shipped, this API revolutionized the capabilities of 3D hardware, and is the basis of almost every 3D visual effect to this day. At the time, though, not all hardware vendors had designs that could support SetRenderTarget, so adoption was not immediate and universal. The challenge for some hardware vendors were hard-coded designs that separated texture memory from backbuffer memory. It's interesting to note that some hardware vendors, who were quite dominant in the industry at the time but refused to change their designs, ultimately went out of business.

At the time, many other changes to Direct3D were taking place, such as support for compressed textures. However, since Direct3D 4 was never released, those features would have to wait until the release of Direct3D 5.

Hardware vendors worked closely with Microsoft on new features like SetRenderTarget and texture compression, and were forced to add vendor-specific extensions to their OpenGL drivers. This is noteworthy because there was a war raging between Direct3D and OpenGL and prior to this, OpenGL had a stronghold in the industry. Direct3D was arguably more flexible in terms of what hardware it supported, but it's required method of having to check "capability bits" was disliked and even ridiculed. However, the eventual proliferation of vendor-specific extensions in OpenGL rendered the argument somewhat moot.

Direct3D 5 to 9[edit]

Direct3D 5.0 introduced the DrawPrimitive API that eliminated the need for applications to construct execute buffers.

Direct3D 6.0 introduced numerous features to cover contemporary hardware (such as multitexture[3] and stencil buffers) as well as optimized geometry pipelines for x87, SSE and 3DNow! and optional texture management to simplify programming. Direct3D 6.0 also included support for features that had been licensed by Microsoft from specific hardware vendors for inclusion in the API, in exchange for the time-to-market advantage to the licensing vendor. S3 texture compression support was one such feature, renamed as DXTC for purposes of inclusion in the API. Another was TriTech's proprietary bump mapping technique. Microsoft included these features in DirectX, then added them to the requirements needed for drivers to get a Windows logo to encourage broad adoption of the features in other vendors' hardware.

Direct3D 7.0 introduced the .dds texture format[4] and support for transform and lighting hardware acceleration (first available on PC hardware with Nvidia's GeForce), as well as the ability to allocate vertex buffers in hardware memory. Hardware vertex buffers represent the first substantive improvement over OpenGL in DirectX history. Direct3D 7.0 also augmented DirectX support for multitexturing hardware, and represents the pinnacle of fixed-function multitexture pipeline features: although powerful, it was so complicated to program that a new programming model was needed to expose the shading capabilities of graphics hardware.

Direct3D 8.0 introduced programmability in the form of vertex and pixel shaders, enabling developers to write code without worrying about superfluous hardware state. The complexity of the shader programs depended on the complexity of the task, and the display driver compiled those shaders to instructions that could be understood by the hardware. Direct3D 8.0 and its programmable shading capabilities were the first major departure from an OpenGL-style fixed-function architecture, where drawing is controlled by a complicated state machine. Direct3D 8.0 also eliminated DirectDraw as a separate API.[5] Direct3D subsumed all remaining DirectDraw API calls still needed for application development, such as Present(), the function used to display rendering results.

Direct3D was not considered to be user friendly, but as of DirectX version 8.1, many usability problems were resolved. Direct3D 8 contained many powerful 3D graphics features, such as vertex shaders, pixel shaders, fog, bump mapping and texture mapping.

Direct3D 9.0 added a new version of the High Level Shader Language,[6] support for floating-point texture formats, Multiple Render Targets, and texture lookups in the vertex shader. An extension only available in Windows Vista, called Direct3D 9Ex (previously versioned 9.0L), allows the use of the advantages offered by Windows Vista's Windows Display Driver Model (WDDM) and is used for Windows Aero.[7] Direct3D 9Ex, in conjunction with DirectX 9 class WDDM drivers allows graphics memory to be virtualized and paged out to system memory, allows graphics operations to be interrupted and scheduled and allow DirectX surfaces to be shared across processes.[8] Direct3D 9.0Ex was previously known as version 1.0 of Windows Graphics Foundation (WGF).

Direct3D 10[edit]

Windows Vista includes a major update to the Direct3D API. Originally called WGF 2.0 (Windows Graphics Foundation 2.0), then DirectX 10 and DirectX Next, Direct3D 10 features an updated shader model 4.0 and optional interruptibility for shader programs.[8] In this model shaders still consist of fixed stages as on previous versions, but all stages support a nearly unified interface, as well as a unified access paradigm for resources such as textures and shader constants. The language itself has been extended to be more expressive, including integer operations, a greatly increased instruction count, and more C-like language constructs. In addition to the previously available vertex and pixel shader stages, the API includes a geometry shader stage that breaks the old model of one vertex in/one vertex out, to allow geometry to actually be generated from within a shader, allowing for complex geometry to be generated entirely on the graphics hardware.

Windows XP does not support DirectX 10 and above.

Unlike prior versions of the API, Direct3D 10 no longer uses "capability bits" (or "caps") to indicate which features are supported on a given graphics device. Instead, it defines a minimum standard of hardware capabilities which must be supported for a display system to be "Direct3D 10 compatible". This is a significant departure, with the goal of streamlining application code by removing capability-checking code and special cases based on the presence or absence of specific capabilities.

Because Direct3D 10 hardware was comparatively rare after the initial release of Windows Vista and because of the massive installed base of non-Direct3D 10 compatible graphics cards, the first Direct3D 10-compatible games still provide Direct3D 9 render paths. Examples of such titles are games originally written for Direct3D 9 and ported to Direct3D 10 after their release, such as Company of Heroes, or games originally developed for Direct3D 9 with a Direct3D 10 path retrofitted later in development, such as Hellgate: London or Crysis.

The DirectX 10 SDK became available in February 2007.[9]

New features:

  • Fixed pipelines[10] are being done away with in favor of fully programmable pipelines (often referred to as unified pipeline architecture), which can be programmed to emulate the same.
  • New state object to enable (mostly) the CPU to change states efficiently.
  • Shader model 4.0 enhances the programmability of the graphics pipeline. It adds instructions for integer and bitwise calculations.
  • Geometry shaders, which work on adjacent triangles which form a mesh.
  • Texture arrays enable swapping of textures in GPU without CPU intervention.
  • Predicated Rendering allows drawing calls to be ignored based on some other conditions. This enables rapid occlusion culling, which prevents objects from being rendered if it is not visible or too far to be visible.
  • Instancing 2.0 support, allowing multiple instances of similar meshes, such as armies, or grass or trees, to be rendered in a single draw call, reducing the processing time needed for multiple similar objects to that of a single one.[11]

Direct3D 10.1[edit]

Direct3D 10.1 was announced by Microsoft shortly after the release of Direct3D 10 as a minor update. The specification was finalized with the release of November 2007 DirectX SDK and the runtime was shipped with the Windows Vista SP1, which is available since mid-March 2008.

Direct3D 10.1 sets a few more image quality standards for graphics vendors, and gives developers more control over image quality.[12][13] Features include finer control over anti-aliasing (both multisampling and supersampling with per sample shading and application control over sample position) and more flexibilities to some of the existing features (cubemap arrays and independent blending modes). Direct3D 10.1 level hardware must support the following features:

Unlike Direct3D 10 which strictly required Direct3D 10-class hardware and driver interfaces, Direct3D 10.1 runtime can run on Direct3D 10.0 hardware using a concept of "feature levels",[14][15] but new features are supported exclusively by new hardware which expose feature level 10_1.

The only available Direct3D 10.1 hardware as of June 2008 were the Radeon HD 3000 series and Radeon HD 4000 series from ATI; in 2009, they were joined by Chrome 430/440GT GPUs from S3 Graphics and select lower-end models in GeForce 200 series from Nvidia. In 2011, Intel chipsets started supporting Direct3D 10.1 with the introduction of Intel HD Graphics 2000 (GMA HD).

Direct3D 11[edit]

Direct3D 11 was released as part of Windows 7. It was presented at Gamefest 2008 on July 22, 2008 and demonstrated at the Nvision 08 technical conference on August 26, 2008.[16][17] AMD previewed working DirectX11 hardware at Computex on June 3, 2009, running some DirectX 11 SDK samples.[18] Its features include:

Other notable features are the addition of two new texture compression algorithms for more efficient packing of high quality and HDR/alpha textures and an increased texture cache.

The Direct3D 11 runtime is able to run on Direct3D 9 and 10.x-class hardware and drivers using the concept of "feature levels", expanding on the functionality first introduced in Direct3D 10.1 runtime.[14][19][20] Feature levels allow developers to unify the rendering pipeline under Direct3D 11 API and make use of API improvements such as better resource management and multithreading even on entry-level cards, though advanced features such as new shader models and rendering stages will only be exposed on up-level hardware.[19][21] There are three "10 Level 9" profiles which encapsulate various capabilities of popular DirectX 9.0a cards, and Direct3D 10, 10.1, and 11 each have a separate feature level; each upper level is a strict superset of a lower level.[22]

Tessellation was earlier considered for Direct3D 10, but was later abandoned. GPUs such as Radeon R600 feature a tessellation engine that can be used with Direct3D 9/10/10.1[23][24][25] and OpenGL,[26] but it's not compatible with Direct3D 11 (according to Microsoft). Older graphics hardware such as Radeon 8xxx, GeForce 3/4 had support for another form of tesselation (RT patches, N patches) but those technologies never saw substantial use. As such, their support was dropped from newer hardware.

Microsoft has also hinted at other features such as order independent transparency, which was never exposed by the Direct3D API but supported almost transparently by early Direct3D hardware such as Videologic's PowerVR line of chips.

The Direct3D 11 Technical Preview has been included in November 2008 release of DirectX SDK.[27]

First seen in the Release Candidate version, Windows 7 integrates the first released Direct3D 11 support. The Platform Update for Windows Vista includes full-featured Direct3D 11 runtime and DXGI 1.1 update, as well as other related components from Windows 7 like WARP, Direct2D, DirectWrite, and WIC.[28][29]

Direct3D 11.1[edit]

Direct3D 11.1 is an update to the API that ships with Windows 8.[30] The Direct3D runtime in Windows 8 features DXGI 1.2 and requires new WDDM 1.2 device drivers.[31] Preliminary version of the Windows SDK for Windows 8 Developer Preview was released on September 13, 2011.

The new API features shader tracing, support for video playback, shader processing of video resources, and on-the-fly swapping between Direct3D 10 and 11 contexts and feature levels. Direct3D 11.1 includes new feature level 11_1, which brings minor updates to the shader language, such as larger constant buffers and optional double-precision instructions, as well as improved blending modes and mandatory support for 16-bit color formats to improve the performance of entry-level GPUs such as Intel HD Graphics.[31][32] WARP has been updated to support feature level 11_1.

The Platform Update for Windows 7 includes a limited set of features from Direct3D 11.1, though components that depend on WDDM 1.2 - such as feature level 11_1 and its related APIs, or quad buffering for stereoscopic rendering - are not present.[33][34]

Direct3D 11.2[edit]

Direct3D 11.2 was shipped with Windows 8.1.[35][36] New hardware features require DGXI 1.3[37] with WDDM 1.3 drivers[38] and include runtime shader modification and linking, low-latency drawing, and optional GPU overlays with frame-buffer scaling for all feature levels. Feature levels 11_0 and 11_1 introduce optional support for mappable default buffers and tiled resources[39] (page-based virtual memory). WARP was updated to fully support the new features.[35][40]

Direct3D 12[edit]

Direct3D 12 allows a lower level of hardware abstraction than earlier versions, enabling future games to significantly improve multithreaded scaling and (decrease) CPU utilization. This is achieved by better matching the Direct3D abstraction layer with the underlying hardware, by means of new features such as descriptor tables, concise pipeline state objects, and draw call bundles. Reducing driver overhead in fact the main attraction of Direct3D 12, similarly to AMD's Mantle (API);[41] in the words of its lead developer Max McMullen, the main goal of Direct3D 12 is to achieve "console-level efficiency".[42]

Direct3D 12 will be essentially supported on all Fermi and later Nvidia GPUs, on AMD's GCN-based chips and on Intel's Haswell and later processors' graphics units.[41]

At SIGGRAPH 2014 Intel released a demo showing an asteroid field, in which DirectX 12 was claimed to be 50%-70% faster than DirectX 11.[43][44]

The Xbox One will also receive DirectX 12 as a software upgrade. However, the special version of DirectX 11 (DirectX 11.X) that runs on the Xbox One already has some of the features of Direct X12, in particular it has draw bundles, from which the DirectX 12 bundles have evolved.[45] Microsoft has cautioned that the performance improvements that shall be brought by DirectX 12 on the Xbox One will (therefore) not be as dramatic as on the PC.[46] Independent developers have confirmed these reservations, noting that Xbox One hardware is rather limited by its (pixel) shaders.[47]

Although Nvidia has announced broad support for Direct3D 11, they were also somewhat reserved about the universal appeal of the new API, noting that while game engine developers may be enthusiastic about directly managing GPU resources from their application code, "a lot of [other] folks wouldn't" be happy to have to do that.[48]

Some new hardware features are also being considered for DirectX 12, including conservative rasterization and additional blend modes.[49]

Concise pipeline state objects[edit]

Pipeline state objects have evolved from DX11, and the new concise pipeline states mean that the process has been simplified. DirectX 11 was extremely flexible in how its states could be altered, to the detriment of performance. Simplifying the process and unifying the pipelines (e.g. pixel shader states) leads to a much more streamlined process, significantly reducing the overheads and allowing the graphics card to draw more calls for each frame.

Command lists and bundles[edit]

Next up are command lists and bundles, and this is where DX12 draws parallels with AMD Mantle (API). The aim here essentially is to ensure the CPU and GPU are working together in a more balanced manner.

Within DX11 the commands are sent from the CPU to the GPU one by one, and the GPU works through these commands sequentially. This means that commands are bottlenecked by the speed at which the CPU could send these commands in a linear fashion. Within DirectX 12 these commands are sent as command lists, containing all the required information within a single package. The GPU is then capable of computing and executing this command in one single process, without have to wait on any additional information from the CPU.

Within these command lists are bundles. Where previously commands were just taken, used, and then forgotten by the GPU, bundles can be reused. This decreases the workload of the GPU and means repeated assets can be used much faster.

Descriptor heaps and tables[edit]

While resource binding is pretty convenient in DX11 for developers at the moment, its inefficiency means several modern hardware capabilities are being drastically underused. Descriptor heaps and tables are basically bad news for developers, great news for gamers. When a game engine needed resources in DX11, it had to draw the data from scratch every time, meaning repeat processes and unnecessary uses. Descriptor heaps and tables mean the most often used resources can be allocated by developers in tables, which the GPU can quickly and easily access.

Architecture[edit]

Abstract Layer

Direct3D is a Microsoft DirectX API subsystem component. The aim of Direct3D is to abstract the communication between a graphics application and the graphics hardware drivers. It is presented like a thin abstract layer at a level comparable to GDI (see attached diagram). Direct3D contains numerous features that GDI lacks.

Direct3D is an Immediate mode graphics API. It provides a low-level interface to every video card 3D function (transformations, clipping, lighting, materials, textures, depth buffering and so on). It also had a higher level Retained mode component, that has now been officially discontinued.

Direct3D immediate mode presents three main abstractions: devices, resources and Swap Chains (see attached diagram). Devices are responsible for rendering the 3D scene. They provide an interface with different rendering capabilities. For example, the mono device provides white and black rendering, while the RGB device renders in color. There are four types of devices:

Device
  • Reference device: Simulates new functions not yet available in hardware. It is necessary to install the Direct3D SDK to use this device type.
  • Null reference device: Does nothing. This device is used when the SDK is not installed and a reference device is requested.
  • Pluggable software device: Performs software rendering. This device was introduced with DirectX 9.0.[50]

Every device contains at least one swap chain. A swap chain is made up of one or more back buffer surfaces. Rendering occurs in the back buffer.

Moreover, devices contain a collection of resources; specific data used during rendering. Each resource has four attributes:

  • Type: Determines the type of resource: surface, volume, texture, cube texture, volume texture, surface texture, index buffer or vertex buffer.
  • Pool:[51] Describes how the resource is managed by the runtime and where it is stored. In the Default pool the resource will exist only in device memory. Resources in the managed pool will be stored in system memory, and will be sent to the device when required. Resources in system memory pool will only exist in system memory. Finally, the scratch pool is basically the same as the system memory pool, but resources are not bound by hardware restrictions.
  • Format: Describes the layout of the resource data in memory. For example, D3DFMT_R8G8B8 format value means a 24 bits colour depth (8 bits for red, 8 bits for green and 8 bits for blue).
  • Usage: Describes, with a collection of flag bits, how the resource will be used by the application. These flags dictate which resources are used in dynamic or static access patterns. Static resource values don’t change after being loaded, whereas dynamic resource values may be modified.

Direct3D implements two display modes:

  • Fullscreen mode: The Direct3D application generates all of the graphical output for a display device. In this mode Direct3D automatically captures Alt-Tab and sets/restores screen resolution and pixel format without the programmer intervention. This also provides plenty of problems for debugging due to the 'Exclusive Cooperative Mode'.[citation needed]
  • Windowed mode: The result is shown inside the area of a window. Direct3D communicates with GDI to generate the graphical output in the display. Windowed mode can have the same level of performance as full-screen, depending on driver support.

Pipeline[edit]

Graphics pipeline process

The Microsoft Direct3D 11 API defines a process to convert a group of vertices, textures, buffers, and state into an image on the screen. This process is described as a rendering pipeline with several distinct stages. The different stages of the Direct3D 11 pipeline are:[52]

  1. Input Assembler: Reads in vertex data from an application supplied vertex buffer and feeds them down the pipeline.
  2. Vertex Shader: Performs operations on a single vertex at a time, such as transformations, skinning, or lighting.
  3. Hull Shader: Performs operations on sets of patch control points, and generates additional data known as patch constants.
  4. Tesselation stage: Subdivides geometry to create higher-order representations of the hull.
  5. Domain Shader: Performs operations on vertices output by the tessellation stage, in much the same way as a vertex shader.
  6. Geometry Shader: Processes entire primitives such as triangles, points, or lines. Given a primitive, this stage discards it, or generates one or more new primitives.
  7. Stream Output: Can write out the previous stage's results to memory. This is useful to recirculate data back into the pipeline.
  8. Rasterizer: Converts primitives into pixels, feeding these pixels into the pixel shader. The Rasterizer may also perform other tasks such as clipping what is not visible, or interpolating vertex data into per-pixel data.
  9. Pixel Shader: Determines the final pixel colour to be written to the render target and can also calculate a depth value to be written to the depth buffer.
  10. Output Merger: Merges various types of output data (pixel shader values, alpha blending, depth/stencil...) to build the final result.

The pipeline stages illustrated with a round box are fully programmable. The application provides a shader program that describes the exact operations to be completed for that stage. Many stages are optional and can be disabled altogether.

Feature levels[edit]

Direct3D 10.1 API introduces a concept of "feature levels" which encapsulate features of the hardware supported in a particular version of the API, with separate levels for 10.0 and 10.1 hardware.[14][15] In previous releases of the Direct3D API, certain capabilities of the graphics hardware have been synonymous with main revision number of the API.

In Direct3D 11, the concept has been further expanded to run on most downlevel hardware including Direct3D 9 cards with WDDM drivers.

Feature levels allow developers to unify the rendering pipeline and use a single version of the API on both newer and older hardware, taking advantage of performance and usability improvements in the newer runtine.[16] Each upper level is a strict superset of a lower level, with only a few optional features that move to the core functionality on an upper level.[22] More advanced features such as new shader models and rendering stages are only exposed on up-level hardware,[20][21] however the hardware is not required to support all of these feature levels.[14]

There are seven feature levels provided by D3D_FEATURE_LEVEL structure; levels 9_1, 9_2 and 9_3 (collectively known as Direct3D 10 Level 9) re-encapsulate various features of popular Direct3D 9 cards conforming to Shader Model 2.0, while levels 10_0, 10_1, 11_0 and 11_1 refer to respective versions of the Direct3D API.[20] "10 Level 9" feature levels contain a subset of the Direct3D 10/11 API[53] and require shaders to be written in HLSL conforming to Shader Model 4.0 4_0_LEVEL_9_x compiler profiles, and not in the actual "shader assembly" language of Shader Model 2.0; SM 3.0 (vs_3_0/ps_3_0) has been omitted deliberately in D3D 10 Level 9.[14]

Direct3D 11.2 for Windows 8.1 adds optional mappable buffers and optional tiled resources for levels 11_0 and 11_1; these features require WDDM 1.3 drivers.

Direct3D feature levels
Level Driver model Hardware features Supported GPUs
9_1 WDDM 1.0 or later Shader Model 2.0 (vs_2_0/ps_2_0), 2K textures, volume textures, event queries, BC1-3 (aka DXTn), a few other specific capabilities. Nvidia GeForce FX, Intel G965 chipset; Tegra 3, Tegra 4
9_2 Occlusion queries, floating-point formats (no blending), extended caps, all 9_1 features. ATI Radeon 9500
9_3 vs_2_a/ps_2_x with instancing and additional shader caps, 4K textures, multiple render targets (4 MRTs), floating-point blending (limited), all 9_2 features. ATI Radeon X1300, Nvidia GeForce 6600; Adreno 22x/3xx, Mali-T 6xx,[54] Matrox M-series
10_0 Shader Model 4.0, geometry shader, stream out, alpha-to-coverage, 8K textures, MSAA textures, 2-sided stencil, general render target views, texture arrays, BC4/BC5, optional DirectCompute (CS 4.0), full floating-point format support, all 9_3 features. ATI Radeon HD2000 series; Nvidia GeForce 8/9/GTX 200 series, Intel GM965 chipset, Intel HD Graphics (Arrandale/Clarkdale)
10_1 Shader Model 4.1, cubemap arrays, extended MSAA, optional DirectCompute (CS 4.1), all 10_0 features. ATI Radeon HD 3000/4000 series; Nvidia GTX 210/220; Intel HD Graphics 3000/2000 (Sandy Bridge)
11_0 WDDM 1.1 or later Shader Model 5.0, hull & domain shaders, mandatory DirectCompute (CS 5.0), 16K textures, BC6H/BC7, all 10_1 features. AMD Radeon HD 5000/6000 series, Nvidia GeForce GTX 400/500/600/700 series; Intel HD Graphics 4000/2500 (Ivy Bridge)
11_1 WDDM 1.2 or later SM5.0 with optional extensions, logical blend operations, target-independent rasterization, UAVs at every stage, constant buffer offsetting and partial updates, UAV only rendering with force sample count, all 11_0 features. AMD HD 7000/8000 series, Intel HD Graphics 5000 (Haswell), Adreno 420, Mali-T760
11_0, 11_1 WDDM 1.3 or later Optional mappable buffers, optional tiled resources. AMD HD 7000/8000 series, Rx 200 series

Direct3D Mobile[edit]

Direct3D Mobile is derived from Direct3D but has a smaller memory footprint. Windows CE provides Direct3D Mobile support.[55]

Related tools[edit]

D3DX[edit]

Main article: D3DX

Direct3D comes with D3DX, a library of tools designed to perform common mathematical calculations on vectors, matrices and colors, calculating look-at and projection matrices, spline interpolations, and several more complicated tasks, such as compiling or assembling shaders used for 3D graphic programming, compressed skeletal animation storage and matrix stacks. There are several functions that provide complex operations over 3D meshes like tangent-space computation, mesh simplification, precomputed radiance transfer, optimizing for vertex cache friendliness and stripification, and generators for 3D text meshes. 2D features include classes for drawing screen-space lines, text and sprite based particle systems. Spatial functions include various intersection routines, conversion from/to barycentric coordinates and bounding box/sphere generators. D3DX is provided as a dynamic link library (DLL).

Some features present in previous versions of D3DX were removed in Direct3D 11 and now provided as separate sources:[56]

  • A large part of the math library has been removed. Microsoft recommends use of the DirectX Math library instead.
  • Spherical harmonics math has been removed and is now distributed as source.
  • The Effect framework has been removed and is now distributed as source via CodePlex.
  • The Mesh interface and geometry functions have been removed and are now distributed as source via CodePlex under DirectX Mesh project.
  • Texture functions have been removed and are now distributed as source via CodePlex under DirectX Tex project.
  • General helpers have been removed and are now distributed as source via CodePlex under DirectX Tool Kit project.

DXUT[edit]

DXUT (also called the sample framework) is a layer built on top of the Direct3D API. The framework is designed to help the programmer spend less time with mundane tasks, such as creating a window, creating a device, processing Windows messages and handling device events. DXUT have been removed with the Windows SDK 8.0 and now distributed as source via CodePlex.[57]

Wine[edit]

The Wine project has working implementations of the Direct3D 8, 9 and 10 APIs (they are, as of 20 May 2014, 100%, 78% and 82% complete respectively).[58] Wine's implementation can also be run on Windows under certain conditions.[59] Work on implementing Direct3D 10 began in Wine 1.1.7, using OpenGL via WGL.[citation needed]

Multithreading[edit]

WDDM driver model in Windows Vista and higher supports arbitrarily large number of execution contexts (or threads) in hardware or in software. Windows XP only supported multitasked access to Direct3D, where separate applications could execute in different windows and be hardware accelerated, and the OS had limited control about what the GPU could do and the driver could switch execution threads arbitrarily.

The ability to execute the runtime in a multi-threaded mode has been introduced with Direct3D 11 runtime. Each execution context is presented with a resource view of the GPU. Execution contexts are protected from each other, however a rogue or badly written app can take control of the execution in the user-mode driver and could potentially access data from another process within GPU memory by sending modified commands. Though protected from access by another app, a well-written app still needs to protect itself against failures and device loss caused by other applications.

The OS manages the threads all by itself, allowing the hardware to switch from one thread to the other when appropriate, and also handles memory management and paging (to system memory and to disk) via integrated OS-kernel memory management.

Finer-grained context switching, i.e. being able to switch two execution threads at the shader-instruction level instead of the single-command level or even batch of commands, was introduced in WDDM/DXGI 1.2 which shipped with Windows 8.[31] This overcomes a potential scheduling problem when application would have very long execution of a single command/batch of commands and will have to be terminated by the OS watchdog timer. [1].

WDDM 2.0 and Direct 12 have been reengineered to allow fully multithreaded draw calls. This was achieved by making all resources immutable (i.e. read-only), serializing the rendering states and using draw call bundles. This avoids complex resource management in the kernel-mode driver, making possible multiple reentrant calls to the user-mode driver via concurrent executions contexts supplied by separate rendering threads in the same application.

See also[edit]

References[edit]

  1. ^ "DirectX Software Development Kit, October 2006". Microsoft. 
  2. ^ "Windows Advanced Rasterization Platform (WARP) Guide - WARP Architecture and Performance". MSDN. 
  3. ^ "Direct3D 7 Immediate Mode Framework Programming 3: Multitexturing". gamedev.net. 2000-05-29. 
  4. ^ "DDS (DirectDraw Surface format)". MSDN. 
  5. ^ "DirectX 8 Graphics and Video: A Fresh Start". gamedev.net. 2000-11-30. 
  6. ^ "HLSL in Direct3D 9.0". 
  7. ^ "Graphics APIs in Windows". MSDN. August 2009. 
  8. ^ a b "The role of the Windows Display Driver Model in the DWM". 2006-04-02. 
  9. ^ "DirectX Software Development Kit, February 2007". Microsoft. 
  10. ^ CNet News
  11. ^ "What Direct3D 10 is all about - Additional Improvements". Tom's Hardware. 2006-11-08. 
  12. ^ "Microsoft Presents DirectX 10.1 Details at SIGGRAPH". ExtremeTech. 2007-08-07. 
  13. ^ "Direct3D 10.1 Features". MSDN. 
  14. ^ a b c d e Chuck Walbourn (June 20, 2012). "Direct3D Feature Levels". Games for Windows and the DirectX SDK Blog. 
  15. ^ a b "D3D10_FEATURE_LEVEL1 enumeration". MSDN. Retrieved 2009-11-22. 
  16. ^ a b c "Gamefest 2008 Presentations". Microsoft. 
  17. ^ a b "Nvision 08 Tech Presentations". Nvidia. Retrieved 2011-09-16. 
  18. ^ "AMD shows off world's first DirectX 11 GPU". Engadget. 2009-06-03. 
  19. ^ a b "GameFest 2008: Introduction to the Direct3D 11 Graphics Pipeline". Microsoft. Slide 56. 
  20. ^ a b c "Direct3D 11 on Downlevel Hardware". MSDN. Retrieved 2012-11-18. 
  21. ^ a b "Windows Driver Kit - Supporting Direct3D 11". MSDN. Retrieved 2009-06-13. 
  22. ^ a b "Direct3D feature levels". MSDN. Retrieved 2012-07-02. 
  23. ^ "Using ATI hardware tessellation in DX9". 2008-07-14. 
  24. ^ "AMD DX9 Tessellation SDK". 
  25. ^ "Programming for Real-Time Tessellation on GPU". 
  26. ^ "OpenGL Tessellation Samples". 
  27. ^ "DirectX Software Development Kit, November 2008". Microsoft. 2008-11-07. 
  28. ^ "Description of the Platform Update for Windows Server 2008 and the Platform Update for Windows Vista". Support.microsoft.com. 2012-10-02. Retrieved 2013-06-15. 
  29. ^ "The Platform Update for Windows Vista - DirectX Developer Blog - Site Home - MSDN Blogs". Blogs.msdn.com. 2009-09-10. Retrieved 2013-06-15. 
  30. ^ "Direct3D 11.1 Features". MSDN. Retrieved 2009-09-13. 
  31. ^ a b c "Windows Display Driver Model Enhancements in Windows Developer Preview". MSDN. 2011-09-13. 
  32. ^ "Intel's Haswell IGP to Feature DirectX 11.1, Increased Professional Application Support". AnandTech. 2011-08-05. 
  33. ^ "DirectX Graphics - Platform Update for Windows 7". MSDN. 2012-11-14. 
  34. ^ "DirectX 11.1 and Windows 7". Games for Windows and the DirectX SDK Blog. November 13, 2012. 
  35. ^ a b "Windows 8.1 Feature Guide - DirectX programming". MSDN Library. June 26, 2013. 
  36. ^ Bennett Sorbo (June 26, 2013). "What's New in Direct3D 11.2". Channel9 - BUILD 2013. 
  37. ^ "DXGI 1.3 Improvements". MSDN Library. June 26, 2013. 
  38. ^ What's new for Windows 8.1 Preview display drivers (WDDM 1.3)
  39. ^ Charles Hollemeersch, Matt Sandy (June 26, 2013). "Massive Virtual Textures for Games: Direct3D Tiled Resources". Channel9 - BUILD 2013. 
  40. ^ "Direct3D 11.2 Features". MSDN Library. June 26, 2013. 
  41. ^ a b http://www.anandtech.com/show/7889/microsoft-announces-directx-12-low-level-graphics-programming-comes-to-directx/2
  42. ^ first two minutes of https://channel9.msdn.com/Events/Build/2014/3-564
  43. ^ http://blogs.msdn.com/b/directx/archive/2014/08/13/directx-12-high-performance-and-high-power-savings.aspx
  44. ^ https://software.intel.com/en-us/blogs/2014/08/11/siggraph-2014-directx-12-on-intel
  45. ^ Chris Tector's segment of http://channel9.msdn.com/Blogs/DirectX-Developer-Blog/DirectX-Evolving-Microsoft-s-Graphics-Platform (starting approx. 18 minute in.)
  46. ^ http://www.extremetech.com/gaming/184768-head-of-xbox-warns-gamers-not-to-expect-dramatic-improvements-from-dx12/
  47. ^ http://www.gamespot.com/articles/xbox-one-1080p-obstacle-not-solved-by-directx-12-w/1100-6421478/
  48. ^ http://techreport.com/review/26239/a-closer-look-at-directx-12/3
  49. ^ Kowaliski, Cyril (March 21, 2014). "DirectX 12 will also add new features for next-gen GPUs". The Tech Report. Retrieved April 1, 2014. 
  50. ^ "Software Rasterizer for DirectX 9.0 SDK". Microsoft. 2005-08-01. 
  51. ^ "Direct3D Resources - Memory pool". 
  52. ^ "Graphics Pipeline". MSDN. 
  53. ^ "10Level9 reference". MSDN. Retrieved 2012-11-18. 
  54. ^ "Samsung Announces A15/Mali-T604 Based Exynos 5 Dual". AnandTech. Retrieved 2013-06-15. 
  55. ^ Direct3D Mobile, Microsoft, 6 January 2010.
  56. ^ "Living without D3DX". MSDN. 
  57. ^ "DXUT for Win32 Desktop Update". MSDN. 
  58. ^ Status of Windows APIs implementation
  59. ^ "WineD3DOnWindows - The Official Wine Wiki". Wiki.winehq.org. 2013-06-02. Retrieved 2013-06-15. 

External links[edit]