Syntax (Windows)

Switch View :
ScriptFree
Syntax

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 SwitchOptionsDescription
/E <name>Shader entry point
/T <profile>Shader model (see profiles)

 

Optional SwitchOptionsDescription
/?, /helpPrint 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.
/CcOutput color-coded assembly.
/compressCompress DX10 shader bytecode from files.
/D <id>=<text>Define macro.
/decompressDecompress 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).
/GchCompile as a child effect for fx_4_x profiles.
/GdpDisable effect performance mode.
/GecEnable backwards compatibility mode.
/GesEnable strict mode.
/GfaAvoid flow control constructs.
/GfpPrefer flow control constructs.
/GisForce IEEE strictness.
/GppForce partial precision.
/I <include>Additional include path.
/LDCompile using the DirectX 9 HLSL compiler. See the limitations in Compiling for Legacy Shader Models.
/NiEnables the numbering of instructions in assembly listings.
/nologoSuppress copyright message.
/OdDisable optimizations. /Od implies /Gfp though output may not be identical to /Od /Gfp.
/OpDisable preshaders.
/O0 /O1, /O2, /O3Optimization 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.
/VdDisable validation.
/ViDisplay details about the include process.
/Vn <name>Use name as variable name in header file.
/ZiEnable debugging information.
/ZpcPack matrices in column-major order.
/ZprPack 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 TypeProfiles
Vertex Shadervs_1_1, vs_2_0, vs_2_a, vs_2_sw, vs_3_0, vs_3_sw, vs_4_0, vs_4_1
Pixel Shaderps_2_0, ps_2_a, ps_2_b, ps_2_sw, ps_3_0, ps_3_sw, ps_4_0, ps_4_1
Texture Shadertx_1_0
Geometry Shadergs_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

Effect-Compiler Tool

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012