Navigation
Unreal Engine C++ API Reference > Developer > ShaderCompilerCommon
References
Module | ShaderCompilerCommon |
Header | /Engine/Source/Developer/ShaderCompilerCommon/Public/ShaderConductorContext.h |
Include | #include "ShaderConductorContext.h" |
Syntax
class FShaderConductorContext
Remarks
Wrapper class to handle interface between UE and ShaderConductor. Use to compile HLSL shaders to SPIR-V or high-level languages such as Metal.
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
Initializes the context with internal buffers used for the conversion of input and option descriptors between UE and ShaderConductor. | ||
![]() |
Move constructor to take ownership of internal buffers from 'Rhs'. | ||
![]() |
FShaderConductorContext
(
const FShaderConductorContext& |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() |
Release the internal buffers. |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
bool | CompileHlslToSpirv
(
const FShaderConductorOptions& Options, |
Compiles the specified HLSL shader source code to SPIR-V. |
![]() |
bool | CompileSpirvToSource
(
const FShaderConductorOptions& Options, |
Compiles the specified SPIR-V shader binary code to high level source code (Metal or GLSL). |
![]() |
bool | CompileSpirvToSourceAnsi
(
const FShaderConductorOptions& Options, |
Compiles the specified SPIR-V shader binary code to high level source code (Metal or GLSL) stored as null terminated ANSI string. |
![]() |
bool | CompileSpirvToSourceBuffer
(
const FShaderConductorOptions& Options, |
Compiles the specified SPIR-V shader binary code to high level source code (Metal or GLSL) stored as byte buffer (without null terminator as it comes from ShaderConductor). |
![]() ![]() |
void | ConvertCompileErrors
(
TArray< FString >&& ErrorStringLines, |
Convert array of error string lines into array of |
![]() ![]() |
bool | Disassemble
(
EShaderConductorIR Language, |
Disassembles the specified SPIR-V module and returns its assembly as text representation. |
![]() |
void | FlushErrors
(
TArray< FShaderCompilerError >& OutErrors |
Flushes the list of current compile errors and moves the ownership to the caller. |
![]() ![]() |
const TArray< FShaderCompilerError > & | GetErrors () |
Returns the list of current compile errors. |
![]() ![]() |
const FShaderConductorIdentifierTable & | Returns the table of special identifiers generated by ShaderConductor. | |
![]() ![]() |
const TCHAR * | GetShaderFileExt
(
EShaderConductorLanguage Language, |
Returns a filename extension for the specified shading language and shader stage, e.g. "frag" for a GLSL pixel shader. |
![]() ![]() |
int32 | Returns a length of the internal loaded sources (excluding the null terminator). | |
![]() ![]() |
const ANSICHAR * | Returns a pointer to a null terminated ANSI string of the internal loaded sources, or null if no source has been loaded yet. | |
![]() ![]() |
bool | IsIntermediateSpirvOutputVariable
(
const ANSICHAR* SpirvVariableName |
Returns whether the specified variable name denotes an intermediate output variable. |
![]() |
bool | LoadSource
(
const FString& ShaderSource, |
Loads the shader source and converts the input descriptor to a format suitable for ShaderConductor. |
![]() |
bool | LoadSource
(
const ANSICHAR* ShaderSource, |
Loads the shader source and converts the input descriptor to a format suitable for ShaderConductor. |
![]() |
bool | OptimizeSpirv
(
TArray< uint32 >& Spirv, |
Performs the specified optimization passes (e.g. "-O" or "--strip-reflect") on the SPIR-V module. |
![]() |
bool | RewriteHlsl
(
const FShaderConductorOptions& Options, |
Rewrites the specified HLSL shader source code. |
![]() ![]() |
void | Shutdown () |
Explicitly shut down ShaderConductor and DXC shared libraries. |
Operators
Type | Name | Description | |
---|---|---|---|
![]() |
FShaderConductorContext & | operator=
(
FShaderConductorContext&& Rhs |
Move operator to take ownership of internal buffers from 'Rhs'. |
![]() |
FShaderConductorContext & | operator=
(
const FShaderConductorContext& |