Here is the syntax for calling FXC.exe, the effect-compiler tool. For an example, see Offline Compiling.
fxc SwitchOptions Filename
Arguments
- SwitchOptions
-
[in] Compile options. This is a list of 2 (required) or more (optional) options with a space between each.
Required SwitchOptions Description /E <name> Shader entry point /T <profile> Shader model (see profiles) Optional SwitchOptions Description /?, /help Print help for FXC.exe. @<command.option.file> File that contains additional compile options. - This option can be mixed with other command line compile options.
- The command.option.file must contain only one option per line.
- The command.option.file cannot contain any blank lines.
- Options specified in the file must not contain any leading or trailing spaces.
/Cc Output color-coded assembly. /compress Compress DX10 shader bytecode from files. /D <id>=<text> Define macro. /decompress Decompress DX10 shader bytecode from first file. Output files should be listed in the order they were in during compression. /Fc <file> Output assembly code listing file. /Fh <file> Output header file containing object code. /Fo <file> Output object file. /Fx <file> Output assembly code and hex listing file. /P <file> Preprocess to file (must be used alone). /Gch Compile as a child effect for fx_4_x profiles. /Gdp Disable effect performance mode. /Gec Enable backwards compatibility mode. /Ges Enable strict mode. /Gfa Avoid flow control constructs. /Gfp Prefer flow control constructs. /Gis Force IEEE strictness. /Gpp Force partial precision. /I <include> Additional include path. /LD Compile using the DirectX 9 HLSL compiler. See the limitations in Compiling for Legacy Shader Models. /Ni Enables the numbering of instructions in assembly listings. /nologo Suppress copyright message. /Od Disable optimizations. /Od implies /Gfp though output may not be identical to /Od /Gfp. /Op Disable preshaders. /O0 /O1, /O2, /O3 Optimization levels. O1 is the default setting. - O0 - Disables instruction reordering. This helps reduce register load and enables faster loop simulation.
- O1 - Disables instruction reordering for ps_3_0 and up.
- O2 - Same as O1. Reserved for future use.
- O3 - Same as O1. Reserved for future use.
/Vd Disable validation. /Vi Display details about the include process. /Vn <name> Use name as variable name in header file. /Zi Enable debugging information. /Zpc Pack matrices in column-major order. /Zpr Pack matrices in row-major order. - Filename
-
[in] The file that contains the shader(s) and/or the effect(s).
Profiles
Each shader model is labeled with an HLSL profile. To compile a shader against a particular shader model, choose the appropriate shader profile from the following table.
| Shader Type | Profiles |
|---|---|
| Vertex Shader | vs_1_1, vs_2_0, vs_2_a, vs_2_sw, vs_3_0, vs_3_sw, vs_4_0, vs_4_1 |
| Pixel Shader | ps_2_0, ps_2_a, ps_2_b, ps_2_sw, ps_3_0, ps_3_sw, ps_4_0, ps_4_1 |
| Texture Shader | tx_1_0 |
| Geometry Shader | gs_4_0, gs_4_1 |
| Effect (may contain any combination of vertex, pixel and geometry shaders) | fx_2_0, fx_4_0, fx_4_1 |
In Direct3D 10 use the API to get the vertex, geometry, and pixel-shader profile best suited to a given device by calling these functions: D3D10GetVertexShaderProfile, D3D10GetPixelShaderProfile, and D3D10GetGeometryShaderProfile.
In Direct3D 9 use the GetDeviceCaps or GetDeviceCaps methods to retrieve the vertex and pixel-shader profiles supported by a device. The D3DCAPS9 structure returned by those methods indicates the vertex and pixel-shader profiles supported by a device in its VertexShaderVersion and PixelShaderVersion members.
For examples using the current compiler, see Current. To use the legacy compiler for older shader models, see Legacy.
Note TextureCubeArrays are not usable with the fx_4_1 profile on Vista SP1.
Related topics
Send comments about this topic to Microsoft
Build date: 2/3/2012