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

#include <Shader.h>

+ Inheritance diagram for FShaderType:

Classes

class  FParameters
 

Public Types

enum class  EShaderTypeForDynamicCast : uint32 { NumShaderTypes }
 
typedef class FShader *(* ConstructSerializedType) ()
 
typedef FShader *(* ConstructCompiledType) (const FShader::CompiledShaderInitializerType &Initializer)
 
typedef bool(* ShouldCompilePermutationType) (const FShaderPermutationParameters &)
 
typedef EShaderPermutationPrecacheRequest(* ShouldPrecachePermutationType) (const FShaderPermutationParameters &)
 
typedef ERayTracingPayloadType(* GetRayTracingPayloadTypeType) (const int32 PermutationId)
 
typedef const FShaderBindingLayout *(* GetShaderBindingLayoutType) (const FShaderPermutationParameters &)
 

Public Member Functions

RENDERCORE_API FShaderType (EShaderTypeForDynamicCast InShaderTypeForDynamicCast, FTypeLayoutDesc &InTypeLayout, const TCHAR *InName, const TCHAR *InSourceFilename, const TCHAR *InFunctionName, uint32 InFrequency, int32 TotalPermutationCount, ConstructSerializedType InConstructSerializedRef, ConstructCompiledType InConstructCompiledRef, ShouldCompilePermutationType InShouldCompilePermutationRef, ShouldPrecachePermutationType InShouldPrecachePermutationRef, GetRayTracingPayloadTypeType InGetRayTracingPayloadTypeRef, GetShaderBindingLayoutType InGetShaderBindingLayoutTypeRef, uint32 InTypeSize, const FShaderParametersMetadata *InRootParametersMetadata)
 
virtual RENDERCORE_API ~FShaderType ()
 
RENDERCORE_API FShaderConstructForDeserialization () const
 
RENDERCORE_API FShaderConstructCompiled (const FShader::CompiledShaderInitializerType &Initializer) const
 
RENDERCORE_API bool ShouldCompilePermutation (const FShaderPermutationParameters &Parameters) const
 
RENDERCORE_API EShaderPermutationPrecacheRequest ShouldPrecachePermutation (const FShaderPermutationParameters &Parameters) const
 
RENDERCORE_API const FShaderBindingLayoutGetShaderBindingLayout (const FShaderPermutationParameters &Parameters) const
 
RENDERCORE_API ERayTracingPayloadType GetRayTracingPayloadType (const int32 PermutationId) const
 
RENDERCORE_API const FSHAHashGetSourceHash (EShaderPlatform ShaderPlatform) const
 
FGlobalShaderTypeGetGlobalShaderType ()
 
const FGlobalShaderTypeGetGlobalShaderType () const
 
FMaterialShaderTypeGetMaterialShaderType ()
 
const FMaterialShaderTypeGetMaterialShaderType () const
 
FMeshMaterialShaderTypeGetMeshMaterialShaderType ()
 
const FMeshMaterialShaderTypeGetMeshMaterialShaderType () const
 
const FNiagaraShaderTypeGetNiagaraShaderType () const
 
FNiagaraShaderTypeGetNiagaraShaderType ()
 
const FOpenColorIOShaderTypeGetOpenColorIOShaderType () const
 
FOpenColorIOShaderTypeGetOpenColorIOShaderType ()
 
const FComputeKernelShaderTypeGetComputeKernelShaderType () const
 
FComputeKernelShaderTypeGetComputeKernelShaderType ()
 
const FNNERuntimeIREEShaderTypeGetNNERuntimeIREEShaderType () const
 
FNNERuntimeIREEShaderTypeGetNNERuntimeIREEShaderType ()
 
const FGlobalShaderTypeAsGlobalShaderType () const
 
const FMaterialShaderTypeAsMaterialShaderType () const
 
const FMeshMaterialShaderTypeAsMeshMaterialShaderType () const
 
const FNiagaraShaderTypeAsNiagaraShaderType () const
 
const FOpenColorIOShaderTypeAsOpenColorIOShaderType () const
 
EShaderTypeForDynamicCast GetTypeForDynamicCast () const
 
const FTypeLayoutDescGetLayout () const
 
EShaderFrequency GetFrequency () const
 
const TCHARGetName () const
 
const FNameGetFName () const
 
const FHashedNameGetHashedName () const
 
const TCHARGetShaderFilename () const
 
const FHashedNameGetHashedShaderFilename () const
 
const TCHARGetFunctionName () const
 
uint32 GetTypeSize () const
 
int32 GetNumShaders () const
 
int32 GetPermutationCount () const
 
const FShaderParametersMetadataGetRootParametersMetadata () const
 
RENDERCORE_API void DumpDebugInfo ()
 

Static Public Member Functions

static RENDERCORE_API TLinkedList< FShaderType * > *& GetTypeList ()
 
static RENDERCORE_API FShaderTypeGetShaderTypeByName (const TCHAR *Name)
 
static RENDERCORE_API TArray< const FShaderType * > GetShaderTypesByFilename (const TCHAR *Filename, bool bSearchAsRegexFilter=false)
 
