class ICompiler

A structure defining the compiler interface. Should be sub-classed for each language supported (i.e. HLSL, GLSL, etc.)

File location: sdk/tools/ffx_shader_compiler/src/compiler.h

Construction

Return type

Description

ICompiler ( const std::string& shaderPath, const std::string& shaderName, const std::string& shaderFileName, const std::string& outputPath, bool disableLogs, bool debugCompile )
Compiler construction function.

Methods

Return type

Description

bool

Compile ( Permutation & permutation, const std::vector<std::string>& arguments, std::mutex& writeMutex ) = 0
Compiles a shader permutation. Must be overridden for each language supported (i.e. HLSL, GLSL, etc.)

bool

Extracts shader reflection data. Must be overridden for each language supported (i.e. HLSL, GLSL, etc.)

void

WriteBinaryHeaderReflectionData ( FILE* fp, const Permutation & permutation, std::mutex& writeMutex ) = 0
Writes reflection header data for shader permutations. Must be overridden for each language supported (i.e. HLSL, GLSL, etc.)

void

Writes permutation reflection header data structures for shader permutations. Must be overridden for each language supported (i.e. HLSL, GLSL, etc.)

void

WritePermutationHeaderReflectionData (FILE* fp, const Permutation & permutation) = 0
Writes permutation reflection header data for shader permutations. Must be overridden for each language supported (i.e. HLSL, GLSL, etc.)

Detailed description

A structure defining the compiler interface. Should be sub-classed for each language supported (i.e. HLSL, GLSL, etc.)

Construction

ICompiler

Copied!

ICompiler (
    const std::string& shaderPath,
    const std::string& shaderName,
    const std::string& shaderFileName,
    const std::string& outputPath,
    bool disableLogs,
    bool debugCompile
)

Compiler construction function.

Parameters:

shaderPath

Path to the shader to compile

shaderName

Shader entry point

shaderFileName

Filename of the shader file to compile

outputPath

Output path for shader export

disableLogs

Enables/Disables logging of errors and warnings

debugCompile

Compile shaders in debug and generate pdb information

Returns:

none


Methods

Compile

Copied!

virtual bool Compile (
    Permutation & permutation,
    const std::vector<std::string>& arguments,
    std::mutex& writeMutex
) = 0

Compiles a shader permutation. Must be overridden for each language supported (i.e. HLSL, GLSL, etc.)

Parameters:

permutation

The permutation representation to compile

arguments

List of arguments to pass to the compiler

wrietMutex

Mutex to use for thread safety of compile process

Returns:

true if successful, false otherwise


ExtractReflectionData

Copied!

virtual bool ExtractReflectionData (Permutation & permutation) = 0

Extracts shader reflection data. Must be overridden for each language supported (i.e. HLSL, GLSL, etc.)

Parameters:

permutation

The permutation representation to extract reflection for

Returns:

true if successful, false otherwise


WriteBinaryHeaderReflectionData

Copied!

virtual void WriteBinaryHeaderReflectionData (
    FILE* fp,
    const Permutation & permutation,
    std::mutex& writeMutex
) = 0

Writes reflection header data for shader permutations. Must be overridden for each language supported (i.e. HLSL, GLSL, etc.)

Parameters:

fp

The file to write header information into

permutation

The permutation representation to write to head

wrietMutex

Mutex to use for thread safety of reflection data export

Returns:

none


WritePermutationHeaderReflectionStructMembers

Copied!

virtual void WritePermutationHeaderReflectionStructMembers (FILE* fp) = 0

Writes permutation reflection header data structures for shader permutations. Must be overridden for each language supported (i.e. HLSL, GLSL, etc.)

Parameters:

fp

The file to write header data structures into

Returns:

none


WritePermutationHeaderReflectionData

Copied!

virtual void WritePermutationHeaderReflectionData (
    FILE* fp,
    const Permutation & permutation
) = 0

Writes permutation reflection header data for shader permutations. Must be overridden for each language supported (i.e. HLSL, GLSL, etc.)

Parameters:

fp

The file to write header information into

permutation

The permutation representation to write to head

Returns:

none


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!