FMaterialShaderMap

The set of material shaders for a single material.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/MaterialShared.h

Include

#include "MaterialShared.h"

Syntax

class FMaterialShaderMap :
    public TShaderMap< FMaterialShaderMapContent, FShaderMapPointerTable >,
    public FDeferredCleanupInterface

Remarks

The set of material shaders for a single material.

Constructors

Name Description

Public function

FMaterialShaderMap()

Destructors

Name Description

Public function Virtual

~FMaterialShaderMap()

Functions

Name Description

Public function

void

 

AddRef()

Reference counting.

Public function

TArray< uint...

 

BackupShadersToMemory()

Backs up any FShaders in this shader map to memory through serialization and clears FShader references.

Public function

void

 

Compile

(
    FMaterial* Material,
    const FMaterialShaderMapId& Shader...,
    TRefCountPtr< FShaderCompilerEnviro...,
    const FMaterialCompilationOutput& ...,
    EShaderPlatform Platform,
    bool bSynchronousCompile
)

Compiles the shaders for a material and caches them in this shader map.

Public function Const

bool

 

CompiledSuccessfully()

Public function Const

void

 

CountNumShaders

(
    int32& NumShaders,
    int32& NumPipelines
)

Public function

void

 

DumpDebugInfo()

Public function

void

 

FinalizeContent()

Public function Static

TRefCountPtr...

 

FindId

(
    const FMaterialShaderMapId& Shader...,
    EShaderPlatform Platform
)

Finds the shader map for a material.

Public function

void

 

FlushShadersByShaderPipelineType

(
    const FShaderPipelineType* Sha...
)

Removes all entries in the cache with exceptions based on a shader pipeline type

Public function

void

 

FlushShadersByShaderType

(
    const FShaderType* ShaderType
)

Removes all entries in the cache with exceptions based on a shader type

Public function

void

 

FlushShadersByVertexFactoryType

(
    const FVertexFactoryType* Vert...
)

Removes all entries in the cache with exceptions based on a vertex factory type

Public function Static

void

 

FlushShaderTypes

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

Flushes the given shader types from any loaded FMaterialShaderMap's.

Public function Static

void

 

GetAllOutdatedTypes

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

Gets outdated types from all loaded material shader maps

Public function Const

uint32

 

GetCompilingId()

Public function Const

const TCHAR ...

 

GetDebugDescription()

Public function Const

void

 

GetEstimatedNumTextureSamples

(
    uint32& VSSamples,
    uint32& PSSamples
)

Public function Const

uint32

 

GetEstimatedNumVirtualTextureLookups()

Public function Const

const TCHAR ...

 

GetFriendlyName()

Public function Const

const TCHAR ...

 

GetMaterialPath()

Public function Const

uint32

 

GetMaxNumInstructionsForShader

(
    FShaderType* ShaderType
)

Public function Const

uint32

 

GetMaxTextureSamplers()

Returns the maximum number of texture samplers used by any shader in this shader map.

Public function Const

FMeshMateria...

 

GetMeshShaderMap

(
    const FHashedName& VertexFactoryTy...
)

Public function Const

FMeshMateria...

 

GetMeshShaderMap

(
    FVertexFactoryType* VertexFact...
)

Accessors.

Public function Const

int32

 

GetNumRefs()

Public function Const

uint32

 

GetNumUsedCustomInterpolatorScalars()

Public function Const

uint32

 

GetNumUsedUVScalars()

Public function Const

uint32

 

GetNumVirtualTextureStacks()

Public function Const

int32

 

GetRefCount()

Public function Const

uint8

 

GetRuntimeVirtualTextureOutputAttributeMask()

Public function Const

TShaderRef< ...

 

GetShader

(
    FShaderType* ShaderType,
    int32 PermutationId
)

Public function Const

TShaderRef< ...

 

GetShader

(
    const typename ShaderType::FPermuta...
)

Public function Const

TShaderRef< ...

 

GetShader

(
    int32 PermutationId
)

Public function Const

void

 

GetShaderList

(
    TMap< FHashedName, TShaderRef< FSha...
)

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

Public function Const

void

 

GetShaderList

(
    TMap< FShaderId, TShaderRef< FShade...
)

Builds a list of the shaders in a shader map.

Public function Static

const FMater...

 

GetShaderMapBeingCompiled

(
    const FMaterial* Material
)

