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

#include <ShaderKeyGenerator.h>

Public Member Functions

 FShaderKeyGenerator (TUniqueFunction< void(const void *Data, uint64 Size)> &&InResultFunc)
 
 FShaderKeyGenerator (FString &InResultString)
 
 ~FShaderKeyGenerator ()
 
bool IsBinary () const
 
bool IsText () const
 
void BinaryAppend (const void *Data, uint64 Size)
 
FString & TextGetResultString ()
 
void Append (FStringView Value)
 
void Append (const TCHAR *Value)
 
void Append (FName Value)
 
void Append (int64 Value)
 
void Append (uint64 Value)
 
void Append (int32 Value)
 
void Append (uint32 Value)
 
void AppendHex (uint32 Value)
 
void AppendBoolInt (bool Value)
 
CORE_API void Append (const FBlake3Hash &Value)
 
CORE_API void Append (const FGuid &Value)
 
CORE_API void Append (const FSHAHash &Value)
 
void AppendDebugText (FStringView Value)
 
void AppendSeparator ()
 

Detailed Description

Output class passed to Append functions for shader data. It receives Append calls for the input data for shader compilation. These input data should trigger a recompile if they change, and they are therefore added into the key used for storage of shader data in DDC and incremental cooks.

Known types are appended through FShaderKeyGenerator Append member functions. For other types, the standard API (which is used by e.g. the append function for TArray) for types that can be appended to FShaderKeyGenerator is the function in global namespace: void Append(FShaderKeyGenerator& KeyGen, const TypeName& Value);

The proper Append function can be called for any type using operator<<.

Constructor & Destructor Documentation

◆ FShaderKeyGenerator() [1/2]

FShaderKeyGenerator::FShaderKeyGenerator ( TUniqueFunction< void(const void *Data, uint64 Size)> &&  InResultFunc)
inline

Constructor that writes the appended data to a hash function.

(FShaderKeyGenerator&)KeyGen << (const T&) Value;

Append the given Value to the KeyGen, using FShaderKeyGenerator::Append for known types, or Append(FShaderKeyGenerator&, const T&) for unknown types. Forward declare not possible, see implementation below.

◆ FShaderKeyGenerator() [2/2]

FShaderKeyGenerator::FShaderKeyGenerator ( FString &  InResultString)
inline

Constructor that writes the appended data to a long human-readable debug string.

◆ ~FShaderKeyGenerator()

FShaderKeyGenerator::~FShaderKeyGenerator ( )
inlinedefault

Member Function Documentation

◆ Append() [1/10]

void FShaderKeyGenerator::Append ( const FBlake3Hash Value)

Append Value to the output string (equivalent to LexToString) or pass it as binary data to the hash function.

◆ Append() [2/10]

void FShaderKeyGenerator::Append ( const FGuid Value)

Append Value to the output string (EGuidFormats::Digits) or pass it as binary data to the hash function.

◆ Append() [3/10]

void FShaderKeyGenerator::Append ( const FSHAHash Value)

Append Value to the output string (equivalent to LexToString) or pass it as binary data to the hash function.

◆ Append() [4/10]

void FShaderKeyGenerator::Append ( const TCHAR Value)
inline

Append arbitrary text to the output string or hash function. Null-terminated character pointer. Null pointer is a noop.

◆ Append() [5/10]

void FShaderKeyGenerator::Append ( FName  Value)
inline

Convert the FName to text (case-sensitive) and append it to the output string or hash function.

◆ Append() [6/10]

void FShaderKeyGenerator::Append ( FStringView  Value)
inline

Append arbitrary text to the output string or hash function.

◆ Append() [7/10]

void FShaderKeyGenerator::Append ( int32  Value)
inline

Appendf the integer to the output string or pass it as binary data to the hash function.

◆ Append() [8/10]

void FShaderKeyGenerator::Append ( int64  Value)
inline

Appendf the integer to the output string or pass it as binary data to the hash function.

◆ Append() [9/10]

void FShaderKeyGenerator::Append ( uint32  Value)
inline

Appendf the integer to the output string or pass it as binary data to the hash function.

◆ Append() [10/10]

void FShaderKeyGenerator::Append ( uint64  Value)
inline

Appendf the integer to the output string or pass it as binary data to the hash function.

◆ AppendBoolInt()

void FShaderKeyGenerator::AppendBoolInt ( bool  Value)
inline

Appendf 0 or 1 to the output string or pass a 0 or 1 uint8 the hash function.

◆ AppendDebugText()

void FShaderKeyGenerator::AppendDebugText ( FStringView  Value)
inline

Append arbitrary text to the output human-readable string. Noop if !IsText.

◆ AppendHex()

void FShaderKeyGenerator::AppendHex ( uint32  Value)
inline

Appendf the integer to the output string, using X format, or pass it as binary data to the hash function.

◆ AppendSeparator()

void FShaderKeyGenerator::AppendSeparator ( )
inline

Append the separator character '_' to the output human-readable string. Noop if !IsText.

◆ BinaryAppend()

void FShaderKeyGenerator::BinaryAppend ( const void Data,
uint64  Size 
)
inline

Must not be called unless IsBinary is true. Append data directly to the hash function.

◆ IsBinary()

bool FShaderKeyGenerator::IsBinary ( ) const
inline

True iff the KeyGen is writing to a hash function. Writing to a hash function also implies that debugtext and separators will be skipped in the output.

◆ IsText()

bool FShaderKeyGenerator::IsText ( ) const
inline

True iff the KeyGen is writing to a human-readable debug string.

◆ TextGetResultString()

FString & FShaderKeyGenerator::TextGetResultString ( )
inline

Must not be called unless IsText is true. Return a modifiable reference to the string being written.


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