ID3D12Device::CheckFeatureSupport method (d3d12.h)

Gets information about the features that are supported by the current graphics driver.

Syntax

HRESULT CheckFeatureSupport(
            D3D12_FEATURE Feature,
  [in, out] void          *pFeatureSupportData,
            UINT          FeatureSupportDataSize
);

Parameters

Feature

Type: D3D12_FEATURE

A constant from the D3D12_FEATURE enumeration describing the feature(s) that you want to query for support.

[in, out] pFeatureSupportData

Type: void*

A pointer to a data structure that corresponds to the value of the Feature parameter. To determine the corresponding data structure for each constant, see D3D12_FEATURE.

FeatureSupportDataSize

Type: UINT

The size of the structure pointed to by the pFeatureSupportData parameter.

Return value

Type: HRESULT

Returns S_OK if successful. Returns E_INVALIDARG if an unsupported data type is passed to the pFeatureSupportData parameter or if a size mismatch is detected for the FeatureSupportDataSize parameter.

Remarks

As a usage example, to check for ray tracing support, specify the D3D12_FEATURE_DATA_D3D12_OPTIONS5 structure in the pFeatureSupportData parameter. When the function completes successfully, access the RaytracingTier field (which specifies the supported ray tracing tier) of the now-populated D3D12_FEATURE_DATA_D3D12_OPTIONS5 structure.

For more info, see Capability Querying.

Hardware support for DXGI Formats

To view tables of DXGI formats and hardware features, refer to:

Examples

The D3D1211on12 sample uses ID3D12Device::CheckFeatureSupport as follows:

inline UINT8 D3D12GetFormatPlaneCount(
    _In_ ID3D12Device* pDevice,
    DXGI_FORMAT Format
    )
{
    D3D12_FEATURE_DATA_FORMAT_INFO formatInfo = {Format};
    if (FAILED(pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &formatInfo, sizeof(formatInfo))))
    {
        return 0;
    }
    return formatInfo.PlaneCount;
}

Requirements

Requirement Value
Target Platform Windows
Header d3d12.h
Library D3D12.lib
DLL D3D12.dll

See also

ID3D12Device