ShaderCore

Classes

Name

Description

Public struct

FBaseShaderResourceTable

Public struct

FCachedUniformBufferDeclaration

Public class

FCompareShaderPipelineNameTypes

Used to compare two shader pipeline types by name.

Public class

FCompareShaderTypes

Used to compare two shader types by name.

Public class

FCompareVertexFactoryTypes

Used to compare two Vertex Factory types by name.

Public struct

FGlobalBoundShaderState

Public struct

FGlobalBoundShaderStateArgs

Public class

FGlobalBoundShaderStateResource

FGlobalBoundShaderState

Public struct

FGlobalBoundShaderStateWorkArea

Public class

FGlobalShader

FGlobalShader

Public struct

FGlobalShaderBackupData

Container for Backup/RestoreGlobalShaderMap functions.

Public class

FGlobalShaderMapId

Class that encapsulates logic to create a DDC key for the global shader map.

Public class

FGlobalShaderType

A shader meta type for the simplest shaders; shaders which are not material or vertex factory linked.

Public class

FNULLPS

An internal dummy pixel shader to use when the user calls RHISetPixelShader(NULL).

Public struct

FPackedArrayInfo

Public class

FRWMutex

Public class

FRWScopeLock

Public class

FRWShaderParameter

A class that binds either a UAV or SRV of a resource.

Public struct

FSamplerStateInitializerRHIKeyFuncs

Public class

FSelfContainedShaderId

Self contained version of FShaderId , which is useful for serializing.

Public class

FSerializationHistory

Encapsulates information about a shader's serialization behavior, used to detect when C++ serialization changes to auto-recompile.

Public class

FSerializationHistoryTraversalState

Tracks state when traversing a FSerializationHistory .

Public class

FShader

A compiled shader and its parameter bindings.

Public struct

FShaderBindings

Public class

FShaderCache

FShaderCache

Public struct

FShaderCacheBoundState

Public struct

FShaderCacheCustomVersion

============================================================================= ShaderCache.h: Shader precompilation mechanism

Public struct

FShaderCacheKey

Public struct

FShaderCaches

Public class

FShaderCacheState

The FShaderCache provides mechanisms for reducing shader hitching in-game:

Public class

FShaderCode

Public struct

FShaderCodeCache

Public struct

FShaderCodeLibrary

Collection of unique shader code Populated at cook time

Public struct

FShaderCodeLibraryPipeline

Public struct

FShaderCodePackedResourceCounts

If this changes you need to make sure all D3D11 shaders get invalidated

Public class

FShaderCodeReader

Later we can transform that to the actual class passed around at the RHI level

Public class

FShaderCompilerDefinitions

Container for shader compiler definitions.

Public struct

FShaderCompilerEnvironment

The environment used to compile a shader.

Public struct

FShaderCompilerError

A shader compiler error or warning.

Public struct

FShaderCompilerInput

Struct that gathers all readonly inputs needed for the compilation of a single shader.

Public struct

FShaderCompilerOutput

The output of the shader compiler.

Public struct

FShaderCompilerResourceTable

Public struct

FShaderDrawKey

Public class

FShaderFactoryInterface

Public class

FShaderId

Uniquely identifies an FShader .

Public class

FShaderParameter

A shader parameter's register binding. e.g. float1/2/3/4, can be an array, UAV

Public class

FShaderParameterMap

A map of shader parameter names to registers allocated to that parameter.

Public class

FShaderPipeline

A Shader Pipeline instance with compiled stages.

Public struct

FShaderPipelineKey

Public class

FShaderPipelineType

Binding of a set of shader stages in a single pipeline.

Public class

FShaderPipelineTypeDependency

Public struct

FShaderPlatformCache

Public struct

FShaderPreDrawEntry

Public struct

FShaderRenderTargetKey

Render target state tracked for predraw

Public class

FShaderResource

Compiled shader bytecode and its corresponding RHI resource.

Public class

FShaderResourceId

Uniquely identifies an FShaderResource .

Public struct

FShaderResourceKey

SRV state tracked by the shader-cache to properly predraw shaders

