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

#include <MaterialShared.h>

+ Inheritance diagram for FMaterialShaderMap:

Public Types

using Super = TShaderMap< FMaterialShaderMapContent, FShaderMapPointerTable >
 

Public Member Functions

 FMaterialShaderMap ()
 
virtual ~FMaterialShaderMap ()
 
TShaderRef< FShaderGetShader (FShaderType *ShaderType, int32 PermutationId=0) const
 
template<typename ShaderType >
TShaderRef< ShaderType > GetShader (int32 PermutationId=0) const
 
template<typename ShaderType >
TShaderRef< ShaderType > GetShader (const typename ShaderType::FPermutationDomain &PermutationVector) const
 
uint32 GetMaxNumInstructionsForShader (FShaderType *ShaderType) const
 
bool IsComplete (const FMaterial *Material, bool bSilent)
 
FPSOPrecacheDataArray CollectPSOPrecacheData (const FMaterialPSOPrecacheParams &PrecacheParams)
 
ENGINE_API void GetShaderList (TMap< FShaderId, TShaderRef< FShader > > &OutShaders) const
 
virtual ENGINE_API void GetShaderList (TMap< FHashedName, TShaderRef< FShader > > &OutShaders) const override
 
virtual void DumpShaderList (FShaderListReport &Out) const
 
virtual ENGINE_API void GetShaderPipelineList (TArray< FShaderPipelineRef > &OutShaderPipelines) const override
 
ENGINE_API uint32 GetShaderNum () const
 
void Register (EShaderPlatform InShaderPlatform)
 
void RegisterForODSC (EShaderPlatform InShaderPlatform)
 
ENGINE_API void AddRef ()
 
ENGINE_API void Release ()
 
bool Serialize (FShaderSerializeContext &Ctx)
 
const FMeshMaterialShaderMapGetMeshShaderMap (const FVertexFactoryType *VertexFactoryType) const
 
const FMeshMaterialShaderMapGetMeshShaderMap (const FHashedName &VertexFactoryTypeName) const
 
FMeshMaterialShaderMapAcquireMeshShaderMap (const FVertexFactoryType *VertexFactoryType)
 
FMeshMaterialShaderMapAcquireMeshShaderMap (const FHashedName &VertexFactoryTypeName)
 
const FMaterialShaderMapIdGetShaderMapId () const
 
const FSHAHashGetShaderContentHash () const
 
bool IsCompilationFinalized () const
 
bool CompiledSuccessfully () const
 
const TCHARGetFriendlyName () const
 
const TCHARGetDebugDescription () const
 
const TCHARGetMaterialPath () const
 
bool RequiresSceneColorCopy () const
 
bool NeedsSceneTextures () const
 
bool UsesGlobalDistanceField () const
 
bool UsesWorldPositionOffset () const
 
bool UsesTemporalResponsiveness () const
 
bool UsesMotionVectorWorldOffset () const
 
bool UsesDisplacement () const
 
bool NeedsGBuffer () const
 
bool UsesEyeAdaptation () const
 
bool ModifiesMeshPosition () const
 
bool UsesPixelDepthOffset () const
 
bool UsesSceneDepthLookup () const
 
bool UsesVelocitySceneTexture () const
 
bool UsesDistanceCullFade () const
 
bool UsesAnisotropy () const
 
bool IsLightFunctionAtlasCompatible () const
 
const FSubstrateMaterialCompilationOutputGetSubstrateMaterialCompilationOutput () const
 
uint8 GetSubstrateMaterialType () const
 
uint8 GetSubstrateClosureCount () const
 
uint8 GetSubstrateUintPerPixel () const
 
ESubstrateBsdfFeature GetSubstrateMaterialBsdfFeatures () const
 
ESubstrateTileType GetSubstrateTileType () const
 
uint32 GetNumVirtualTextureStacks () const
 
uint8 GetRuntimeVirtualTextureOutputAttributeMask () const
 
bool UsesSceneTexture (uint32 TexId) const
 
TConstArrayView< FScriptNameGetUserSceneTextureInputs () const
 
FScriptName GetUserSceneTextureOutput () const
 
FIntPoint GetUserTextureDivisor () const
 
FScriptName GetResolutionRelativeToInput () const
 
bool UsesPathTracingBufferTexture (uint32 TexId) const
 
bool IsValidForRendering (bool bFailOnInvalid=false) const
 
const FUniformExpressionSetGetUniformExpressionSet () const
 
const FRHIUniformBufferLayoutGetUniformBufferLayout () const
 
int32 GetNumRefs () const
 
int32 GetRefCount () const
 
void CountNumShaders (int32 &NumShaders, int32 &NumPipelines) const
 
void DumpDebugInfo (FOutputDevice &OutputDevice) const
 
