Navigation
API > API/Runtime > API/Runtime/Engine
The set of material shaders for a single material.
| Name | FMaterialShaderMap |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/MaterialShared.h |
| Include Path | #include "MaterialShared.h" |
Syntax
class FMaterialShaderMap :
public TShaderMap< FMaterialShaderMapContent, FShaderMapPointerTable > ,
public FDeferredCleanupInterface
Inheritance Hierarchy
- FDeferredCleanupInterface → FMaterialShaderMap
- FShaderMapBase → TShaderMap → FMaterialShaderMap
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FMaterialShaderMap() |
MaterialShared.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FMaterialShaderMap() |
MaterialShared.h |
Structs
| Name | Remarks |
|---|---|
| FAsyncLoadContext | A context returned by BeginLoadFromDerivedDataCache that can be queried to know the state of the async request. |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FLWCUsagesArray | TStaticArray< uint16,(int) ELWCFunctionKind::Max > | MaterialShared.h | |
| Super | TShaderMap< FMaterialShaderMapContent, FShaderMapPointerTable > | MaterialShared.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| AllMaterialShaderMaps | TArray< FMaterialShaderMap * > | All material shader maps in memory. | MaterialShared.h |
| AllMaterialShaderMapsGuard | FCriticalSection | Guards access to AllMaterialShaderMaps, which can be written to from an async loading thread. | MaterialShared.h |
| GIdToMaterialShaderMap | TMap< FMaterialShaderMapId, FMaterialShaderMap * > | A global map from a material's static parameter set to any shader map cached for that material. | MaterialShared.h |
| GIdToMaterialShaderMapCS | FCriticalSection | MaterialShared.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bCompilationFinalized | uint32 | Indicates whether this shader map has had ProcessCompilationResults called after Compile. | MaterialShared.h | |
| bCompiledSuccessfully | uint32 | MaterialShared.h | ||
| bDeletedThroughDeferredCleanup | bool | Used to catch errors where the shader map is deleted directly. | MaterialShared.h | |
| bIsFromODSC | uint32 | Indicates whether the shader map is from ODSC | MaterialShared.h | |
| bIsPersistent | uint32 | Indicates whether the shader map should be stored in the shader cache. | MaterialShared.h | |
| bRegistered | uint32 | Indicates whether this shader map has been registered in GIdToMaterialShaderMap | MaterialShared.h | |
| CompileTime | float | MaterialShared.h | ||
| CompilingId | uint32 | Tracks material resources and their shader maps that need to be compiled but whose compilation is being deferred. | MaterialShared.h | |
| CompilingMaterialDependencies | TArray< TRefCountPtr< FMaterial > > | MaterialShared.h | ||
| CompilingMaterialNumExternalDependencies | int32 | MaterialShared.h | ||
| FinalizedClone | TRefCountPtr< FMaterialShaderMap > | MaterialShared.h | ||
| InFlightJobs | TMap< uint32, TPair< FString, TSharedPtr< FShaderCompileJobStatus > > > | InFlightJobs is only populated during cooking as its current use is to track cook hangs. | MaterialShared.h | |
| NumRefs | int32 | MaterialShared.h | ||
| PendingCompilerEnvironment | TRefCountPtr< FSharedShaderCompilerEnvironment > | MaterialShared.h | ||
| ShaderMapId | FMaterialShaderMapId | The static parameter set that this shader map was compiled with and other parameters unique to this shadermap | MaterialShared.h | |
| UniformBufferLayout | FUniformBufferLayoutRHIRef | MaterialShared.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
uint32 AcquireCompilingId
(
const TRefCountPtr< FSharedShaderCompilerEnvironment >& InMaterialEnvironment |
MaterialShared.h | ||
FMaterialShaderMap * AcquireFinalizedClone() |
MaterialShared.h | ||
FMeshMaterialShaderMap * AcquireMeshShaderMap
(
const FHashedName& VertexFactoryTypeName |
MaterialShared.h | ||
FMeshMaterialShaderMap * AcquireMeshShaderMap
(
const FVertexFactoryType* VertexFactoryType |
MaterialShared.h | ||
void AddCompilingDependency
(
FMaterial* Material |
MaterialShared.h | ||
void AddRef() |
Reference counting. | MaterialShared.h | |
void AppendCompileStateDebugInfo
(
FStringBuilderBase& OutDebugInfo |
MaterialShared.h | ||
FPSOPrecacheDataArray CollectPSOPrecacheData
(
const FMaterialPSOPrecacheParams& PrecacheParams |
Collect all possible PSO's which can be used with this material shader map for given parameters | MaterialShared.h | |
void Compile
(
FMaterial* Material, |
Compiles the shaders for a material and caches them in this shader map. | MaterialShared.h | |
bool CompiledSuccessfully() |
MaterialShared.h | ||
void CountNumShaders
(
int32& NumShaders, |
MaterialShared.h | ||
void DumpDebugInfo
(
FOutputDevice& OutputDevice |
MaterialShared.h | ||
uint32 GetCompilingId() |
MaterialShared.h | ||
const TCHAR * GetDebugDescription() |
MaterialShared.h | ||
void GetEstimatedLWCFuncUsageComplexity
(
uint32& LWCComplexityVS, |
MaterialShared.h | ||
void GetEstimatedLWCFuncUsages
(
FLWCUsagesArray& UsagesVS, |
MaterialShared.h | ||
void GetEstimatedNumTextureSamples
(
uint32& VSSamples, |
MaterialShared.h | ||
uint32 GetEstimatedNumVirtualTextureLookups() |
MaterialShared.h | ||
FMaterialShaderMap * GetFinalizedClone() |
MaterialShared.h | ||
const TCHAR * GetFriendlyName() |
MaterialShared.h | ||
const TCHAR * GetMaterialPath() |
MaterialShared.h | ||
uint32 GetMaxNumInstructionsForShader
(
FShaderType* ShaderType |
MaterialShared.h | ||
uint32 GetMaxTextureSamplers() |
Returns the maximum number of texture samplers used by any shader in this shader map. | MaterialShared.h | |
const FMeshMaterialShaderMap * GetMeshShaderMap
(
const FVertexFactoryType* VertexFactoryType |
Accessors. | MaterialShared.h | |
const FMeshMaterialShaderMap * GetMeshShaderMap
(
const FHashedName& VertexFactoryTypeName |
MaterialShared.h | ||
uint32 GetNumPreshaders() |
MaterialShared.h | ||
int32 GetNumRefs() |
MaterialShared.h | ||
uint32 GetNumUsedCustomInterpolatorScalars() |
MaterialShared.h | ||
uint32 GetNumUsedUVScalars() |
MaterialShared.h | ||
uint32 GetNumVirtualTextureStacks() |
MaterialShared.h | ||
void GetOutdatedTypes
(
TArray< const FShaderType* >& OutdatedShaderTypes, |
MaterialShared.h | ||
const TRefCountPtr< FSharedShaderCompilerEnvironment > & GetPendingCompilerEnvironment() |
MaterialShared.h | ||
int32 GetRefCount() |
MaterialShared.h | ||
FScriptName GetResolutionRelativeToInput() |
MaterialShared.h | ||
uint8 GetRuntimeVirtualTextureOutputAttributeMask() |
MaterialShared.h | ||
TShaderRef< ShaderType > GetShader
(
int32 PermutationId |
MaterialShared.h | ||
TShaderRef< ShaderType > GetShader
(
const typename ShaderType::FPermutationDomain& PermutationVector |
MaterialShared.h | ||
TShaderRef< FShader > GetShader
(
FShaderType* ShaderType, |
MaterialShared.h | ||
const FSHAHash & GetShaderContentHash() |
MaterialShared.h | ||
void GetShaderList
(
TMap< FShaderId, TShaderRef< FShader > >& OutShaders |
Builds a list of the shaders in a shader map. | MaterialShared.h | |
const FMaterialShaderMapId & GetShaderMapId() |
MaterialShared.h | ||
uint32 GetShaderNum() |
Number of Shaders in Shadermap | MaterialShared.h | |
const FMemoryImageString * GetShaderSource
(
const FVertexFactoryType* VertexFactoryType, |
MaterialShared.h | ||
uint8 GetSubstrateClosureCount() |
MaterialShared.h | ||
const FSubstrateMaterialCompilationOutput & GetSubstrateMaterialCompilationOutput() |
MaterialShared.h | ||
uint8 GetSubstrateMaterialType() |
MaterialShared.h | ||
uint8 GetSubstrateUintPerPixel() |
MaterialShared.h | ||
bool GetSubstrateUsesComplexSpecialRenderPath() |
MaterialShared.h | ||
const FRHIUniformBufferLayout * GetUniformBufferLayout() |
MaterialShared.h | ||
const FUniformExpressionSet & GetUniformExpressionSet() |
MaterialShared.h | ||
TConstArrayView< FScriptName > GetUserSceneTextureInputs() |
MaterialShared.h | ||
FScriptName GetUserSceneTextureOutput() |
MaterialShared.h | ||
FIntPoint GetUserTextureDivisor() |
MaterialShared.h | ||
void InitalizeForODSC
(
EShaderPlatform TargetShaderPlatform, |
MaterialShared.h | ||
bool IsCompilationFinalized() |
MaterialShared.h | ||
bool IsComplete
(
const FMaterial* Material, |
Checks whether the material shader map is missing any shader types necessary for the given material. | MaterialShared.h | |
bool IsLightFunctionAtlasCompatible() |
MaterialShared.h | ||
bool IsValidForRendering
(
bool bFailOnInvalid |
MaterialShared.h | ||
void LoadMissingShadersFromMemory
(
const FMaterial* Material |
Attempts to load missing shaders from memory. | MaterialShared.h | |
bool ModifiesMeshPosition() |
MaterialShared.h | ||
bool NeedsGBuffer() |
MaterialShared.h | ||
bool NeedsSceneTextures() |
MaterialShared.h | ||
void ProcessCompilationResults
(
const TArray< TRefCountPtr< FShaderCommonCompileJob > >& ICompilationResults, |
Sorts the incoming compiled jobs into the appropriate mesh shader maps | MaterialShared.h | |
void Register
(
EShaderPlatform InShaderPlatform |
Registers a material shader map in the global map so it can be used by materials. | MaterialShared.h | |
void RegisterForODSC
(
EShaderPlatform InShaderPlatform |
Registers a material shader map in the global map so it can be used by materials. | MaterialShared.h | |
void Release() |
MaterialShared.h | ||
void ReleaseCompilingId() |
MaterialShared.h | ||
void RemoveCompilingDependency
(
FMaterial* Material |
MaterialShared.h | ||
bool RequiresSceneColorCopy() |
MaterialShared.h | ||
void SaveShaderStableKeys
(
EShaderPlatform TargetShaderPlatform, |
MaterialShared.h | ||
void SaveToDerivedDataCache
(
const FMaterialShaderParameters& ShaderParameters |
Saves this shader map to the derived data cache. | MaterialShared.h | |
bool Serialize
(
FShaderSerializeContext& Ctx |
Serializes the shader map. | MaterialShared.h | |
| MaterialShared.h | |||
void SetCompiledSuccessfully
(
bool bSuccess |
MaterialShared.h | ||
int32 SubmitCompileJobs
(
uint32 CompilingShaderMapId, |
Submits compile jobs for this shadermap, returns number of jobs submitted. | MaterialShared.h | |
bool UsesAnisotropy() |
MaterialShared.h | ||
bool UsesDisplacement() |
MaterialShared.h | ||
bool UsesDistanceCullFade() |
MaterialShared.h | ||
bool UsesEyeAdaptation() |
MaterialShared.h | ||
bool UsesGlobalDistanceField() |
MaterialShared.h | ||
bool UsesPathTracingBufferTexture
(
uint32 TexId |
MaterialShared.h | ||
bool UsesPixelDepthOffset() |
MaterialShared.h | ||
bool UsesSceneDepthLookup() |
MaterialShared.h | ||
bool UsesSceneTexture
(
uint32 TexId |
MaterialShared.h | ||
bool UsesVelocitySceneTexture() |
MaterialShared.h | ||
bool UsesWorldPositionOffset() |
MaterialShared.h |
Overridden from FShaderMapBase
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void DumpShaderList
(
FShaderListReport& Out |
MaterialShared.h | ||
virtual void GetShaderList
(
TMap< FHashedName, TShaderRef< FShader > >& OutShaders |
Builds a list of the shaders in a shader map. Key is FShaderType::TypeName | MaterialShared.h | |
virtual void GetShaderPipelineList
(
TArray< FShaderPipelineRef >& OutShaderPipelines |
Builds a list of the shader pipelines in a shader map. | MaterialShared.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddCompilingMaterialExternalDependency() |
MaterialShared.h | ||
void CheckReleaseCompilingId() |
MaterialShared.h | ||
void RemoveCompilingMaterialExternalDependency() |
MaterialShared.h |
Overridden from FShaderMapBase
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostFinalizeContent() |
MaterialShared.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TSharedRef< FAsyncLoadContext > BeginLoadFromDerivedDataCache
(
const FMaterial* Material, |
Begin an attempts to load the shader map for the given material from the Derived Data Cache. | MaterialShared.h | |
static FMaterialShaderMap * FindCompilingShaderMap
(
uint32 CompilingId |
MaterialShared.h | ||
static TRefCountPtr< FMaterialShaderMap > FindId
(
const FMaterialShaderMapId& ShaderMapId, |
Finds the shader map for a material. Finds the shader map for a material. | MaterialShared.h | |
static void GetAllOutdatedTypes
(
TArray< const FShaderType* >& OutdatedShaderTypes, |
Gets outdated types from all loaded material shader maps | MaterialShared.h | |
static void LoadForRemoteRecompile
(
FArchive& Ar, |
MaterialShared.h | ||
static void LoadFromDerivedDataCache
(
const FMaterial* Material, |
Attempts to load the shader map for the given material from the Derived Data Cache. | MaterialShared.h | |
static void SaveForRemoteRecompile
(
FArchive& Ar, |
Serializes a shader map to an archive (used with recompiling shaders for a remote console) | MaterialShared.h | |
static void ShaderMapResourceExplicitRelease
(
const FShaderMapResource* ShaderMapResource |
Iterate over global MaterialShaderMap cache and remove MaterialShaderMap which reference FShaderMapResource argument | MaterialShared.h |