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 |
ExtractReflectionData (Permutation & permutation) = 0
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 |
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.)
|
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
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
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
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
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
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
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