- Public Member Functions inherited from TShaderMap< FMaterialShaderMapContent, FShaderMapPointerTable >
const FShaderMapPointerTableGetPointerTable () const
 
const FMaterialShaderMapContentGetContent () const
 
FMaterialShaderMapContentGetMutableContent ()
 
void FinalizeContent ()
 
- Public Member Functions inherited from FShaderMapBase
virtual RENDERCORE_API ~FShaderMapBase ()
 
RENDERCORE_API FShaderMapResourceCodeGetResourceCode ()
 
FShaderMapResourceGetResource () const
 
FShaderMapResourceGetResourceChecked () const
 
const FShaderMapPointerTableGetPointerTable () const
 
const FShaderMapContentGetContent () const
 
FShaderMapContentGetMutableContent ()
 
EShaderPlatform GetShaderPlatform () const
 
uint32 GetFrozenContentSize () const
 
RENDERCORE_API void AssignContent (TMemoryImageObject< FShaderMapContent > InContent)
 
RENDERCORE_API void FinalizeContent ()
 
RENDERCORE_API void UnfreezeContent ()
 
RENDERCORE_API bool Serialize (FShaderSerializeContext &Ctx)
 
EShaderPermutationFlags GetPermutationFlags () const
 
RENDERCORE_API FString ToString () const
 
- Public Member Functions inherited from FDeferredCleanupInterface
virtual ~FDeferredCleanupInterface ()
 

Static Public Member Functions

static TRefCountPtr< FMaterialShaderMapFindId (const FMaterialShaderMapId &ShaderMapId, EShaderPlatform Platform)
 
static ENGINE_API void SaveForRemoteRecompile (FArchive &Ar, const TMap< FString, TArray< TRefCountPtr< FMaterialShaderMap > > > &CompiledShaderMaps)
 
static ENGINE_API void LoadForRemoteRecompile (FArchive &Ar, EShaderPlatform ShaderPlatform, TArray< UMaterialInterface * > &OutLoadedMaterials)
 

Protected Member Functions

void PostFinalizeContent () override
 
- Protected Member Functions inherited from TShaderMap< FMaterialShaderMapContent, FShaderMapPointerTable >
virtual const FTypeLayoutDescGetContentTypeDesc () const final override
 
virtual FShaderMapPointerTableCreatePointerTable () const final override
 
- Protected Member Functions inherited from FShaderMapBase
RENDERCORE_API FShaderMapBase ()
 
RENDERCORE_API void AssignCopy (const FShaderMapBase &Source)
 
RENDERCORE_API void InitResource ()
 
RENDERCORE_API void DestroyContent ()
 

Friends

class FShaderCompilingManager
 
class UE::Cook::FODSCClientData
 
ENGINE_API void DumpMaterialStats (EShaderPlatform Platform)
 

Detailed Description

The set of material shaders for a single material.

Member Typedef Documentation

◆ Super

Constructor & Destructor Documentation

◆ FMaterialShaderMap()

FMaterialShaderMap::FMaterialShaderMap ( )

◆ ~FMaterialShaderMap()

FMaterialShaderMap::~FMaterialShaderMap ( )
virtual

Member Function Documentation

◆ AcquireMeshShaderMap() [1/2]

FMeshMaterialShaderMap * FMaterialShaderMap::AcquireMeshShaderMap ( const FHashedName VertexFactoryTypeName)
inline

◆ AcquireMeshShaderMap() [2/2]

FMeshMaterialShaderMap * FMaterialShaderMap::AcquireMeshShaderMap ( const FVertexFactoryType VertexFactoryType)
inline

◆ AddRef()

void FMaterialShaderMap::AddRef ( )

◆ CollectPSOPrecacheData()

FPSOPrecacheDataArray FMaterialShaderMap::CollectPSOPrecacheData ( const FMaterialPSOPrecacheParams PrecacheParams)

Collect all possible PSO's which can be used with this material shader map for given parameters

◆ CompiledSuccessfully()

bool FMaterialShaderMap::CompiledSuccessfully ( ) const
inline

◆ CountNumShaders()

void FMaterialShaderMap::CountNumShaders ( int32 NumShaders,
int32 NumPipelines 
) const
inline

◆ DumpDebugInfo()

void FMaterialShaderMap::DumpDebugInfo ( FOutputDevice OutputDevice) const

◆ DumpShaderList()

void FMaterialShaderMap::DumpShaderList ( FShaderListReport Out) const
virtual

Reimplemented from FShaderMapBase.

◆ FindId()

TRefCountPtr< FMaterialShaderMap > FMaterialShaderMap::FindId ( const FMaterialShaderMapId ShaderMapId,
EShaderPlatform  InPlatform 
)
static

Finds the shader map for a material.

Parameters
ShaderMapId- The static parameter set and other properties identifying the shader map
Platform- The platform to lookup for
Returns
NULL if no cached shader map was found.

Finds the shader map for a material.

Parameters
StaticParameterSet- The static parameter set identifying the shader map
Platform- The platform to lookup for
Returns
NULL if no cached shader map was found.

◆ GetDebugDescription()

const TCHAR * FMaterialShaderMap::GetDebugDescription ( ) const
inline

◆ GetFriendlyName()

const TCHAR * FMaterialShaderMap::GetFriendlyName ( ) const
inline

◆ GetMaterialPath()

const TCHAR * FMaterialShaderMap::GetMaterialPath ( ) const
inline

◆ GetMaxNumInstructionsForShader()

uint32 FMaterialShaderMap::GetMaxNumInstructionsForShader ( FShaderType ShaderType) const
inline

◆ GetMeshShaderMap() [1/2]

const FMeshMaterialShaderMap * FMaterialShaderMap::GetMeshShaderMap ( const FHashedName VertexFactoryTypeName) const
inline

◆ GetMeshShaderMap() [2/2]

const FMeshMaterialShaderMap * FMaterialShaderMap::GetMeshShaderMap ( const FVertexFactoryType VertexFactoryType) const
inline

◆ GetNumRefs()

int32 FMaterialShaderMap::GetNumRefs ( ) const
inline

◆ GetNumVirtualTextureStacks()

uint32 FMaterialShaderMap::GetNumVirtualTextureStacks ( ) const
inline

◆ GetRefCount()

int32 FMaterialShaderMap::GetRefCount ( ) const
inline

◆ GetResolutionRelativeToInput()

FScriptName FMaterialShaderMap::GetResolutionRelativeToInput ( ) const
inline

◆ GetRuntimeVirtualTextureOutputAttributeMask()

uint8 FMaterialShaderMap::GetRuntimeVirtualTextureOutputAttributeMask ( ) const
inline

◆ GetShader() [1/3]

template<typename ShaderType >
TShaderRef< ShaderType > FMaterialShaderMap::GetShader ( const typename ShaderType::FPermutationDomain &  PermutationVector) const
inline

◆ GetShader() [2/3]

TShaderRef< FShader > FMaterialShaderMap::GetShader ( FShaderType ShaderType,
int32  PermutationId = 0 
) const
inline

◆ GetShader() [3/3]

template<typename ShaderType >
TShaderRef< ShaderType > FMaterialShaderMap::GetShader ( int32  PermutationId = 0) const
inline

◆ GetShaderContentHash()

const FSHAHash & FMaterialShaderMap::GetShaderContentHash ( ) const
inline

◆ GetShaderList() [1/2]

void FMaterialShaderMap::GetShaderList ( TMap< FHashedName, TShaderRef< FShader > > &  OutShaders) const
overridevirtual

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

Implements FShaderMapBase.

◆ GetShaderList() [2/2]

void FMaterialShaderMap::GetShaderList ( TMap< FShaderId, TShaderRef< FShader > > &  OutShaders) const

Builds a list of the shaders in a shader map.

◆ GetShaderMapId()

const FMaterialShaderMapId & FMaterialShaderMap::GetShaderMapId ( ) const
inline

◆ GetShaderNum()

uint32 FMaterialShaderMap::GetShaderNum ( ) const

Number of Shaders in Shadermap

◆ GetShaderPipelineList()

void FMaterialShaderMap::GetShaderPipelineList ( TArray< FShaderPipelineRef > &  OutShaderPipelines) const
overridevirtual

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

Implements FShaderMapBase.

◆ GetSubstrateClosureCount()

uint8 FMaterialShaderMap::GetSubstrateClosureCount ( ) const
inline

◆ GetSubstrateMaterialBsdfFeatures()

ESubstrateBsdfFeature FMaterialShaderMap::GetSubstrateMaterialBsdfFeatures ( ) const
inline

◆ GetSubstrateMaterialCompilationOutput()

const FSubstrateMaterialCompilationOutput & FMaterialShaderMap::GetSubstrateMaterialCompilationOutput ( ) const
inline

◆ GetSubstrateMaterialType()

uint8 FMaterialShaderMap::GetSubstrateMaterialType ( ) const
inline

◆ GetSubstrateTileType()

ESubstrateTileType FMaterialShaderMap::GetSubstrateTileType ( ) const
inline

◆ GetSubstrateUintPerPixel()

uint8 FMaterialShaderMap::GetSubstrateUintPerPixel ( ) const
inline

◆ GetUniformBufferLayout()

const FRHIUniformBufferLayout * FMaterialShaderMap::GetUniformBufferLayout ( ) const
inline

◆ GetUniformExpressionSet()

const FUniformExpressionSet & FMaterialShaderMap::GetUniformExpressionSet ( ) const
inline

◆ GetUserSceneTextureInputs()

