ShaderCompilerCommon

Windows
MacOS
Linux

Classes

Name

Description

Public struct

FDllHandle

Public class

FDxcModuleWrapper

Public struct

FHlslccHeader

Public class

FHlslccHeaderWriter

Public struct

FHlslShaderModel

Shader model version for HLSL input language.

Public class

FShaderConductorContext

Wrapper class to handle interface between UE and ShaderConductor.

Public struct

FShaderConductorIdentifierTable

Container for all special case SPIR-V identifiers generated by ShaderConductor.

Public class

FShaderConductorModuleWrapper

Public struct

FShaderConductorOptions

Wrapper structure to pass options descriptor to ShaderConductor.

Public struct

FShaderConductorTarget

Shader conductor output target descriptor.

Public class

FShaderParameterParser

Validates and moves all the shader loose data parameter defined in the root scope of the shader into the root uniform buffer.

Public struct

FSpirv

Base structure for SPIR-V modules in the shader backends.

Public struct

FSpirvReflectBindings

Container structure for all SPIR-V reflection resources and in/out attributes.

Public class

TSpirvForwardIterator

Template forward iterator for SPIR-V instructions.

Typedefs

Enums

Name

Description

Public enum

CrossCompiler::EShaderConductorIR

Intermediate representation languages for ShaderConductor disassembly output.

Public enum

CrossCompiler::EShaderConductorLanguage

Target high level languages for ShaderConductor output.

Public enum

EShaderConductorTarget

Functions

Name Description

Public function

void

 

AddNoteToDisplayShaderParameterMemberOnCppSide

(
    const FShaderCompilerInput& Compil...,
    const FShaderParameterParser::FPars...,
    FShaderCompilerOutput& CompilerOut...
)

Adds a

to CompilerOutput.Error about where the shader parameter is on C++ side.

Public function

void

 

AddNoteToDisplayShaderParameterStructureOnCppSide

(
    const FShaderParametersMetadata...,
    FShaderCompilerOutput& CompilerOut...
)

Adds a

to CompilerOutput.Error about where the shader parameter structure is on C++ side.

Public function

void

 

AddUnboundShaderParameterError

(
    const FShaderCompilerInput& Compil...,
    const FShaderParameterParser& Shad...,
    const FString& ParameterBindingNam...,
    FShaderCompilerOutput& CompilerOut...
)

Adds an error to CompilerOutput.Error about a shader parameters that could not be bound.

Public function

bool

 

BuildResourceTableMapping

(
    const TMap< FString, FResourceTable...,
    const TMap< FString, FUniformBuffer...,
    TBitArray<>& UsedUniformBufferSlot...,
    FShaderParameterMap& ParameterMap,
    FShaderCompilerResourceTable& OutS...
)

This function looks for resources specified in ResourceTableMap in the parameter map, adds them to the resource table, and removes them from the parameter map.

Public function

void

 

BuildResourceTableTokenStream

(
    const TArray< uint32 >& InResource...,
    int32 MaxBoundResourceTable,
    TArray< uint32 >& OutTokenStream,
    bool bGenerateEmptyTokenStreamIfNoR...
)

Builds a token stream out of the resource map.

Public function

void

 

CompileOfflineMali

(
    const FShaderCompilerInput& Input,
    FShaderCompilerOutput& ShaderOutpu...,
    const ANSICHAR* ShaderSource,
    const int32 SourceSize,
    bool bVulkanSpirV,
    const ANSICHAR* VulkanSpirVEnt...
)

Calls 'Mali Offline Compiler' to compile the glsl source code and extract the generated instruction count

Public function

bool

 

ConvertFromFP32ToFP16

(
    FString& InOutSourceCode,
    TArray< FString >& OutErrors
)

Public function

FString

 

CreateCrossCompilerBatchFileContents

(
    const FString& ShaderFile,
    const FString& OutputFile,
    const FString& FrequencySwitch,
    const FString& EntryPoint,
    const FString& VersionSwitch,
    const FString& ExtraArguments
)

Cross compiler support/common functionality.

Public function

FString

 

CreateShaderCompilerWorkerDirectCommandLine

(
    const FShaderCompilerInput& Input,
    uint32 CCFlags
)

Public function

bool

 

CrossCompiler::Match

(
    const TCHAR*& Str,
    const TCHAR* Sub
)

Public function

bool

 

CrossCompiler::Match

(
    const ANSICHAR*& Str,
    const ANSICHAR* Sub
)

Public function

bool

 

CrossCompiler::Match

(
    const TCHAR*& Str,
    ANSICHAR Char
)

Public function

bool

 

CrossCompiler::Match

(
    const ANSICHAR*& Str,
    ANSICHAR Char
)

Public function

bool

 

CrossCompiler::ParseIdentifier

(
    const ANSICHAR*& Str,
    FString& OutStr
)

Public function

bool

 

CrossCompiler::ParseIdentifier