Public class

FShaderResourceParameter

A shader resource binding (textures or samplerstates).

Public struct

FShaderResourceViewBinding

Public class

FShaderSaveArchive

Archive used when saving shaders, which generates data used to detect serialization mismatches on load.

Public struct

FShaderStreamingCache

Public struct

FShaderTarget

Public struct

FShaderTextureBinding

Public struct

FShaderTextureKey

The minimum texture state required for logging shader draw states

Public class

FShaderType

An object which is used to serialize/deserialize, compile, and cache a particular shader class.

Public class

FShaderTypeDependency

Encapsulates a dependency on a shader type and saved state from that shader type.

Public class

FShaderUniformBufferParameter

Public struct

FUniformBufferCopyInfo

Information for copying members from uniform buffers to packed.

Public class

FVertexFactory

Encapsulates a vertex data source which can be linked into a vertex shader.

Public class

FVertexFactoryParameterRef

An encapsulation of the vertex factory parameters for a shader.

Public class

FVertexFactoryShaderParameters

An interface to the parameter bindings for the vertex factory used by a shader.

Public class

FVertexFactoryType

An object used to represent the type of a vertex factory.

Public class

FVertexFactoryTypeDependency

Encapsulates a dependency on a vertex factory type and saved state from that vertex factory type.

Public struct

FVertexStreamComponent

A typed data source for a vertex factory which streams data from a vertex buffer.

Public class

TIndexedSet

Public class

TOptionalShaderMapRef

A reference to an optional shader, initialized with a shader type from a shader map if it is available or nullptr if it is not.

Public class

TShaderMap

A collection of shaders of different types, but the same meta type.

Public class

TShaderMapRef

A reference which is initialized with the requested shader type from a shader map.

Typedefs

Enums

Name

Description

Public enum

CrossCompiler::

Cross compiler support/common functionality.

Public enum

CrossCompiler::

Cross compiler support/common functionality.

Public enum

CrossCompiler::EPackedTypeIndex

Cross compiler support/common functionality.

Public enum

CrossCompiler::EPackedTypeName

Cross compiler support/common functionality.

Public enum

ECompilerFlags

Public enum

EShaderCacheOptions

Public enum

EShaderCacheTextureType

Texture type enum for shader cache draw keys

Public enum

EShaderParameterFlags

Public enum

FRWScopeLockType

A scope lifetime controlled Read or Write lock of referenced mutex object

Functions

Name Description

Public function

SHADERCORE_A ...

 

AllowDebugViewmodes()

Returns true if debug viewmodes are allowed for the given platform.

Public function

SHADERCORE_A ...

 

BackupGlobalShaderMap

(
    FGlobalShaderBackupData & OutGlobal...
)

Backs up all global shaders to memory through serialization, and removes all references to FShaders from the global shader map.

Public function

void

 

BuildShaderFileToUniformBufferMap

(
    TMap < FString , TArray < const TCHAR ...
)

Public function

SHADERCORE_A ...

 

CreateUniformBufferShaderDeclaration

(
    const TCHAR * Name,
    const FUniformBufferStruct & Unifor...,
    EShaderPlatform Platform
)

Creates a shader code declaration of this struct for the given shader platform.

Public function Static

bool

 

CrossCompiler::IsValidPackedTypeName

(
    EPackedTypeName TypeName
)

Public function Static

EPackedTypeN ...

 

CrossCompiler::PackedTypeIndexToTypeName

(
    EPackedTypeIndex TypeIndex
)

Public function Static

uint8

 

CrossCompiler::PackedTypeIndexToTypeName

(
    uint8 ArrayType
)

Public function Static

EPackedTypeI ...

 

CrossCompiler::PackedTypeNameToTypeIndex

(
    EPackedTypeName TypeName
)

Public function Static

uint8

 

CrossCompiler::PackedTypeNameToTypeIndex

(
    uint8 ArrayName
)

Public function Static

uint8

 

CrossCompiler::ShaderStageIndexToTypeName

(
    uint8 ShaderStage
)

Public function

SHADERCORE_A ...

 