TConstArrayView< FScriptName > FMaterialShaderMap::GetUserSceneTextureInputs ( ) const
inline

◆ GetUserSceneTextureOutput()

FScriptName FMaterialShaderMap::GetUserSceneTextureOutput ( ) const
inline

◆ GetUserTextureDivisor()

FIntPoint FMaterialShaderMap::GetUserTextureDivisor ( ) const
inline

◆ IsCompilationFinalized()

bool FMaterialShaderMap::IsCompilationFinalized ( ) const
inline

◆ IsComplete()

bool FMaterialShaderMap::IsComplete ( const FMaterial Material,
bool  bSilent 
)

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

Parameters
Material- The material which is checked.
Returns
True if the shader map has all of the shader types necessary.

◆ IsLightFunctionAtlasCompatible()

bool FMaterialShaderMap::IsLightFunctionAtlasCompatible ( ) const
inline

◆ IsValidForRendering()

bool FMaterialShaderMap::IsValidForRendering ( bool  bFailOnInvalid = false) const
inline

◆ LoadForRemoteRecompile()

void FMaterialShaderMap::LoadForRemoteRecompile ( FArchive Ar,
EShaderPlatform  ShaderPlatform,
TArray< UMaterialInterface * > &  OutLoadedMaterials 
)
static

◆ ModifiesMeshPosition()

bool FMaterialShaderMap::ModifiesMeshPosition ( ) const
inline

◆ NeedsGBuffer()

bool FMaterialShaderMap::NeedsGBuffer ( ) const
inline

◆ NeedsSceneTextures()

bool FMaterialShaderMap::NeedsSceneTextures ( ) const
inline

◆ PostFinalizeContent()

void FMaterialShaderMap::PostFinalizeContent ( )
overrideprotectedvirtual

Reimplemented from FShaderMapBase.

◆ Register()

void FMaterialShaderMap::Register ( EShaderPlatform  InShaderPlatform)

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

◆ RegisterForODSC()

void FMaterialShaderMap::RegisterForODSC ( EShaderPlatform  InShaderPlatform)

Registers a material shader map in the global map so it can be used by materials. Since the shader maps content can change this will overwrite entries in the global map.

◆ Release()

void FMaterialShaderMap::Release ( )

◆ RequiresSceneColorCopy()

bool FMaterialShaderMap::RequiresSceneColorCopy ( ) const
inline

◆ SaveForRemoteRecompile()

void FMaterialShaderMap::SaveForRemoteRecompile ( FArchive Ar,
const TMap< FString, TArray< TRefCountPtr< FMaterialShaderMap > > > &  CompiledShaderMaps 
)
static

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

◆ Serialize()

bool FMaterialShaderMap::Serialize ( FShaderSerializeContext Ctx)

Serializes the shader map.

◆ UsesAnisotropy()

bool FMaterialShaderMap::UsesAnisotropy ( ) const
inline

◆ UsesDisplacement()

bool FMaterialShaderMap::UsesDisplacement ( ) const
inline

◆ UsesDistanceCullFade()

bool FMaterialShaderMap::UsesDistanceCullFade ( ) const
inline

◆ UsesEyeAdaptation()

bool FMaterialShaderMap::UsesEyeAdaptation ( ) const
inline

◆ UsesGlobalDistanceField()

bool FMaterialShaderMap::UsesGlobalDistanceField ( ) const
inline

◆ UsesMotionVectorWorldOffset()

bool FMaterialShaderMap::UsesMotionVectorWorldOffset ( ) const
inline

◆ UsesPathTracingBufferTexture()

bool FMaterialShaderMap::UsesPathTracingBufferTexture ( uint32  TexId) const
inline

◆ UsesPixelDepthOffset()

bool FMaterialShaderMap::UsesPixelDepthOffset ( ) const
inline

◆ UsesSceneDepthLookup()

bool FMaterialShaderMap::UsesSceneDepthLookup ( ) const
inline

◆ UsesSceneTexture()

bool FMaterialShaderMap::UsesSceneTexture ( uint32  TexId) const
inline

◆ UsesTemporalResponsiveness()

bool FMaterialShaderMap::UsesTemporalResponsiveness ( ) const
inline

◆ UsesVelocitySceneTexture()

bool FMaterialShaderMap::UsesVelocitySceneTexture ( ) const
inline

◆ UsesWorldPositionOffset()

bool FMaterialShaderMap::UsesWorldPositionOffset ( ) const
inline

Friends And Related Symbol Documentation

◆ DumpMaterialStats

ENGINE_API void DumpMaterialStats ( EShaderPlatform  Platform)
friend

Dump material stats for a given platform.

Parameters
PlatformPlatform to dump stats for.

◆ FShaderCompilingManager

◆ UE::Cook::FODSCClientData

friend class UE::Cook::FODSCClientData
friend

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