static RENDERCORE_API TArray< const FShaderType * > GetShaderTypesByFilenameFilter (const TFunction< bool(const TCHAR *)> &InFilenameFilter)
 
static RENDERCORE_API TMap< FHashedName, FShaderType * > & GetNameToTypeMap ()
 
static RENDERCORE_API const TArray< FShaderType * > & GetSortedTypes (EShaderTypeForDynamicCast Type)
 
static RENDERCORE_API void Initialize (const TMap< FString, TArray< const TCHAR * > > &ShaderFileToUniformBufferVariables)
 
static RENDERCORE_API void Uninitialize ()
 

Friends

RENDERCORE_API friend FArchiveoperator<< (FArchive &Ar, FShaderType *&Ref)
 
uint32 GetTypeHash (FShaderType *Ref)
 
void RENDERCORE_API DumpShaderStats (EShaderPlatform Platform, EShaderFrequency Frequency)
 

Detailed Description

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

Member Typedef Documentation

◆ ConstructCompiledType

typedef FShader *(* FShaderType::ConstructCompiledType) (const FShader::CompiledShaderInitializerType &Initializer)

◆ ConstructSerializedType

typedef class FShader *(* FShaderType::ConstructSerializedType) ()

◆ GetRayTracingPayloadTypeType

typedef ERayTracingPayloadType(* FShaderType::GetRayTracingPayloadTypeType) (const int32 PermutationId)

◆ GetShaderBindingLayoutType

typedef const FShaderBindingLayout *(* FShaderType::GetShaderBindingLayoutType) (const FShaderPermutationParameters &)

◆ ShouldCompilePermutationType

typedef bool(* FShaderType::ShouldCompilePermutationType) (const FShaderPermutationParameters &)

◆ ShouldPrecachePermutationType

typedef EShaderPermutationPrecacheRequest(* FShaderType::ShouldPrecachePermutationType) (const FShaderPermutationParameters &)

Member Enumeration Documentation

◆ EShaderTypeForDynamicCast

Enumerator
NumShaderTypes 

Constructor & Destructor Documentation

◆ FShaderType()

FShaderType::FShaderType ( EShaderTypeForDynamicCast  InShaderTypeForDynamicCast,
FTypeLayoutDesc InTypeLayout,
const TCHAR InName,
const TCHAR InSourceFilename,
const TCHAR InFunctionName,
uint32  InFrequency,
int32  TotalPermutationCount,
ConstructSerializedType  InConstructSerializedRef,
ConstructCompiledType  InConstructCompiledRef,
ShouldCompilePermutationType  InShouldCompilePermutationRef,
ShouldPrecachePermutationType  InShouldPrecachePermutationRef,
GetRayTracingPayloadTypeType  InGetRayTracingPayloadTypeRef,
GetShaderBindingLayoutType  InGetShaderBindingLayoutTypeRef,
uint32  InTypeSize,
const FShaderParametersMetadata InRootParametersMetadata 
)

Minimal initialization constructor.

◆ ~FShaderType()

FShaderType::~FShaderType ( )
virtual

Member Function Documentation

◆ AsGlobalShaderType()

const FGlobalShaderType * FShaderType::AsGlobalShaderType ( ) const
inline

◆ AsMaterialShaderType()

const FMaterialShaderType * FShaderType::AsMaterialShaderType ( ) const
inline

◆ AsMeshMaterialShaderType()

const FMeshMaterialShaderType * FShaderType::AsMeshMaterialShaderType ( ) const
inline

◆ AsNiagaraShaderType()

const FNiagaraShaderType * FShaderType::AsNiagaraShaderType ( ) const
inline

◆ AsOpenColorIOShaderType()

const FOpenColorIOShaderType * FShaderType::AsOpenColorIOShaderType ( ) const
inline

◆ ConstructCompiled()

FShader * FShaderType::ConstructCompiled ( const FShader::CompiledShaderInitializerType Initializer) const

◆ ConstructForDeserialization()

FShader * FShaderType::ConstructForDeserialization ( ) const

Constructs a new instance of the shader type for deserialization.

◆ DumpDebugInfo()

void FShaderType::DumpDebugInfo ( )

◆ GetComputeKernelShaderType() [1/2]

FComputeKernelShaderType * FShaderType::GetComputeKernelShaderType ( )
inline

◆ GetComputeKernelShaderType() [2/2]

const FComputeKernelShaderType * FShaderType::GetComputeKernelShaderType ( ) const
inline

◆ GetFName()

const FName & FShaderType::GetFName ( ) const
inline

◆ GetFrequency()

EShaderFrequency FShaderType::GetFrequency ( ) const
inline

◆ GetFunctionName()

const TCHAR * FShaderType::GetFunctionName ( ) const
inline

◆ GetGlobalShaderType() [1/2]

FGlobalShaderType * FShaderType::GetGlobalShaderType ( )
inline

◆ GetGlobalShaderType() [2/2]

const FGlobalShaderType * FShaderType::GetGlobalShaderType ( ) const
inline

◆ GetHashedName()

const FHashedName & FShaderType::GetHashedName ( ) const
inline

◆ GetHashedShaderFilename()