(
    const TCHAR*& Str,
    FString& OutStr
)

Public function

bool

 

CrossCompiler::ParseIntegerNumber

(
    const TCHAR*& Str,
    T& OutNum
)

Public function

bool

 

CrossCompiler::ParseIntegerNumber

(
    const ANSICHAR*& Str,
    T& OutNum
)

Public function

bool

 

CrossCompiler::ParseSignedNumber

(
    const TCHAR*& Str,
    int32& OutNum
)

Public function

bool

 

CrossCompiler::ParseSignedNumber

(
    const ANSICHAR*& Str,
    int32& OutNum
)

Public function

bool

 

CrossCompiler::ParseString

(
    const ANSICHAR*& Str,
    FString& OutStr
)

Public function

bool

 

CrossCompiler::ParseString

(
    const TCHAR*& Str,
    FString& OutStr
)

Public function

void

 

CullGlobalUniformBuffers

(
    const TMap< FString, FUniformBuffer...,
    FShaderParameterMap& ParameterMap
)

Culls global uniform buffer entries from the parameter map.

Public function

void

 

DumpDebugShaderBinary

(
    const FShaderCompilerInput& Input,
    void* InData,
    int32 InDataByteSize,
    const FString& FileExtension
)

Public function

void

 

DumpDebugShaderDisassembledDxil

(
    const FShaderCompilerInput& Input,
    void* InData,
    int32 InDataByteSize,
    const FString& FileExtension
)

Public function

void

 

DumpDebugShaderDisassembledSpirv

(
    const FShaderCompilerInput& Input,
    void* InData,
    int32 InDataByteSize,
    const FString& FileExtension
)

Public function

void

 

DumpDebugShaderText

(
    const FShaderCompilerInput& Input,
    const FString& InSource,
    const FString& FileExtension
)

Public function

void

 

DumpDebugShaderText

(
    const FShaderCompilerInput& Input,
    ANSICHAR* InSource,
    int32 InSourceLength,
    const FString& FileExtension
)

Public function

void

 

DumpDebugUSF

(
    const FShaderCompilerInput& Input,
    const ANSICHAR* Source,
    uint32 HlslCCFlags,
    const TCHAR* OverrideBaseFilen...
)

Utility functions shared amongst all backends to write out a dumped USF.

Public function

void

 

DumpDebugUSF

(
    const FShaderCompilerInput& Input,
    const ANSICHAR* Source,
    int32 SourceLength,
    uint32 HlslCCFlags,
    const TCHAR* OverrideBaseFilen...
)

SourceLength is no longer needed.

Public function

void

 

DumpDebugUSF

(
    const FShaderCompilerInput& Input,
    const FString& Source,
    uint32 HlslCCFlags,
    const TCHAR* OverrideBaseFilen...
)

SourceLength is no longer needed.

Public function

void

 

FindOffsetToSpirvEntryPoint

(
    const FSpirv& Spirv,
    const ANSICHAR* EntryPointName,
    uint32& OutWordOffsetToEntryPoint,
    uint32& OutWordOffsetToMainName
)

Returns word offset to the entry point (OpEntryPoint) and name of the entry point (OpName).

Public function

FString

 

GetDumpDebugUSFContents

(
    const FShaderCompilerInput& Input,
    const FString& Source,
    uint32 HlslCCFlags
)

Gets the string that DumpDebugUSF writes out.

Public function

int16

 

GetNumUniformBuffersUsed

(
    const FShaderCompilerResourceTable ...
)

Finds the number of used uniform buffers in a resource map.

Public function

const ANSICH...

 

PatchSpirvEntryPointWithCRC

(
    FSpirv& Spirv,
    uint32& OutCRC
)

Renames the fixed-size entry point name (which must be "main_00000000_00000000") to the formatted name including a CRC over the module.

Public function

void

 

RemoveUniformBuffersFromSource

(
    const FShaderCompilerEnvironment& ...,
    FString& PreprocessedShaderSource
)

The cross compiler doesn't yet support struct initializers needed to construct static structs for uniform buffers Replace all uniform buffer struct member references (View.WorldToClip) with a flattened name that removes the struct dependency (View_WorldToClip)

Public function

bool

 

RemoveUnusedInputs

(
    FString& InOutSourceCode,
    const TArray< FString >& InUsedInp...,
    FString& InOutEntryPoint,
    TArray< FString >& OutErrors
)

Public function

bool

 

RemoveUnusedOutputs

(
    FString& InOutSourceCode,
    const TArray< FString >& InUsedOut...,
    const TArray< FString >& InExcepti...,
    FString& InOutEntryPoint,
    TArray< FString >& OutErrors
)

Public function

void

 

WriteShaderConductorCommandLine

(
    const FShaderCompilerInput& Input,
    const FString& SourceFilename,
    EShaderConductorTarget Target
)

Variables

Name Description

Public variable

ESCWErrorCode

 

GSCWErrorCode

Error code for SCW to help track down crashes.