ShaderCompilerCommon

Classes

Name

Description

Public struct

FHlslccHeader

Functions

Name Description

Public function

bool

 

BuildResourceTableMapping

(
    const TMap < FString , FResourceTable ...,
    const TMap < FString , uint32 >& Res...,
    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
)

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 ANSICHAR *& Str,
    ANSICHAR Char
)

Public function

bool

 

CrossCompiler::Match

(
    const TCHAR*& Str,
    ANSICHAR Char
)

Public function

bool

 

CrossCompiler::Match

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

Public function

bool

 

CrossCompiler::Match

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

Public function

bool

 

CrossCompiler::ParseIdentifier

(
    const TCHAR*& Str,
    FString & OutStr
)

Public function

bool

 

CrossCompiler::ParseIdentifier

(
    const ANSICHAR *& 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 TCHAR*& Str,
    FString & OutStr
)

Public function

bool

 

CrossCompiler::ParseString

(
    const ANSICHAR *& Str,
    FString & OutStr
)

Public function

int16

 

GetNumUniformBuffersUsed

(
    const FShaderCompilerResourceTable ...
)

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

Public function

void

 

MoveShaderParametersToRootConstantBuffer

(
    const FShaderCompilerInput & Compil...,
    FString & PreprocessedShaderSource
)

Moves all the shader parameter defined in the root scope of the shader into the root uniform buffer.

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

 

StripInstancedStereo

(
    FString & ShaderSource
)

Fall back to using the View uniform buffer directly for platforms that don't support instanced stereo.