DispatchComputeShader

(
    FRHIAsyncComputeCommandListImmediat ...,
    FShader * Shader,
    uint32 ThreadGroupCountX,
    uint32 ThreadGroupCountY,
    uint32 ThreadGroupCountZ
)

Public function

SHADERCORE_A ...

 

DispatchComputeShader

(
    FRHICommandList & RHICmdList,
    FShader * Shader,
    uint32 ThreadGroupCountX,
    uint32 ThreadGroupCountY,
    uint32 ThreadGroupCountZ
)

Helper function to dispatch a compute shader while checking that parameters have been set correctly.

Public function

SHADERCORE_A ...

 

DispatchIndirectComputeShader

(
    FRHICommandList & RHICmdList,
    FShader * Shader,
    FVertexBufferRHIParamRef ArgumentBu...,
    uint32 ArgumentOffset
)

Helper function to dispatch a compute shader indirectly while checking that parameters have been set correctly.

Public function

SHADERCORE_A ...

 

DumpShaderPipelineStats

(
    EShaderPlatform Platform
)

Dumps shader pipeline stats to the log.

Public function

SHADERCORE_A ...

 

DumpShaderStats

(
    EShaderPlatform Platform,
    EShaderFrequency Frequency
)

Dumps shader stats to the log. Will also print some shader pipeline information.

Public function

SHADERCORE_A ...

 

FindShaderTypeByName

(
    FName ShaderTypeName
)

Finds the shader type with a given name.

The shader type, or NULL if none matched.

Public function

SHADERCORE_A ...

 

FindVertexFactoryType

(
    FName TypeName
)

Find the vertex factory type with the given name.

Public function

SHADERCORE_A ...

 

FlushShaderFileCache()

Flushes the shader file and CRC cache, and regenerates the binary shader files if necessary.

Public function

void

 

GenerateReferencedUniformBuffers

(
    const TCHAR * SourceFilename,
    const TCHAR * ShaderTypeName,
    const TMap < FString , TArray < const ...,
    TMap < const TCHAR *, FCachedUni ...
)

Parses the given source file and its includes for references of uniform buffers, which are then stored in UniformBufferEntries.

Public function

TShaderMap < ...

 

GetGlobalShaderMap

(
    ERHIFeatureLevel::Type FeatureLevel
)

Overload for the above GetGlobalShaderMap which takes a feature level and translates to the appropriate shader platform

Public function

SHADERCORE_A ...

 

GetGlobalShaderMap

(
    EShaderPlatform Platform
)

Accesses the global shader map.

Public function

TStatId

 

GetMemoryStatType

(
    EShaderFrequency ShaderFrequency
)

Public function

SHADERCORE_A ...

 

GetRelativeShaderFilename

(
    const FString & InFilename
)

Converts an absolute or relative shader filename to a filename relative to the shader directory.

Public function

SHADERCORE_A ...

 

GetShaderFileHash

(
    const TCHAR * Filename
)

Calculates a Hash for the given filename if it does not already exist in the Hash cache.

Public function

SHADERCORE_A ...

 

GetShaderFilesHash

(
    const TArray < FString >& Filenames
)

Calculates a Hash for the list of filenames if it does not already exist in the Hash cache.

Public function

SHADERCORE_A ...

 

GetShaderIncludes

(
    const TCHAR * Filename,
    TArray < FString >& IncludeFilename...,
    uint32 DepthLimit
)

Recursively populates IncludeFilenames with the include filenames from Filename

Public function

SHADERCORE_A ...

 

GetTargetShaderFormats()

Returns an array of all target shader formats, possibly from multiple target platforms.

Public function

SHADERCORE_A ...

 

InitializeShaderTypes()

Initializes cached shader type data.

Public function

SHADERCORE_A ...

 

LoadShaderSourceFile

(
    const TCHAR * Filename,
    FString & OutFileContents
)

Loads the shader file with the given name.

True if the file was successfully loaded.

Public function

SHADERCORE_A ...

 

LoadShaderSourceFileChecked

(
    const TCHAR * Filename,
    FString & OutFileContents
)

