Capability querying
Your application can discover the level of support for resource binding (as well as the level of support for many other features), with a call to ID3D12Device::CheckFeatureSupport.
How to query for the resource binding tier
This first example focuses on resource binding. Each resource binding tier is a superset of lower tiers in functionality, so code that works on a given tier works unchanged on any higher tier.
The resource binding tiers are constants in the D3D12_RESOURCE_BINDING_TIER enumeration.
To query for the resource binding tier, use code such as this. This code example demonstrates the general pattern for querying for any of the various kinds of feature support.
D3D12_RESOURCE_BINDING_TIER get_resource_binding_tier(::ID3D12Device* pIDevice)
{
D3D12_FEATURE_DATA_D3D12_OPTIONS featureSupport{};
winrt::check_hresult(
pIDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &featureSupport, sizeof(featureSupport))
);
switch (featureSupport.ResourceBindingTier)
{
case D3D12_RESOURCE_BINDING_TIER_1:
// Tier 1 is supported.
break;
case D3D12_RESOURCE_BINDING_TIER_2:
// Tiers 1 and 2 are supported.
break;
case D3D12_RESOURCE_BINDING_TIER_3:
// Tiers 1, 2, and 3 are supported.
break;
}
return featureSupport.ResourceBindingTier;
}
Note that any enumerated constant that you pass (D3D12_FEATURE_D3D12_OPTIONS, in this case) has a corresponding data structure that receives info about that feature or set of features (D3D12_FEATURE_DATA_D3D12_OPTIONS, in this case). Always pass a pointer to the structure that matches the enumerated constant that you pass.
How to query for any feature level
As well as the resource binding tier, there are many other features whose level of support you can query for using the same pattern shown in the code example above. You just pass a different constant from the D3D12_FEATURE enumeration to ID3D12Device::CheckFeatureSupport (to tell the API what feature to request support information on), and you pass a pointer to an instance of the matching structure (in which to receive the requested info).
- Pass D3D12_FEATURE_ARCHITECTURE and D3D12_FEATURE_DATA_ARCHITECTURE.
- Pass D3D12_FEATURE_ARCHITECTURE1 and D3D12_FEATURE_DATA_ARCHITECTURE1.
- Pass D3D12_FEATURE_COMMAND_QUEUE_PRIORITY and D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY.
- Pass D3D12_FEATURE_CROSS_NODE and D3D12_FEATURE_DATA_CROSS_NODE.
- Pass D3D12_FEATURE_D3D12_OPTIONS and D3D12_FEATURE_DATA_D3D12_OPTIONS.
- Pass D3D12_FEATURE_D3D12_OPTIONS1 and D3D12_FEATURE_DATA_D3D12_OPTIONS1.
- Pass D3D12_FEATURE_D3D12_OPTIONS2 and D3D12_FEATURE_DATA_D3D12_OPTIONS2.
- Pass D3D12_FEATURE_D3D12_OPTIONS3 and D3D12_FEATURE_DATA_D3D12_OPTIONS3.
- Pass D3D12_FEATURE_D3D12_OPTIONS4 and D3D12_FEATURE_DATA_D3D12_OPTIONS4.
- Pass D3D12_FEATURE_D3D12_OPTIONS5 and D3D12_FEATURE_DATA_D3D12_OPTIONS5.
- Pass D3D12_FEATURE_EXISTING_HEAPS and D3D12_FEATURE_DATA_EXISTING_HEAPS.
- Pass D3D12_FEATURE_FEATURE_LEVELS and D3D12_FEATURE_DATA_FEATURE_LEVELS.
- Pass D3D12_FEATURE_FORMAT_INFO and D3D12_FEATURE_DATA_FORMAT_INFO.
- Pass D3D12_FEATURE_FORMAT_SUPPORT and D3D12_FEATURE_DATA_FORMAT_SUPPORT.
- Pass D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT and D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT.
- Pass D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS and D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS.
- Pass D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT and D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT.
- Pass D3D12_FEATURE_ROOT_SIGNATURE and D3D12_FEATURE_DATA_ROOT_SIGNATURE.
- Pass D3D12_FEATURE_SERIALIZATION and D3D12_FEATURE_DATA_SERIALIZATION.
- Pass D3D12_FEATURE_SHADER_CACHE and D3D12_FEATURE_DATA_SHADER_CACHE.
- Pass D3D12_FEATURE_SHADER_MODEL and D3D12_FEATURE_DATA_SHADER_MODEL.
Hardware support for DXGI Formats
To view tables of DXGI formats and hardware features, refer to these topics.
- DXGI Format Support for Direct3D Feature Level 12.1 Hardware
- DXGI Format Support for Direct3D Feature Level 12.0 Hardware
- DXGI Format Support for Direct3D Feature Level 11.1 Hardware
- DXGI Format Support for Direct3D Feature Level 11.0 Hardware
- Hardware Support for Direct3D 10Level9 Formats
- Hardware Support for Direct3D 10.1 Formats
- Hardware Support for Direct3D 10 Formats