TArray::AppendHash
#include "Containers/Array.h"
Access: public
Specifiers: static
Description
A static method that feeds the element type's layout descriptor into a SHA1 hash. Used by the shader compilation pipeline to detect when a type's memory layout has changed, triggering shader recompilation.
Caveats & Gotchas
- • If the element type does not have a type layout registration (THasTypeLayout is false) or the allocator does not support freeze, this method is a no-op and contributes nothing to the hash. This will not cause a compile error but may result in stale shaders if the type is later given a layout.
- • This is a static method, so it operates on type information only — not on a specific array instance. It is invoked via the IntrinsicAppendHash free function and should not be called manually in gameplay or editor code.
Signature
static void AppendHash(const FPlatformTypeLayoutParameters& LayoutParams, FSHA1& Hasher) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| LayoutParams | const FPlatformTypeLayoutParameters& | Platform-specific type layout parameters (pointer size, alignment rules, etc.) used to vary the hash per target. | — |
| Hasher | FSHA1& | The SHA1 hasher to append the element type layout data into. | — |
Return Type
void Example
Context: called automatically by the type layout intrinsic C++
// Called by the engine internals; not used directly.
// Conceptual equivalent of what the engine does:
FSHA1 Hasher;
TArray<FMyType>::AppendHash(PlatformLayoutParams, Hasher);
uint8 Hash[20];
Hasher.Final();
Hasher.GetHash(Hash); Version History
Introduced in: 4.25
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?