FidelityFX Shader Compiler

The FidelityFX SDK Shader Compiler tool is distributed as part of the FidelityFX SDK package and is the command line tool used by the SDK to pre-generate all shader permutation binaries that are loaded at runtime.

Using the Shader Compiler

The current version of the Shader Compiler and its needed libraries/dlls are kept in the /sdk/tools/binary_store folder.

To use it, simply invoke it from your build process (see the existing backend CMakeList.txt files as an example of launching it as part of the build process).

The following arguments will allow you to control how compilation occurs:

Command line syntax:

FidelityFX_SC.exe [Options] <InputFile>

Options

Option

Descriptions

<CompilerArgs>

A list of arguments accepted by the target compiler, separated by spaces.

-output=<Path>

Path to where the shader permutations should be output to.

-D<Name>

Define a macro that is defined in all shader permutations.

-D<Name>={<Value1>, <Value2>, <Value3> …}

Declare a shader option that will generate permutations with the macro defined using the given values. Use a ‘-’ to define a permutation where no macro is defined.

-num-threads=<Num>

Number of threads to use for generating shaders. Sets to the max number of threads available on the current CPU by default.

-name=<Name>

The name used for prefixing variables in the generated headers. Uses the file name by default.

-reflection

Generate header containing reflection data.

-embed-arguments

Write the compile arguments used for each permutation into their respective headers.

-print-arguments

Print the compile arguments used for each permuations.

-disable-logs

Prevent logging of compile warnings and errors.

-compiler=<Compiler>

Select the compiler to generate permutations from (dxc, fxc or glslang).

-dxcdll=<DXC DLL Path>

Path to the dxccompiler dll to use.

-d3ddll=<D3D DLL Path>

Path to the d3dcompiler dll to use.

-glslangexe=<glslangValidator.exe Path>

Path to the glslangValidator executable to use.

-deps=<Format>

Dump depfile which recorded the include file dependencies in format of (gcc or msvc).

-debugcompile

Compile shader with debug information.

-debugcmdline

Print all the input arguments.

Modifying the Shader Compiler

Should the need arise to build and/or modify the shader compiler tool, a solution can be generated by navigating to /sdk/tools/ffx_shader_compiler/ sub-folder and launching GenerateSolution.bat. This will in turn create a solution for the shader compiler in an /build subfolder.

When building a new shader compiler, the output will be sent to /sdk/tools/ffx_shader_compiler/bin/ sub-folder in a release or debug folder (based on configuration built). In order to use the newly compiled tool, it needs to have all binary files copied from the binary output location (bin directory) to the binary_store directory.

Related pages

  • Visit the FidelityFX SDK product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNAâ„¢ 2 GPUs, AMD Ryzenâ„¢ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!