FXC task

Note

This task is only available when using the C++ build system.

Use HLSL shader compilers in the build process.

Parameters

The following table describes the parameters of the FXC task.

Parameter Description
AdditionalIncludeDirectories Optional string[] parameter.

Specifies one or more directories to add to the include path; separate with semi-colons if more than one.

Use /I[path].
AdditionalOptions Optional string parameter.
AllResourcesBound Optional bool parameter.

Compiler will assume that all resources that a shader may reference are bound and are in good state for the duration of shader execution. Available for Shader Model 5.1 and above.

Use /all_resources_bound.
AssemblerOutput Optional string parameter.

Specifies the contents of assembly language output file.

Use /Fc, /Fx.

NoListing
AssemblyCode, use Fc.
AssemblyCodeAndHex, use Fx.
AssemblerOutputFile Optional string parameter.

Specifies file name for assembly code listing file.
CompileD2DCustomEffect Optional bool parameter.

Compile a Direct2D custom effect that contains pixel shaders. Do not use for a vertex or compute custom effect.
ConsumeExportFile Optional string parameter.
DisableOptimizations Optional bool parameter.

Disable optimizations.

/Od implies /Gfp though output may not be identical to /Od /Gfp.
EnableDebuggingInformation Optional bool parameter.

Enable debugging information.
EnableUnboundedDescriptorTables Optional bool parameter.

Inform the compiler that a shader may contain a declaration of a resource array with unbounded range. Available for Shader Model 5.1 and above.

Use /enable_unbounded_descriptor_tables.
EntryPointName Optional string parameter.

Specifies the name of the entry point for the shader.

Use /E[name].
GenerateExportFile Optional string parameter.
GenerateExportShaderProfile Optional string parameter.
HeaderFileOutput Optional string parameter.

Specifies a name for header file containing object code.

Use /Fh [name].
ObjectFileOutput Optional string parameter.

Specifies a name for object file.

Use /Fo [name].
PreprocessorDefinitions Optional string[] parameter.

Defines preprocessing symbols for your source file.
SetRootSignature Optional string parameter.

Attach root signature to shader bytecode. Available for Shader Model 5.0 and above.

Use /setrootsignature.
ShaderModel Optional string parameter.

Specifies the shader model. Some shader types can only be used with recent shader models.

Use /T [type]_[model].
ShaderType Optional string parameter.

Specifies the type of shader.

Use /T [type]_[model].

Effect, use fx.
Vertex, use vs.
Pixel, use ps.
Geometry, use gs.
Hull, use hs.
Domain, use ds.
Compute, use cs.
Library, use lib.
RootSignature, generate Root Signature Object.
Source Required ITaskItem parameter.
SuppressStartupBanner Optional bool parameter.

Suppresses the display of the startup banner and information message.

Use /nologo.
TrackerLogDirectory Optional string parameter.
TreatWarningAsError Optional bool parameter.

Treats all compiler warnings as errors.

For a new project, it may be best to use /WX in all compilations; resolving all warnings will ensure the fewest possible hard-to-find code defects.
VariableName Optional string parameter.

Specifies a name for the variable name in the header file.

Use /Vn [name].

See also

Task reference