D3DCOMPILE Constants
The D3DCOMPILE constants specify how the compiler compiles the HLSL code.
Constant | Description | Note |
---|---|---|
|
Directs the compiler to insert debug file/line/type/symbol information into the output code. | See D3DXSHADER_DEBUG |
|
Directs the compiler not to validate the generated code against known capabilities and constraints. We recommend that you use this constant only with shaders that have been successfully compiled in the past. DirectX always validates shaders before it sets them to a device. | See D3DXSHADER_SKIPVALIDATION |
|
Directs the compiler to skip optimization steps during code generation. We recommend that you set this constant for debug purposes only. | See D3DXSHADER_SKIPOPTIMIZATION |
|
Directs the compiler to pack matrices in row-major order on input and output from the shader. | See D3DXSHADER_PACKMATRIX_ROWMAJOR |
|
Directs the compiler to pack matrices in column-major order on input and output from the shader. This type of packing is generally more efficient because a series of dot-products can then perform vector-matrix multiplication. | See D3DXSHADER_PACKMATRIX_COLUMNMAJOR |
|
Directs the compiler to perform all computations with partial precision. If you set this constant, the compiled code might run faster on some hardware. | See D3DXSHADER_PARTIALPRECISION |
|
Directs the compiler to compile a vertex shader for the next highest shader profile. This constant turns debugging on and optimizations off. | This flag was applicable only to Direct3D 9. See D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT |
|
Directs the compiler to compile a pixel shader for the next highest shader profile. This constant also turns debugging on and optimizations off. | This flag was applicable only to Direct3D 9. See D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT |
|
Directs the compiler to disable Preshaders. If you set this constant, the compiler does not pull out static expression for evaluation. | This flag was only applicable to legacy Direct3D 9 and Direct3D 10 Effects (FX). See D3DXSHADER_NO_PRESHADER |
|
Directs the compiler to not use flow-control constructs where possible. | See D3DXSHADER_AVOID_FLOW_CONTROL |
|
Forces strict compile, which might not allow for legacy syntax. By default, the compiler disables strictness on deprecated syntax. | |
|
Forces the IEEE strict compile which avoids optimizations that may break IEEE rules. | See D3DXSHADER_IEEE_STRICTNESS |
|
Directs the compiler to enable older shaders to compile to 5_0 targets. | See D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY |
|
Directs the compiler to use the lowest optimization level. If you set this constant, the compiler might produce slower code but produces the code more quickly. Set this constant when you develop the shader iteratively. | See D3DXSHADER_OPTIMIZATION_LEVEL0 |
|
Directs the compiler to use the second lowest optimization level. | See D3DXSHADER_OPTIMIZATION_LEVEL1 |
|
Directs the compiler to use the second highest optimization level. | See D3DXSHADER_OPTIMIZATION_LEVEL2 |
|
Directs the compiler to use the highest optimization level. If you set this constant, the compiler produces the best possible code but might take significantly longer to do so. Set this constant for final builds of an application when performance is the most important factor. | See D3DXSHADER_OPTIMIZATION_LEVEL3 |
|
Directs the compiler to treat all warnings as errors when it compiles the shader code. We recommend that you use this constant for new shader code, so that you can resolve all warnings and lower the number of hard-to-find code defects. | |
|
Directs the compiler to assume that unordered access views (UAVs) and shader resource views (SRVs) may alias for cs_5_0. | Only applies to DirectX 12 / Shader Model 5.1 |
|
Directs the compiler to enable unbounded descriptor tables. | Only applies to DirectX 12 / Shader Model 5.1 |
|
Directs the compiler to ensure all resources are bound. | Only applies to DirectX 12 / Shader Model 5.1 |
|
When generating debug PDBs this makes use of the source file and binary for the hash. | |
|
When generating debug PDBs this makes use of the binary file name only for the hash. |
Note
The D3DCOMPILE_RESOURCES_MAY_ALIAS
, D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES
, and D3DCOMPILE_ALL_RESOURCES_BOUND
compiler constants are new starting with the D3dcompiler_47.dll that ships with the Windows 8.1 SDK or later.
Note
The D3DCOMPILE_DEBUG_NAME_FOR_SOURCE
and D3DCOMPILE_DEBUG_NAME_FOR_BINARY
compiler constants are new starting with the D3dcompiler_47.dll that ships with the Windows 10 Fall Creator's Update SDK (version 16299) or later. See this blog post.
Note
For DirectX 12, Shader Model 5.1, the D3DCompile API, and FXC are all deprecated. Use Shader Model 6 via DXIL instead. See GitHub.
Requirements
Requirement | Value |
---|---|
Header |
|