const FHashedName & FShaderType::GetHashedShaderFilename ( ) const
inline

◆ GetLayout()

const FTypeLayoutDesc & FShaderType::GetLayout ( ) const
inline

◆ GetMaterialShaderType() [1/2]

FMaterialShaderType * FShaderType::GetMaterialShaderType ( )
inline

◆ GetMaterialShaderType() [2/2]

const FMaterialShaderType * FShaderType::GetMaterialShaderType ( ) const
inline

◆ GetMeshMaterialShaderType() [1/2]

FMeshMaterialShaderType * FShaderType::GetMeshMaterialShaderType ( )
inline

◆ GetMeshMaterialShaderType() [2/2]

const FMeshMaterialShaderType * FShaderType::GetMeshMaterialShaderType ( ) const
inline

◆ GetName()

const TCHAR * FShaderType::GetName ( ) const
inline

◆ GetNameToTypeMap()

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

◆ GetNiagaraShaderType() [1/2]

FNiagaraShaderType * FShaderType::GetNiagaraShaderType ( )
inline

◆ GetNiagaraShaderType() [2/2]

const FNiagaraShaderType * FShaderType::GetNiagaraShaderType ( ) const
inline

◆ GetNNERuntimeIREEShaderType() [1/2]

FNNERuntimeIREEShaderType * FShaderType::GetNNERuntimeIREEShaderType ( )
inline

◆ GetNNERuntimeIREEShaderType() [2/2]

const FNNERuntimeIREEShaderType * FShaderType::GetNNERuntimeIREEShaderType ( ) const
inline

◆ GetNumShaders()

int32 FShaderType::GetNumShaders ( ) const
inline

◆ GetOpenColorIOShaderType() [1/2]

FOpenColorIOShaderType * FShaderType::GetOpenColorIOShaderType ( )
inline

◆ GetOpenColorIOShaderType() [2/2]

const FOpenColorIOShaderType * FShaderType::GetOpenColorIOShaderType ( ) const
inline

◆ GetPermutationCount()

int32 FShaderType::GetPermutationCount ( ) const
inline

◆ GetRayTracingPayloadType()

ERayTracingPayloadType FShaderType::GetRayTracingPayloadType ( const int32  PermutationId) const

◆ GetRootParametersMetadata()

const FShaderParametersMetadata * FShaderType::GetRootParametersMetadata ( ) const
inline

Returns the meta data for the root shader parameter struct.

◆ GetShaderBindingLayout()

const FShaderBindingLayout * FShaderType::GetShaderBindingLayout ( const FShaderPermutationParameters Parameters) const

◆ GetShaderFilename()

const TCHAR * FShaderType::GetShaderFilename ( ) const
inline

◆ GetShaderTypeByName()

FShaderType * FShaderType::GetShaderTypeByName ( const TCHAR Name)
static

◆ GetShaderTypesByFilename()

TArray< const FShaderType * > FShaderType::GetShaderTypesByFilename ( const TCHAR Filename,
bool  bSearchAsRegexFilter = false 
)
static

◆ GetShaderTypesByFilenameFilter()

TArray< const FShaderType * > FShaderType::GetShaderTypesByFilenameFilter ( const TFunction< bool(const TCHAR *)> &  InFilenameFilter)
static

◆ GetSortedTypes()

const TArray< FShaderType * > & FShaderType::GetSortedTypes ( EShaderTypeForDynamicCast  Type)
static

◆ GetSourceHash()

const FSHAHash & FShaderType::GetSourceHash ( EShaderPlatform  ShaderPlatform) const

Calculates a Hash based on this shader type's source code and includes

◆ GetTypeForDynamicCast()

EShaderTypeForDynamicCast FShaderType::GetTypeForDynamicCast ( ) const
inline

◆ GetTypeList()

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

◆ GetTypeSize()

uint32 FShaderType::GetTypeSize ( ) const
inline

◆ Initialize()

void FShaderType::Initialize ( const TMap< FString, TArray< const TCHAR * > > &  ShaderFileToUniformBufferVariables)
static

Initialize FShaderType static members, this must be called before any shader types are created.

◆ ShouldCompilePermutation()

bool FShaderType::ShouldCompilePermutation ( const FShaderPermutationParameters Parameters) const

◆ ShouldPrecachePermutation()

EShaderPermutationPrecacheRequest FShaderType::ShouldPrecachePermutation ( const FShaderPermutationParameters Parameters) const

◆ Uninitialize()

static RENDERCORE_API void FShaderType::Uninitialize ( )
static

Uninitializes FShaderType cached data.

Friends And Related Symbol Documentation

◆ DumpShaderStats

void RENDERCORE_API DumpShaderStats ( EShaderPlatform  Platform,
EShaderFrequency  Frequency 
)
friend

Dumps shader stats to the log. Will also print some shader pipeline information.

Parameters
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

◆ GetTypeHash

uint32 GetTypeHash ( FShaderType Ref)
friend

Hashes a pointer to a shader type.

◆ operator<<

RENDERCORE_API friend FArchive & operator<< ( FArchive Ar,
FShaderType *&  Ref 
)
friend

Serializes a shader type reference by name.


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