Can movement from D3D_FEATURE_LEVEL_11_0
to D3D_FEATURE_LEVEL_12_0
and from SM5.0
to SM6.*
gain a better eifficency without other changes? (code remains the same for C++ and shaders). Copilot suggest moving to newer technologies. I am no sure, that these small changes may help a bit.
Of course I consider to write SM6.*
, etc. also, but in the future.
This is really two different questions.
D3D_FEATURE_LEVEL_11_0
is the minimum Direct3D Hardware Feature Level supported by DirectX 12. The additional features that are required by D3D_FEATURE_LEVEL_12_0
and D3D_FEATURE_LEVEL_12_1
are can still be supported but are optional for D3D_FEATURE_LEVEL_11_0
. The choice here is entirely about what hardware features does your application require vs. which features it can use if present but has a fallback otherwise.
Shader Model 6 is an entirely different shader compiler toolchain using DXC based on LLVM rather than legacy FXC which was Shader Model 5.1. At this point, all DirectX 12 capable drivers support Shader Model 6. You must use Shader Model 6 to access many features such as DirectML, DirectX Raytracing, Amplification & Mesh Shaders, etc. The choice of which specific Shader Model 6 profile to use is again a question of which hardware features you are using in your application.
As a 'support safety measure' you can add this to your code to ensure the that it supports Shader Model 6.0. This is going to be true in practice basically all the time, but it is a good way to eliminate potentially confusing 'oddball' drivers or ancient OS builds:
D3D12_FEATURE_DATA_SHADER_MODEL shaderModel = { D3D_SHADER_MODEL_6_0 };
if (FAILED(device->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &shaderModel, sizeof(shaderModel)))
|| (shaderModel.HighestShaderModel < D3D_SHADER_MODEL_6_0))
{
throw std::runtime_error("Shader Model 6.0 is not supported!");
}
If you are really worried, you can also check for Root Signature 1.1 support as well, but that's been present since Windows 10 (14393) so you can safely ignore this case as it's "implied" by Shader Model 6 support.