engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Protected 属性 | 友元 | 所有成员列表
FShaderType类 参考

An object which is used to serialize/deserialize, compile, and cache a particular shader class. 更多...

#include <Shader.h>

+ 类 FShaderType 继承关系图:

Public 成员函数

void AddReferencedUniformBufferIncludes (FShaderCompilerEnvironment &OutEnvironment, FString &OutSourceFilePrefix, EShaderPlatform Platform)
 Adds include statements for uniform buffers that this shader type references, and builds a prefix for the shader file with the include statements.
 
FShader * ConstructForDeserialization () const
 Constructs a new instance of the shader type for deserialization.
 
 FShaderType (EShaderTypeForDynamicCast InShaderTypeForDynamicCast, FTypeLayoutDesc &InTypeLayout, const TCHAR *InName, const TCHAR *InSourceFilename, const TCHAR *InFunctionName, uint32 InFrequency, int32 TotalPermutationCount, ConstructSerializedType InConstructSerializedRef, ConstructCompiledType InConstructCompiledRef, ModifyCompilationEnvironmentType InModifyCompilationEnvironmentRef, ShouldCompilePermutationType InShouldCompilePermutationRef, ValidateCompiledResultType InValidateCompiledResultRef, uint32 InTypeSize, const FShaderParametersMetadata *InRootParametersMetadata)
 Minimal initialization constructor.
 
const FShaderParametersMetadata * GetRootParametersMetadata () const
 Returns the meta data for the root shader parameter struct.
 
const FSHAHash & GetSourceHash (EShaderPlatform ShaderPlatform) const
 Calculates a Hash based on this shader type's source code and includes
 
bool ValidateCompiledResult (EShaderPlatform Platform, const FShaderParameterMap &ParameterMap, TArray< FString > &OutError) const
 Checks if the shader type should pass compilation for a particular set of parameters. 更多...
 

静态 Public 成员函数

static TMap< FHashedName, FShaderType * > & GetNameToTypeMap ()
 
static TLinkedList< FShaderType * > *& GetTypeList ()
 
static void Initialize (const TMap< FString, TArray< const TCHAR * > > &ShaderFileToUniformBufferVariables)
 Initialize FShaderType static members, this must be called before any shader types are created.
 
static void Uninitialize ()
 Uninitializes FShaderType cached data.
 

Protected 属性

bool bCachedUniformBufferStructDeclarations
 Tracks what platforms ReferencedUniformBufferStructsCache has had declarations cached for.
 
TMap< const TCHAR *, FCachedUniformBufferDeclaration > ReferencedUniformBufferStructsCache
 Cache of referenced uniform buffer includes. 更多...
 

友元

void RENDERCORE_API DumpShaderStats (EShaderPlatform Platform, EShaderFrequency Frequency)
 Dumps shader stats to the log. 更多...
 
uint32 GetTypeHash (FShaderType *Ref)
 Hashes a pointer to a shader type.
 
RENDERCORE_API friend FArchive & operator<< (FArchive &Ar, FShaderType *&Ref)
 Serializes a shader type reference by name.
 

详细描述

An object which is used to serialize/deserialize, compile, and cache a particular shader class.

A shader type can manage multiple instance of FShader across mutiple dimensions such as EShaderPlatform, or permutation id. The number of permutation of a shader type is simply given by GetPermutationCount().

成员函数说明

◆ GetNameToTypeMap()

static TMap< FHashedName, FShaderType * > & FShaderType::GetNameToTypeMap ( )
static
返回
The global shader name to type map

◆ GetTypeList()

static TLinkedList< FShaderType * > *& FShaderType::GetTypeList ( )
static
返回
The global shader factory list.

◆ ValidateCompiledResult()

bool FShaderType::ValidateCompiledResult ( EShaderPlatform  Platform,
const FShaderParameterMap &  ParameterMap,
TArray< FString > &  OutError 
) const

Checks if the shader type should pass compilation for a particular set of parameters.

参数
Platform- Platform to validate.
ParameterMap- Shader parameters to validate.
OutError- List for appending validation errors.

友元及相关函数文档

◆ DumpShaderStats

void RENDERCORE_API DumpShaderStats ( EShaderPlatform  Platform,
EShaderFrequency  Frequency 
)
friend

Dumps shader stats to the log.

Will also print some shader pipeline information.

参数
Platform- Platform to dump shader info for, use SP_NumPlatforms for all
Frequency- Whether to dump PS or VS info, use SF_NumFrequencies to dump both

类成员变量说明

◆ ReferencedUniformBufferStructsCache

TMap<const TCHAR*, FCachedUniformBufferDeclaration> FShaderType::ReferencedUniformBufferStructsCache
protected

Cache of referenced uniform buffer includes.

These are derived from source files so they need to be flushed when editing and recompiling shaders on the fly. FShaderType::Initialize will add an entry for each referenced uniform buffer, but the declarations are added on demand as shaders are compiled.


该类的文档由以下文件生成: