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().
|
static |
|
static |
| 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. |
|
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 |
|
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.