Loads the shader file with the given name.

Public function

SHADERCORE_A ...

 

RestoreGlobalShaderMap

(
    const FGlobalShaderBackupData & Glo...
)

Recreates shaders in the global shader map from the serialized memory.

Public function

SHADERCORE_A ...

 

SerializeUniformBufferInfo

(
    FShaderSaveArchive & Ar,
    const TMap < const TCHAR *, FCac ...
)

Records information about all the uniform buffer layouts referenced by UniformBufferEntries.

Public function

SHADERCORE_A ...

 

SetGlobalBoundShaderState

(
    FRHICommandList & RHICmdList,
    ERHIFeatureLevel::Type FeatureLevel,
    FGlobalBoundShaderState & BoundShad...,
    FVertexDeclarationRHIParamRef Verte...,
    FShader * VertexShader,
    FShader * PixelShader,
    FShader * GeometryShader
)

SetGlobalBoundShaderState - sets the global bound shader state, also creates and caches it if necessary

Public function

void

 

SetLocalUniformBufferParameter

(
    FRHICommandList & RHICmdList,
    TShaderRHIRef Shader,
    const FShaderUniformBufferParameter ...,
    const FLocalUniformBuffer & LocalUn...
)

Sets the value of a shader uniform buffer parameter to a uniform buffer containing the struct.

Public function

void

 

SetPixelShaderBool

(
    FRHICommandList & RHICmdList,
    FPixelShaderRHIParamRef PixelShader,
    const FShaderParameter & Parameter,
    bool Value
)

Sets the value of a pixel shader bool parameter.

Public function

void

 

SetSamplerParameter

(
    TRHICmdList& RHICmdList,
    ShaderTypeRHIParamRef Shader,
    const FShaderResourceParameter & Pa...,
    FSamplerStateRHIParamRef SamplerSta...
)

Sets the value of a shader sampler parameter. Template'd on shader type.

Public function

void

 

SetShaderValue

(
    FRHIAsyncComputeCommandList & RHICm...,
    ShaderRHIParamRef Shader,
    const FShaderParameter & Parameter,
    const bool& Value,
    uint32 ElementIndex
)

Specialization of the above for C++ bool type.

Public function

void

 

SetShaderValue

(
    TRHICmdList& RHICmdList,
    ShaderRHIParamRef Shader,
    const FShaderParameter & Parameter,
    const ParameterType& Value,
    uint32 ElementIndex
)

Sets the value of a shader parameter.

Public function

void

 

SetShaderValue

(
    FRHICommandList & RHICmdList,
    ShaderRHIParamRef Shader,
    const FShaderParameter & Parameter,
    const bool& Value,
    uint32 ElementIndex
)

Specialization of the above for C++ bool type.

Public function

void

 

SetShaderValueArray

(
    TRHICmdList& RHICmdList,
    ShaderRHIParamRef Shader,
    const FShaderParameter & Parameter,
    const ParameterType* Values,
    uint32 NumElements,
    uint32 BaseElementIndex
)

Sets the value of a shader parameter array.

Public function

void

 

SetShaderValueArray

(
    TRHICmdList& RHICmdList,
    ShaderRHIParamRef Shader,
    const FShaderParameter & Parameter,
    const bool* Values,
    uint32 NumElements,
    uint32 BaseElementIndex
)

Specialization of the above for C++ bool type.

Public function

void

 

SetShaderValueOnContext

(
    IRHICommandContext & RHICmdListCont...,
    ShaderRHIParamRef Shader,
    const FShaderParameter & Parameter,
    const ParameterType& Value,
    uint32 ElementIndex
)

Public function

void

 

SetSRVParameter

(
    TRHICmdList& RHICmdList,
    ShaderTypeRHIParamRef Shader,
    const FShaderResourceParameter & Pa...,
    FShaderResourceViewRHIParamRef NewS...
)

Sets the value of a shader resource view parameter Template'd on shader type (e.g. pixel shader or compute shader).

Public function

void

 

SetTextureParameter