Finds a shader map currently being compiled that was enqueued for the given material.

Public function Const

const FMater...

 

GetShaderMapId()

Public function Const

uint32

 

GetShaderNum()

Number of Shaders in Shadermap

Public function Const

void

 

GetShaderPipelineList

(
    TArray< FShaderPipelineRef >& OutS...
)

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

Public function Const

const FMemor...

 

GetShaderSource

(
    const FName ShaderTypeName
)

Public function Const

const FUnifo...

 

GetUniformExpressionSet()

Public function Const

bool

 

IsCompilationFinalized()

Public function

bool

 

IsComplete

(
    const FMaterial* Material,
    bool bSilent
)

Checks whether the material shader map is missing any shader types necessary for the given material.

Public function Const

bool

 

IsValidForRendering

(
    bool bFailOnInvalid
)

Public function Static

void

 

LoadForRemoteRecompile

(
    FArchive& Ar,
    EShaderPlatform ShaderPlatform,
    const TArray< FString >& Materials...
)

Public function Static

void

 

LoadFromDerivedDataCache

(
    const FMaterial* Material,
    const FMaterialShaderMapId& Shader...,
    EShaderPlatform Platform,
    const ITargetPlatform* TargetP...,
    TRefCountPtr< FMaterialShaderMap > ...
)

Attempts to load the shader map for the given material from the Derived Data Cache.

Public function

void

 

LoadMissingShadersFromMemory

(
    const FMaterial* Material
)

Attempts to load missing shaders from memory.

Public function Const

bool

 

ModifiesMeshPosition()

Public function Const

bool

 

NeedsGBuffer()

Public function Const

bool

 

NeedsSceneTextures()

Public function

bool

 

ProcessCompilationResults

(
    const TArray< TSharedRef< FShaderCo...,
    int32& ResultIndex,
    float& TimeBudget,
    TMap< const FVertexFactoryType*...
)

Sorts the incoming compiled jobs into the appropriate mesh shader maps, and finalizes this shader map so that it can be used for rendering.

Public function

void

 

Register

(
    EShaderPlatform InShaderPlatform
)

Registers a material shader map in the global map so it can be used by materials.

Public function

void

 

Release()

Public function Static

void

 

RemovePendingMaterial

(
    FMaterial* Material
)

Removes a material from ShaderMapsBeingCompiled.

Public function Const

bool

 

RequiresSceneColorCopy()

Public function

void

 

RestoreShadersFromMemory

(
    const TArray< uint8 >& ShaderData
)

Recreates FShaders from the passed in memory, handling shader key changes.

Public function Static

void

 

SaveForRemoteRecompile

(
    FArchive& Ar,
    const TMap< FString, TArray< TRefCo...
)

Serializes a shader map to an archive (used with recompiling shaders for a remote console)

Public function

void

 

SaveShaderStableKeys

(
    EShaderPlatform TargetShaderPlatfor...,
    const FStableShaderKeyAndValue& Sa...
)

Public function

void

 

SaveToDerivedDataCache

(
    const ITargetPlatform* TargetP...
)

Saves this shader map to the derived data cache.

Public function

bool

 

Serialize

(
    FArchive& Ar,
    bool bInlineShaderResources,
    bool bLoadedByCookedMaterial
)

Serializes the shader map.

Public function

bool

 

TryToAddToExistingCompilationTask

(
    FMaterial* Material
)

Checks to see if the shader map is already being compiled for another material, and if so adds the specified material to the list to be applied to once the compile finishes.

Public function Const

bool

 

UsesDistanceCullFade()

Public function Const

bool

 

UsesEyeAdaptation()

Public function Const

bool

 

UsesGlobalDistanceField()

Public function Const

bool

 

UsesPixelDepthOffset()

Public function Const

bool

 

UsesSceneDepthLookup()

Public function Const

bool

 

UsesSceneTexture

(
    uint32 TexId
)

Public function Const

bool

 

UsesVelocitySceneTexture()

Public function Const

bool

 

UsesWorldPositionOffset()

Typedefs

Name

Description

Super

Constants

Name

Description

AllMaterialShaderMaps

All material shader maps in memory.

GIdToMaterialShaderMap

A global map from a material's static parameter set to any shader map cached for that material.

GIdToMaterialShaderMapCS

ShaderMapsBeingCompiled

Tracks material resources and their shader maps that need to be compiled but whose compilation is being deferred.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss