Specifying Compiler Targets
You need to specify the shader target — set of shader features — to compile against when you call the D3DCompile, D3DCompile2, or D3DCompileFromFile function. Here we list the targets for various profiles that the D3DCompile* functions and the HLSL compiler support.
- Direct3D 11.0 and 11.1 feature levels
- Direct3D 10.1 feature level
- Direct3D 10.0 feature level
- Direct3D 9.1, 9.2, and 9.3 feature levels
- Legacy Direct3D 9 Shader Model 3.0
- Legacy Direct3D 9 Shader Model 2.0
- Legacy Direct3D 9 Shader Model 1.x
- Legacy Effects
- Notes
- Related topics
Direct3D 11.0 and 11.1 feature levels
Here are the shader targets that Direct3D 11.0 and 11.1 feature levels support.
Target | Description |
---|---|
cs_5_0 | DirectCompute 5.0 (compute shader) |
ds_5_0 | Domain shader |
gs_5_0 | Geometry shader |
hs_5_0 | Hull shader |
ps_5_0 | Pixel shader |
vs_5_0 | Vertex shader |
Direct3D 10.1 feature level
Here are the shader targets that the Direct3D 10.1 feature level supports.
Target | Description |
---|---|
cs_4_1 | DirectCompute 4.1 (compute shader)¹ |
gs_4_1 | Geometry shader |
ps_4_1 | Pixel shader |
vs_4_1 | Vertex shader |
Direct3D 10.0 feature level
Here are the shader targets that the Direct3D 10.0 feature level supports.
Target | Description |
---|---|
cs_4_0 | DirectCompute 4.0 (compute shader)¹ |
gs_4_0 | Geometry shader |
ps_4_0 | Pixel shader |
vs_4_0 | Vertex shader |
Direct3D 9.1, 9.2, and 9.3 feature levels
Here are the shader targets that Direct3D 9.1, 9.2 and 9.3 feature levels support.
Note
When you use the *_4_0_level_9_x HLSL shader profiles, you implicitly use of the Shader Model 2.x profiles to support Direct3D 9 capable hardware. Shader Model 2.x profiles support more limited flow control behavior than the Shader Model 4.x and later profiles.
Target | Description |
---|---|
ps_4_0_level_9_1 | Pixel shader for 9.1 and 9.2 (similar limits to ps_2_0)
|
ps_4_0_level_9_3 | Pixel shader for 9.3 (similar limits to ps_2_x² with additional shader features)
|
vs_4_0_level_9_1 | Vertex shader for 9.1 and 9.2 (similar to vs_2_0)
|
vs_4_0_level_9_3 | Vertex shader for 9.3 (similar to vs_2_a² with additional shader features and instancing)
|
Legacy Direct3D 9 Shader Model 3.0
Here are the shader targets for legacy Direct3D 9 shader model 3.0³.
Target | Description |
---|---|
ps_3_0 | Pixel shader 3.0 |
ps_3_sw | Pixel shader 3.0 (software) |
vs_3_0 | Vertex shader 3.0 |
vs_3_sw | Vertex shader 3.0 (software) |
Legacy Direct3D 9 Shader Model 2.0
Here are the shader targets for legacy Direct3D 9 shader model 2.0³.
Target | Description |
---|---|
ps_2_0 | Pixel shader 2.0 |
ps_2_a | Pixel shader 2a |
ps_2_b | Pixel shader 2b |
ps_2_sw | Pixel shader 2.0 software |
vs_2_0 | Vertex shader 2.0 |
vs_2_a | Vertex shader 2a |
vs_2_sw | Vertex shader 2.0 software |
Legacy Direct3D 9 Shader Model 1.x
Here are the shader targets for legacy Direct3D 9 shader model 1.x⁴.
Target | Description |
---|---|
tx_1_0 | Texture shader profile that legacy D3DX9⁵ functions D3DXCreateTextureShader and D3DXFillTextureTX use |
vs_1_1 | Vertex shader 1.1 |
Legacy Effects
Here are the effect targets for legacy effects.
Target | Description |
---|---|
fx_2_0 | Effects (FX) for Direct3D 9 in D3DX9⁵ |
fx_4_0 | Effects (FX) for Direct3D 10.0 in D3DX10⁵ |
fx_4_1 | Effects (FX) for Direct3D 10.1 in D3DX10⁵ |
fx_5_0 | Effects (FX) for Direct3D 11⁵ |
Notes
Here are some notes that the preceding sections refer to:
- feature level 10.0 and 10.1 devices can optionally support DirectCompute. To verify support, use ID3D11Device::CheckFeatureSupport with D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS.
- feature level 9.3 effectively requires hardware that complies with the requirements for legacy Direct3D 9 shader model 3.0, but this feature level does not make use of vs_3_0 or ps_3_0 targets.
- Only use legacy Direct3D 9 shader models with the Direct3D 9 API. Instead, use the 9.x profiles with the Direct3D 10.x and 11.x API.
- The current HLSL shader D3DCompile* functions don't support legacy 1.x pixel shaders. The last version of HLSL to support these targets was D3DX9 in the October 2006 release of the DirectX SDK.
- All versions of D3DX and the DirectX SDK are deprecated. For more info, see Where is the DirectX SDK?.
Related topics