FShaderType

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

Windows
MacOS
Linux

Inheritance Hierarchy

Syntax

class FShaderType

Remarks

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

A shader type can manage multiple instance of FShader across mutiple dimensions such as EShaderPlatform, or permutation id. The number of permutation of a shader type is simply given by GetPermutationCount().

Variables

Name Description

Protected variable

bool

 

bCachedUniformBufferStructDeclarations

Tracks what platforms ReferencedUniformBufferStructsCache has had declarations cached for.

Protected variable

TMap< const TCH...

 

ReferencedUniformBufferStructsCache

Cache of referenced uniform buffer includes.

Constructors

Name Description

Public function

FShaderType

(
    EShaderTypeForDynamicCast InShaderT...,
    const TCHAR* InName,
    const TCHAR* InSourceFilename,
    const TCHAR* InFunctionName,
    uint32 InFrequency,
    int32 TotalPermutationCount,
    ConstructSerializedType InConstruct...,
    GetStreamOutElementsType InGetStrea...,
    const FShaderParametersMetadata...
)

Minimal initialization constructor.

Destructors

Name Description

Public function Virtual

~FShaderType()

Functions

Name Description

Public function

void

 

AddReferencedUniformBufferIncludes

(
    FShaderCompilerEnvironment& OutEnv...,
    FString& OutSourceFilePrefix,
    EShaderPlatform Platform
)

Adds include statements for uniform buffers that this shader type references, and builds a prefix for the shader file with the include statements.

Public function

void

 

AddToShaderIdMap

(
    FShaderId Id,
    FShader* Shader
)

Public function Const

FShader *...

 

ConstructForDeserialization()

Constructs a new instance of the shader type for deserialization.

Public function

void

 

DumpDebugInfo()

Public function

FShader *...

 

FindShaderById

(
    const FShaderId& Id
)

Finds a shader of this type by ID.

Public function

void

 

FlushShaderFileCache

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

Public function Const

const FName ...

 

GetFName()

Public function Const

EShaderFrequ...

 

GetFrequency()

Accessors.

Public function Const

const TCHAR ...

 

GetFunctionName()

Public function Const

const FGloba...

 

GetGlobalShaderType()

Public function

FGlobalShade...

 

GetGlobalShaderType()

Dynamic casts.

Public function Const

const FMater...

 

GetMaterialShaderType()

Public function

FMaterialSha...

 

GetMaterialShaderType()

Public function Const

const FMeshM...

 

GetMeshMaterialShaderType()

Public function

FMeshMateria...

 

GetMeshMaterialShaderType()

Public function Const

const TCHAR ...

 

GetName()

Public function Static

TMap< FName,...

 

GetNameToTypeMap()

Public function

FNiagaraShad...

 

GetNiagaraShaderType()

Public function Const

const FNiaga...

 

GetNiagaraShaderType()

Public function Const

int32

 

GetNumShaders()

Public function

FOpenColorIO...

 

GetOpenColorIOShaderType()

Public function Const

const FOpenC...

 

GetOpenColorIOShaderType()

Public function Const

bool

 

GetOutdatedCurrentType

(
    TArray< FShaderType* >& Outda...,
    TArray< const FVertexFactoryType&#...
)

Returns true if the source file no longer matches what that type was compiled with

Public function Static

void

 

GetOutdatedTypes

(
    TArray< FShaderType* >& Outda...,
    TArray< const FVertexFactoryType&#...
)

Gets a list of FShaderTypes whose source file no longer matches what that type was compiled with

Public function Const

int32

 

GetPermutationCount()

Public function Const

const TMap< ...

 

GetReferencedUniformBufferStructsCache()

Public function Const

const FShade...

 

GetRootParametersMetadata()

Returns the meta data for the root shader parameter struct.

Public function Const

const FSeria...

 

GetSerializationHistory()

Public function Const

const TCHAR ...

 

GetShaderFilename()

Public function

void

 

GetShaderStableKeyParts

(
    FStableShaderKeyAndValue& SaveKeyV...
)

Public function Static

FShaderType ...

 

GetShaderTypeByName

(
    const TCHAR* Name
)

Public function Static

TArray< FSha...

 

GetShaderTypesByFilename

(
    const TCHAR* Filename
)

Public function Const

const FSHAHa...

 

GetSourceHash

(
    EShaderPlatform ShaderPlatform
)

Calculates a Hash based on this shader type's source code and includes

Public function

void

 

GetStreamOutElements

(
    FStreamOutElementList& ElementList,
    TArray< uint32 >& StreamStrides,
    int32& RasterizedStream
)

Public function Static

TLinkedList<...

 

GetTypeList()

Public function Static

void

 

Initialize

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

Initialize FShaderType static members, this must be called before any shader types are created.

Public function Const

bool

 

LimitShaderResourceToThisType()

Public function

void

 

RemoveFromShaderIdMap

(
    FShaderId Id
)

Public function

void

 

SaveShaderStableKeys

(
    EShaderPlatform TargetShaderPlatfor...
)

Public function Static

void

 

Uninitialize()

Uninitializes FShaderType cached data.

Enums

Name

Description

Public enum

EShaderTypeForDynamicCast

Typedefs

Constants

Name

Description

bInitializedSerializationHistory

Tracks whether serialization history for all shader types has been initialized.

References

Module

RenderCore

Header

Runtime/RenderCore/Public/Shader.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback