UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FShaderMapContent Class Reference

#include <Shader.h>

+ Inheritance diagram for FShaderMapContent:

Classes

struct  FProjectShaderPipelineToKey
 

Public Member Functions

RENDERCORE_API FShaderMapContent (EShaderPlatform InPlatform)
 
RENDERCORE_API ~FShaderMapContent ()
 
RENDERCORE_API EShaderPlatform GetShaderPlatform () const
 
RENDERCORE_API void Validate (const FShaderMapBase &InShaderMap) const
 
template<typename ShaderType >
ShaderType * GetShader (int32 PermutationId=0) const
 
template<typename ShaderType >
ShaderType * GetShader (const typename ShaderType::FPermutationDomain &PermutationVector) const
 
FShaderGetShader (const FShaderType *ShaderType, int32 PermutationId=0) const
 
RENDERCORE_API FShaderGetShader (const FHashedName &TypeName, int32 PermutationId=0) const
 
bool HasShader (const FHashedName &TypeName, int32 PermutationId) const
 
bool HasShader (const FShaderType *Type, int32 PermutationId) const
 
TArrayView< const TMemoryImagePtr< FShader > > GetShaders () const
 
TArrayView< const TMemoryImagePtr< FShaderPipeline > > GetShaderPipelines () const
 
RENDERCORE_API void AddShader (const FHashedName &TypeName, int32 PermutationId, FShader *Shader)
 
RENDERCORE_API FShaderFindOrAddShader (const FHashedName &TypeName, int32 PermutationId, FShader *Shader)
 
RENDERCORE_API void AddShaderPipeline (FShaderPipeline *Pipeline)
 
RENDERCORE_API FShaderPipelineFindOrAddShaderPipeline (FShaderPipeline *Pipeline)
 
RENDERCORE_API void RemoveShaderTypePermutaion (const FHashedName &TypeName, int32 PermutationId)
 
void RemoveShaderTypePermutaion (const FShaderType *Type, int32 PermutationId)
 
RENDERCORE_API void RemoveShaderPipelineType (const FShaderPipelineType *ShaderPipelineType)
 
RENDERCORE_API void DumpShaderList (const FShaderMapBase &InShaderMap, FShaderListReport &Out) const
 
RENDERCORE_API void GetShaderList (const FShaderMapBase &InShaderMap, const FSHAHash &InMaterialShaderMapHash, TMap< FShaderId, TShaderRef< FShader > > &OutShaders) const
 
RENDERCORE_API void GetShaderList (const FShaderMapBase &InShaderMap, TMap< FHashedName, TShaderRef< FShader > > &OutShaders) const
 
RENDERCORE_API void GetShaderPipelineList (const FShaderMapBase &InShaderMap, TArray< FShaderPipelineRef > &OutShaderPipelines, FShaderPipeline::EFilter Filter) const
 
bool IsEmpty () const
 
RENDERCORE_API uint32 GetNumShaders () const
 
uint32 GetNumShaderPipelines () const
 
RENDERCORE_API void Empty ()
 
FShaderPipelineGetShaderPipeline (const FHashedName &PipelineTypeName) const
 
FShaderPipelineGetShaderPipeline (const FShaderPipelineType *PipelineType) const
 
bool HasShaderPipeline (const FHashedName &PipelineTypeName) const
 
bool HasShaderPipeline (const FShaderPipelineType *PipelineType) const
 
RENDERCORE_API uint32 GetMaxNumInstructionsForShader (const FShaderMapBase &InShaderMap, FShaderType *ShaderType) const
 
RENDERCORE_API void Finalize (const FShaderMapResourceCode *Code)
 
RENDERCORE_API void UpdateHash (FSHA1 &Hasher) const
 

Protected Types

using FMemoryImageHashTable = THashTable< FMemoryImageAllocator >
 

Protected Member Functions

RENDERCORE_API void EmptyShaderPipelines ()
 
 LAYOUT_FIELD (FMemoryImageHashTable, ShaderHash)
 
 LAYOUT_FIELD (TMemoryImageArray< FHashedName >, ShaderTypes)
 
 LAYOUT_FIELD (TMemoryImageArray< int32 >, ShaderPermutations)
 
 LAYOUT_FIELD (TMemoryImageArray< TMemoryImagePtr< FShader > >, Shaders)
 
 LAYOUT_FIELD (TMemoryImageArray< TMemoryImagePtr< FShaderPipeline > >, ShaderPipelines)
 
 LAYOUT_FIELD (FMemoryImageName, ShaderPlatformName)
 

Detailed Description

A collection of shaders of different types

Member Typedef Documentation

◆ FMemoryImageHashTable

Constructor & Destructor Documentation

◆ FShaderMapContent()

FShaderMapContent::FShaderMapContent ( EShaderPlatform  InPlatform)
explicit

Default constructor.

◆ ~FShaderMapContent()

FShaderMapContent::~FShaderMapContent ( )

Destructor ensures pipelines cleared up.

Member Function Documentation

◆ AddShader()

void FShaderMapContent::AddShader ( const FHashedName TypeName,
int32  PermutationId,
FShader Shader 
)

◆ AddShaderPipeline()

void FShaderMapContent::AddShaderPipeline ( FShaderPipeline Pipeline)

◆ DumpShaderList()

void FShaderMapContent::DumpShaderList ( const FShaderMapBase InShaderMap,
FShaderListReport Out 
) const

◆ Empty()

void FShaderMapContent::Empty ( )

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

◆ EmptyShaderPipelines()

void FShaderMapContent::EmptyShaderPipelines ( )
protected

◆ Finalize()

void FShaderMapContent::Finalize ( const FShaderMapResourceCode Code)

◆ FindOrAddShader()

FShader * FShaderMapContent::FindOrAddShader ( const FHashedName TypeName,
int32  PermutationId,
FShader Shader 
)

◆ FindOrAddShaderPipeline()

FShaderPipeline * FShaderMapContent::FindOrAddShaderPipeline ( FShaderPipeline Pipeline)

◆ GetMaxNumInstructionsForShader()

uint32 FShaderMapContent::GetMaxNumInstructionsForShader ( const FShaderMapBase InShaderMap,
FShaderType ShaderType 
) const

◆ GetNumShaderPipelines()

uint32 FShaderMapContent::GetNumShaderPipelines ( ) const
inline
Returns
The number of shader pipelines in the map.

◆ GetNumShaders()

uint32 FShaderMapContent::GetNumShaders ( ) const
Returns
The number of shaders in the map.

◆ GetShader() [1/4]

FShader * FShaderMapContent::GetShader ( const FHashedName TypeName,
int32  PermutationId = 0 
) const

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

◆ GetShader() [2/4]

FShader * FShaderMapContent::GetShader ( const FShaderType ShaderType,
int32  PermutationId = 0 
) const
inline

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

◆ GetShader() [3/4]

template<typename ShaderType >
ShaderType * FShaderMapContent::GetShader ( const typename ShaderType::FPermutationDomain &  PermutationVector) const
inline

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

◆ GetShader() [4/4]

template<typename ShaderType >
ShaderType * FShaderMapContent::GetShader ( int32  PermutationId = 0) const
inline

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

◆ GetShaderList() [1/2]

void FShaderMapContent::GetShaderList ( const FShaderMapBase InShaderMap,
const FSHAHash InMaterialShaderMapHash,
TMap< FShaderId, TShaderRef< FShader > > &  OutShaders 
) const

Builds a list of the shaders in a shader map.

◆ GetShaderList() [2/2]

void FShaderMapContent::GetShaderList ( const FShaderMapBase InShaderMap,
TMap< FHashedName, TShaderRef< FShader > > &  OutShaders 
) const

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

◆ GetShaderPipeline() [1/2]

FShaderPipeline * FShaderMapContent::GetShaderPipeline ( const FHashedName PipelineTypeName) const
inline

◆ GetShaderPipeline() [2/2]

FShaderPipeline * FShaderMapContent::GetShaderPipeline ( const FShaderPipelineType PipelineType) const
inline

◆ GetShaderPipelineList()

void FShaderMapContent::GetShaderPipelineList ( const FShaderMapBase InShaderMap,
TArray< FShaderPipelineRef > &  OutShaderPipelines,
FShaderPipeline::EFilter  Filter 
) const

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

◆ GetShaderPipelines()

TArrayView< const TMemoryImagePtr< FShaderPipeline > > FShaderMapContent::GetShaderPipelines ( ) const
inline

◆ GetShaderPlatform()

EShaderPlatform FShaderMapContent::GetShaderPlatform ( ) const

◆ GetShaders()

TArrayView< const TMemoryImagePtr< FShader > > FShaderMapContent::GetShaders ( ) const
inline

◆ HasShader() [1/2]

bool FShaderMapContent::HasShader ( const FHashedName TypeName,
int32  PermutationId 
) const
inline

Finds the shader with the given type.

◆ HasShader() [2/2]

bool FShaderMapContent::HasShader ( const FShaderType Type,
int32  PermutationId 
) const
inline

◆ HasShaderPipeline() [1/2]

bool FShaderMapContent::HasShaderPipeline ( const FHashedName PipelineTypeName) const
inline

◆ HasShaderPipeline() [2/2]

bool FShaderMapContent::HasShaderPipeline ( const FShaderPipelineType PipelineType) const
inline

◆ IsEmpty()

bool FShaderMapContent::IsEmpty ( ) const
inline
Returns
true if the map is empty

◆ LAYOUT_FIELD() [1/6]

FShaderMapContent::LAYOUT_FIELD ( FMemoryImageHashTable  ,
ShaderHash   
)
protected

◆ LAYOUT_FIELD() [2/6]

FShaderMapContent::LAYOUT_FIELD ( FMemoryImageName  ,
ShaderPlatformName   
)
protected

The ShaderPlatform Name this shader map was compiled with

◆ LAYOUT_FIELD() [3/6]

FShaderMapContent::LAYOUT_FIELD ( TMemoryImageArray< FHashedName ,
ShaderTypes   
)
protected

◆ LAYOUT_FIELD() [4/6]

FShaderMapContent::LAYOUT_FIELD ( TMemoryImageArray< int32 ,
ShaderPermutations   
)
protected

◆ LAYOUT_FIELD() [5/6]

FShaderMapContent::LAYOUT_FIELD ( TMemoryImageArray< TMemoryImagePtr< FShader > >  ,
Shaders   
)
protected

◆ LAYOUT_FIELD() [6/6]

FShaderMapContent::LAYOUT_FIELD ( TMemoryImageArray< TMemoryImagePtr< FShaderPipeline > >  ,
ShaderPipelines   
)
protected

◆ RemoveShaderPipelineType()

void FShaderMapContent::RemoveShaderPipelineType ( const FShaderPipelineType ShaderPipelineType)

◆ RemoveShaderTypePermutaion() [1/2]

void FShaderMapContent::RemoveShaderTypePermutaion ( const FHashedName TypeName,
int32  PermutationId 
)

Removes the shader of the given type from the shader map

Parameters
TypeShader type to remove the entry for

◆ RemoveShaderTypePermutaion() [2/2]

void FShaderMapContent::RemoveShaderTypePermutaion ( const FShaderType Type,
int32  PermutationId 
)
inline

◆ UpdateHash()

void FShaderMapContent::UpdateHash ( FSHA1 Hasher) const

◆ Validate()

void FShaderMapContent::Validate ( const FShaderMapBase InShaderMap) const

The documentation for this class was generated from the following files: