In various forums and discussion threads of late, I've seen some confusion about the difference between "DirectX 11" the API and "DirectX 11" the class of video hardware. The key to this is the concept of a "Feature Level" for devices which simplifies the old Direct3D 9 "sea of capabilities bits" to an increasingly capable group of level-sets for video hardware. An application requests a particular feature level (or a set of feature levels where the application can optionally use more advanced features if present), and the majority of the capabilities are known already. There are some specific optional features and format usages that may or may not be present (and thus require the use of CheckFormatSupport or CheckFeatureSupport), but most things can just be assumed based on the current device's Feature Level. This makes writing games and applications much simpler, and more importantly if something works for Feature Level X, then you can assume it will work for Feature Level X+1. This simplifies fallbacks as well, where the application only has to handle a few discrete cases. The HLSL shader profiles are designed so that a shader compiled for 4_0_level_9_1 will work on all feature levels, and a shader compiled for 4_0 will work on Feature Level 10.0, 10.1, 11.0, or 11.1 devices to limit the combinatorial explosion problem of shader permutations.
CheckFormatSupport
CheckFeatureSupport
4_0_level_9_1
4_0
The concept of Feature Levels was actually introduced back in Direct3D 10.1, but at the time there were only two of them: 10.0 and 10.1. With DirectX 11, we introduced both an 11.0 feature level and the "10level9" technology for running on many Direct3D 9 era Shader Model 2.0 and 3.0 parts via the 9.1, 9.2, and 9.3 feature levels. DirectX 11.1 supports the same set of feature levels, and adds a new 11.1 feature level. The concept of feature levels was one of my key talking points for my Gamefest 2010 / GDC 2010 presentation DirectX 11 Technology Update. I've also filed a lot of documentation bugs to get this topic well-covered on MSDN.
This is an important topic for Windows Store apps (a.k.a. Metro style apps) as "DirectX 11" the API is required for these applications, but you will see potentially a wide range of feature levels on machines running Windows 8. See the GDC 2012 presentation Developing Metro Style Games on the Full Range of Windows 8 Devices. With the guidelines presented in the Windows 8 Hardware Certification Requirements document, most new desktop systems sold with Windows 8 will have Feature Level 10.0 or greater hardware--actually most gaming systems are likely to have Feature Level 11.0 or 11.1 even newer laptops with integrated graphics. For tablet form-factor systems, particularly those running Windows RT, most will be Feature Level 9.1 or Feature Level 9.3 at least in the near-term. To support any system running Windows 8 including upgraded machines, you have to support Feature Level 9.1 which may be sufficient for some kinds of applications but not others.
In my Gamefest 2010 talk I tried to make this a bit more concrete with a table. Here is the table updated with some new information. Note that the listed video cards are examples and not an exhaustive list of video cards that support that feature level.
D3D_FEATURE_LEVEL_9_1
vs_2_0/ps_2_0
D3D_FEATURE_LEVEL_9_2
D3D_FEATURE_LEVEL_9_3
vs_2_0/ps_2_x
D3D_FEATURE_LEVEL_10_0
D3D_FEATURE_LEVEL_10_1
D3D_FEATURE_LEVEL_11_0
D3D_FEATURE_LEVEL_11_1
Direct3D 11.1 hardware: Shader Model 5.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.
Note: This feature level is only available on Windows 8 / Windows Server 2012 or later.
See Direct3D feature levels, and the various Hardware Support for Direct3D9 X Formats pages in the DXGI documentation.
By default, if you call D3D11CreateDevice or D3D11CreateDeviceAndSwapChain with the pFeatureLevels parameter set to NULL (or better yet nullptr for VS 2010 and VS 2012 developers!), then the system will try to create a device using the highest feature level available. Note for compatibility reasons, this does not include Feature Level 11.1 on machines with the DirectX 11.1 runtime installed. If you try to use D3D_FEATURE_LEVEL_11_1 on a system with only the DirectX 11.0 runtime installed, it fails immediately. The solution is to do something like the following--the retry isn't needed for Windows Store apps where you can assume DirectX 11.1 runtime is always available:
D3D11CreateDevice
D3D11CreateDeviceAndSwapChain
pFeatureLevels
NULL
nullptr
DWORD createDeviceFlags = 0;#ifdef _DEBUG createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG;#endif static const D3D_FEATURE_LEVEL lvl[] = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_1, D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_3, D3D_FEATURE_LEVEL_9_2, D3D_FEATURE_LEVEL_9_1 }; ID3D11Device* pDevice = nullptr; D3D_DRIVER_TYPE driverType = D3D_DRIVER_TYPE_HARDWARE; HRESULT hr = D3D11CreateDevice( nullptr, driverType, nullptr, createDeviceFlags, lvl, _countof(lvl), D3D11_SDK_VERSION, &pDevice, nullptr, nullptr ); if ( hr == E_INVALIDARG ) { hr = D3D11CreateDevice( nullptr, driverType, nullptr, createDeviceFlags, &lvl[1], _countof(lvl)-1, D3D11_SDK_VERSION, &pDevice, nullptr, nullptr ); }
WARP supports Feature Level 9.1, 9.2, 9.3, 10, and 10.1 on systems with the DirectX 11.0 runtime. On a system with the DirectX 11.1 runtime, it supports 11.0 and 11.1 as well.
A few quirks of this system you should be aware of:
4_0_level_9_?
ps_2_x
R16G16B16A16_FLOAT
_FLOAT
XNA 4 Note: None of these feature levels directly maps to the XNA "Reach" or "HiDef" profiles. "Reach" is very similiar to Feature Level 9.1, and "HiDef" is designed for the Shader Model 3.0 capabilities of the Xbox 360 so it's a bit more than Feature Level 9.3 offers but not as much as Feature Level 10.0.
Note: "10level9" feature levels require WDDM drivers and do not support legacy XPDM drivers--XPDM drivers are not supported at all on Windows 8.
Windows Store apps: See Publishing Direct3D Windows Store apps to the Windows Store for some details on the Feature Level policies for Windows Store on Windows RT (ARM) and Windows 8 (x86/x64).
Windows Phone 8: Windows phone 8 devices are Feature Level 9.3.
Detecting Feature Levels: Generally speaking, you determe if a device supports a given feature level by trying to create the device. There isn't an API that lets you enumerate feature level support from devices.
Related: Getting Started with Direct3D 11