D3D10_SHADER Constants

HLSL compile options.

#define Description
D3D10_SHADER_AVOID_FLOW_CONTROL Tell compiler to not allow flow-control (when possible).
D3D10_SHADER_DEBUG Insert debug file/line/type/symbol information.
D3D10_SHADER_ENABLE_STRICTNESS By default, the HLSL compiler disables strictness on deprecated syntax. Specifying this flag enables strictness which may not allow for legacy syntax.
D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY This enables older shaders to compile to 4_0 targets.
D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPT Compile a vertex shader for the next highest shader profile. This option turns debugging on (and optimizations off).
D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPT Compile a pixel shader for the next highest shader profile. This option turns debugging on (and optimizations off).
D3D10_SHADER_IEEE_STRICTNESS Enables IEEE strictness.
D3D10_SHADER_NO_PRESHADER Disables Preshaders. Using this flag will cause the compiler to not pull out static expression for evaluation.
D3D10_SHADER_OPTIMIZATION_LEVEL0 Lowest optimization level. May produce slower code but will do so more quickly. This may be useful in a highly iterative shader development cycle.
D3D10_SHADER_OPTIMIZATION_LEVEL1 Second lowest optimization level.
D3D10_SHADER_OPTIMIZATION_LEVEL2 Second highest optimization level.
D3D10_SHADER_OPTIMIZATION_LEVEL3 Highest optimization level. Will produce best possible code but may take significantly longer to do so. This will be useful for final builds of an application where performance is the most important factor.
D3D10_SHADER_PACK_MATRIX_ROW_MAJOR Unless explicitly specified, matrices will be packed in row-major order on input and output from the shader.
D3D10_SHADER_PACK_MATRIX_COLUMN_MAJOR Unless explicitly specified, matrices will be packed in column-major order on input and output from the shader. This is generally more efficient, since it allows vector-matrix multiplication to be performed using a series of dot-products.
D3D10_SHADER_PARTIAL_PRECISION Force all computations to be done with partial precision; this may run faster on some hardware.
D3D10_SHADER_PREFER_FLOW_CONTROL Tell compiler to use flow-control (when possible).
D3D10_SHADER_SKIP_OPTIMIZATION Skip optimization during code generation; generally recommended for debug only.
D3D10_SHADER_SKIP_VALIDATION Do not validate the generated code against known capabilities and constraints. Only use this with shaders that have been successfully compiled in the past. Shaders are always validated by DirectX before they are set to the device.
D3D10_SHADER_WARNINGS_ARE_ERRORS Inform the HLSL compiler to treat all warnings as errors when compiling the shader code. For new shader code, you should use this option so you can resolve all warnings and ensure the fewest possible hard-to-find code defects.

 

These constants are defined as macros in d3d10shader.h.

Shader Constants