D3D_FEATURE_LEVEL is an enumerated type that defines a strict set of functionality supported by a graphics processing unit (GPU). Instead of checking for individual capabilities (like "does this card support tessellation?"), a developer can check for a specific feature level, such as D3D_FEATURE_LEVEL_11_0 .
If D3D11CreateDevice fails, it may mean the hardware doesn't even support the lowest version requested. To give you the most relevant guidance, are you working on: Upgrading an existing DirectX 11 app to DirectX 12? d3d_feature_level
Even within a feature level, some features are optional (e.g., ROVs in 12_1). Use CheckFeatureSupport : D3D_FEATURE_LEVEL is an enumerated type that defines a
Introduced Direct3D 10 features, such as geometry shaders. To give you the most relevant guidance, are
D3D_FEATURE_LEVEL featureLevel; const D3D_FEATURE_LEVEL featureLevels[] = D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, D3D_FEATURE_LEVEL_10_0, ; ID3D11Device* device = nullptr; ID3D11DeviceContext* context = nullptr; HRESULT hr = D3D11CreateDevice( nullptr, // Adapter D3D_DRIVER_TYPE_HARDWARE, // Driver Type nullptr, // Software Rasterizer 0, // Flags featureLevels, // Feature Level Array 3, // Number of Levels D3D11_SDK_VERSION, // SDK Version &device, // Output Device &featureLevel, // Output Chosen Level &context // Output Context ); Use code with caution.
D3D_FEATURE_LEVEL requestedLevels[] = D3D_FEATURE_LEVEL_12_1, D3D_FEATURE_LEVEL_12_0, D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0 ; D3D_FEATURE_LEVEL supportedLevel; HRESULT hr = D3D11CreateDevice( nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, requestedLevels, ARRAYSIZE(requestedLevels), D3D11_SDK_VERSION, &device, &supportedLevel, &context);