D3D10_SHADER Constants

HLSL compile options.

D3D10_SHADER_AVOID_FLOW_CONTROLTell compiler to not allow flow-control (when possible).
D3D10_SHADER_DEBUGInsert debug file/line/type/symbol information.
D3D10_SHADER_ENABLE_STRICTNESSBy 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_COMPATIBILITYThis enables older shaders to compile to 4_0 targets.
D3D10_SHADER_FORCE_VS_SOFTWARE_NO_OPTCompile a vertex shader for the next highest shader profile. This option turns debugging on (and optimizations off).
D3D10_SHADER_FORCE_PS_SOFTWARE_NO_OPTCompile a pixel shader for the next highest shader profile. This option turns debugging on (and optimizations off).
D3D10_SHADER_NO_PRESHADERDisables Preshaders. Using this flag will cause the compiler to not pull out static expression for evaluation.
D3D10_SHADER_OPTIMIZATION_LEVEL0Lowest 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_LEVEL1Second lowest optimization level.
D3D10_SHADER_OPTIMIZATION_LEVEL2Second highest optimization level.
D3D10_SHADER_OPTIMIZATION_LEVEL3Highest 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_MAJORUnless explicitly specified, matrices will be packed in row-major order on input and output from the shader.
D3D10_SHADER_PACK_MATRIX_COLUMN_MAJORUnless 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_PRECISIONForce all computations to be done with partial precision; this may run faster on some hardware.
D3D10_SHADER_PREFER_FLOW_CONTROLTell compiler to use flow-control (when possible).
D3D10_SHADER_SKIP_OPTIMIZATIONSkip optimization during code generation; generally recommended for debug only.
D3D10_SHADER_SKIP_VALIDATIONDo 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_ERRORSInform 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.

Related topics

Shader Constants