RealDocs

TArray::WriteMemoryImage

function Core Since 4.25
#include "Containers/Array.h"
Access: public Specifiers: const

Description

Serialises this TArray into a frozen memory image via FMemoryImageWriter. Only active when both the allocator supports freeze and the element type has a registered type layout. Used by the shader code serialisation pipeline.

Caveats & Gotchas

  • If the allocator does not support SupportsFreezeMemoryImage or the element type lacks a THasTypeLayout specialisation, the method writes an empty TArray instead — silently producing no data. You will not get an error.
  • This is part of the Freeze/Unfreeze shader pipeline (used by Niagara, Global Shaders, etc.). Do not call it directly in gameplay code — it is invoked automatically by the shader compiler infrastructure.

Signature

void WriteMemoryImage(FMemoryImageWriter& Writer) const

Parameters

Name Type Description Default
Writer FMemoryImageWriter& The memory image writer that serialises the array layout into a platform-specific frozen binary image.

Return Type

void

Example

Context: invoked automatically in shader type layout serialisation C++
// Called internally by the engine; not typically called directly.
// Example of how the engine uses it:
void FMyShaderType::WriteMemoryImage(FMemoryImageWriter& Writer) const
{
    MyTArrayMember.WriteMemoryImage(Writer);
}

Version History

Introduced in: 4.25

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.