(
    TRHICmdList& RHICmdList,
    ShaderTypeRHIParamRef Shader,
    const FShaderResourceParameter & Pa...,
    FTextureRHIParamRef NewTextureRHI
)

Sets the value of a shader surface parameter (e.g. to access MSAA samples).

Public function

void

 

SetTextureParameter

(
    TRHICmdList& RHICmdList,
    ShaderTypeRHIParamRef Shader,
    const FShaderResourceParameter & Te...,
    const FShaderResourceParameter & Sa...,
    const FTexture * Texture,
    uint32 ElementIndex
)

Sets the value of a shader texture parameter. Template'd on shader type

Public function

void

 

SetTextureParameter

(
    TRHICmdList& RHICmdList,
    ShaderTypeRHIParamRef Shader,
    const FShaderResourceParameter & Te...,
    const FShaderResourceParameter & Sa...,
    FSamplerStateRHIParamRef SamplerSta...,
    FTextureRHIParamRef TextureRHI,
    uint32 ElementIndex
)

Sets the value of a shader texture parameter. Template'd on shader type.

Public function

void

 

SetUAVParameter

(
    TRHICmdList& RHICmdList,
    FComputeShaderRHIParamRef ComputeSh...,
    const FShaderResourceParameter & Pa...,
    FUnorderedAccessViewRHIParamRef New...
)

Sets the value of a unordered access view parameter

Public function

void

 

SetUAVParameterIfCS

(
    TRHICmdList& RHICmdList,
    TShaderRHIRef,
    const FShaderResourceParameter & UA...,
    FUnorderedAccessViewRHIParamRef UAV
)

Public function

void

 

SetUniformBufferParameter

(
    TRHICmdList& RHICmdList,
    TShaderRHIRef Shader,
    const TShaderUniformBufferParameter ...,
    const TUniformBuffer < TBufferStruct...
)

Sets the value of a shader uniform buffer parameter to a uniform buffer containing the struct.

Public function

void

 

SetUniformBufferParameter

(
    TRHICmdList& RHICmdList,
    TShaderRHIRef Shader,
    const TShaderUniformBufferParameter ...,
    const TUniformBufferRef < TBufferStr...
)

Sets the value of a shader uniform buffer parameter to a uniform buffer containing the struct.

Public function

void

 

SetUniformBufferParameter

(
    TRHICmdList& RHICmdList,
    TShaderRHIRef Shader,
    const FShaderUniformBufferParameter ...,
    FUniformBufferRHIParamRef UniformBu...
)

Sets the value of a shader uniform buffer parameter to a uniform buffer containing the struct.

Public function

void

 

SetUniformBufferParameterImmediate

(
    TRHICmdList& RHICmdList,
    TShaderRHIRef Shader,
    const TShaderUniformBufferParameter ...,
    const TBufferStruct& UniformBuffer...
)

Sets the value of a shader uniform buffer parameter to a value of the struct.

Public function

void

 

SetUniformBufferParameterImmediate

(
    FRHICommandList & RHICmdList,
    TShaderRHIRef Shader,
    const TShaderUniformBufferParameter ...,
    const TBufferStruct& UniformBuffer...
)

Sets the value of a shader uniform buffer parameter to a value of the struct.

Public function

SHADERCORE_A ...

 

ShaderMapAppendKeyString

(
    EShaderPlatform Platform,
    FString & KeyString
)

Appends to KeyString for all shaders.

Public function

SHADERCORE_A ...

 

UninitializeShaderTypes()

Uninitializes cached shader type data.

Public function

SHADERCORE_A ...

 

VerifyShaderSourceFiles()

Kick off SHA verification for all shader source files

Variables

Name Description

Public variable

SHADERCORE_API T ...

 

GGlobalShaderMap

============================================================================= GlobalShader.cpp: Global shader implementation.

Public variable

SHADERCORE_API F ...

 

GGlobalShaderMapHash

Used to identify the global shader map.

Public variable

SHADERCORE_API ...

 

GlobalShaderMapId

Used to identify the global shader map in compile queues.

Public variable

 

SHADERCORE_API

Controls whether shader related logs are visible.