TShaderMap

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

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

RenderCore

Header

/Engine/Source/Runtime/RenderCore/Public/Shader.h

Include

#include "Shader.h"

Syntax

template<typename ShaderMetaType>
class TShaderMap

Remarks

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

Variables

Name Description

Protected variable

EShaderPlatform

 

Platform

The platform this shader map was compiled with

Protected variable

TMap< const FSh...

 

ShaderPipelines

Protected variable

TMap< FShaderPr...

 

Shaders

Constructors

Name Description

Public function

TShaderMap

(
    EShaderPlatform InPlatform
)

Default constructor.

Destructors

Name Description

Public function Virtual

~TShaderMap()

Destructor ensures pipelines cleared up.

Functions

Name Description

Public function

void

 

AddShader

(
    FShaderType* Type,
    int32 PermutationId,
    FShader* Shader
)

Public function

void

 

AddShaderPipeline

(
    const FShaderPipelineType* Typ...,
    FShaderPipeline* ShaderPipelin...
)

Public function Virtual

void

 

DiscardSerializedShaders()

Discards serialized shaders when they are not going to be used for anything (NullRHI)

Public function

void

 

Empty()

Clears out all shaders and deletes shader pipelines held in the map

Protected function

void

 

EmptyShaderPipelines()

Public function Const

uint32

 

GetMaxNumInstructionsForShader

(
    FShaderType* ShaderType
)

Public function Const

uint32

 

GetMaxTextureSamplersShaderMap()

Public function Const

uint32

 

GetNumShaderPipelines()

Public function Const

uint32

 

GetNumShaders()

Public function Const

FShader *...

 

GetShader

(
    FShaderType* ShaderType,
    int32 PermutationId
)

Finds the shader with the given type. May return NULL.

Public function Const

ShaderType &...

 

GetShader

(
    const typename ShaderType::FPermuta...
)

Finds the shader with the given type. Asserts on failure.

Public function Const

ShaderType &...

 

GetShader

(
    int32 PermutationId
)

Finds the shader with the given type. Asserts on failure.

Public function Const

void

 

GetShaderList

(
    TMap< FName, FShader* >& OutS...
)

Builds a list of the shaders in a shader map. Key is FShaderType::TypeName

Public function Const

void

 

GetShaderList

(
    TMap< FShaderId, FShader* >& ...
)

Builds a list of the shaders in a shader map.

Public function Const

FShaderPipel...

 

GetShaderPipeline

(
    const FShaderPipelineType* Pip...
)

Public function

FShaderPipel...

 

GetShaderPipeline

(
    const FShaderPipelineType* Pip...
)

Public function Const

void

 

GetShaderPipelineList

(
    TArray< FShaderPipeline* >& O...,
    FShaderPipeline::EFilter Filter
)

Builds a list of the shader pipelines in a shader map.

Public function Const

EShaderPlatf...

 

GetShaderPlatform()

Public function Const

const TMap< ...

 

GetShaders()

Public function Const

bool

 

HasShader

(
    FShaderType* Type,
    int32 PermutationId
)

Finds the shader with the given type.

Public function Const

bool

 

HasShaderPipeline

(
    const FShaderPipelineType* Pip...
)

Returns nullptr if not found.

Public function Const

bool

 

IsEmpty()

Public function Virtual

void

 

RegisterSerializedShaders

(
    bool bCookedMaterial
)

Registered all shaders that have been serialized (maybe) on another thread

Public function

void

 

RemoveShaderPipelineType

(
    const FShaderPipelineType* Sha...
)

Public function

void

 

RemoveShaderTypePermutaion

(
    FShaderType* Type,
    int32 PermutationId
)

Removes the shader of the given type from the shader map

Public function

void

 

SerializeInline

(
    FArchive& Ar,
    bool bInlineShaderResource,
    bool bHandleShaderKeyChanges,
    bool bLoadedByCookedMaterial,
    const TArray< FShaderPrimaryKey >&...
)

Used to serialize a shader map inline in a material in a package.

Public function

FShader *...

 

SerializeShaderForLoad

(
    FShaderType* Type,
    FArchive& Ar,
    bool bHandleShaderKeyChanges,
    bool bInlineShaderResource,
    bool bLoadedByCookedMaterial
)

Public function

void

 

SerializeShaderForSaving

(
    FShader* CurrentShader,
    FArchive& Ar,
    bool bHandleShaderKeyChanges,
    bool bInlineShaderResource
)

Classes

Name

Description

Public class

FCompareShaderPrimaryKey

Used to compare two shader types by name.

Typedefs

Name

Description

FShaderPrimaryKey

Select Skin
Light
Dark

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