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

#include <LandscapeEditReadback.h>

Classes

struct  FComponentReadbackContext
 

Public Types

using FPerChannelLayerNames = TStaticArray< FName, 4 >
 
using FReadbackContext = TArray< FComponentReadbackContext >
 

Public Member Functions

 FLandscapeEditLayerReadback ()
 
 ~FLandscapeEditLayerReadback ()
 
bool SetHash (uint64 InHash)
 
uint64 GetHash () const
 
void Enqueue (UTexture2D const *InSourceTexture, FReadbackContext &&InReadbackContext)
 
void Tick ()
 
void Flush ()
 
int32 GetCompletedResultNum () const
 
TArray< TArray< FColor > > const & GetResult (int32 InResultIndex) const
 
FReadbackContext const & GetResultContext (int32 InResultIndex) const
 
void ReleaseCompletedResults (int32 InResultNum)
 

Static Public Member Functions

static bool HasWork ()
 
static void GarbageCollectTasks ()
 
static void FlushAllReadbackTasks ()
 

Detailed Description

Read back queue for a landscape edit layer texture. This handles reading landscape edit data back from the GPU to the game thread. Multiple read backs can be queued in a single object and any completed results can be retrieved. Tick() must be called regularly to update the internal read back tasks. When results are available GetCompletedResultNum() will be greater than zero. After getting latest results with GetResult()/GetResultContext() you should call ReleaseCompletedResults() to prevent leaks.

Member Typedef Documentation

◆ FPerChannelLayerNames

◆ FReadbackContext

Full context for processing read back results.

Constructor & Destructor Documentation

◆ FLandscapeEditLayerReadback()

FLandscapeEditLayerReadback::FLandscapeEditLayerReadback ( )

◆ ~FLandscapeEditLayerReadback()

FLandscapeEditLayerReadback::~FLandscapeEditLayerReadback ( )

Member Function Documentation

◆ Enqueue()

void FLandscapeEditLayerReadback::Enqueue ( UTexture2D const *  InSourceTexture,
FReadbackContext &&  InReadbackContext 
)

Queue a new texture to read back. The GPU copy will be queued to the render thread inside this function.

◆ Flush()

void FLandscapeEditLayerReadback::Flush ( )

◆ FlushAllReadbackTasks()

void FLandscapeEditLayerReadback::FlushAllReadbackTasks ( )
static

Brute-force flush of all pending readback tasks. Use this when you want to make sure all readbacks are performed. In case of multiple readbacks, this is much more efficient than individually flushing each task.

◆ GarbageCollectTasks()

void FLandscapeEditLayerReadback::GarbageCollectTasks ( )
static

Optional call to allow garbage collection of any task resources and check for leaks. Call once per frame.

◆ GetCompletedResultNum()

int32 FLandscapeEditLayerReadback::GetCompletedResultNum ( ) const

Returns a value greater than 0 if there are completed read back tasks for which we can retrieve results.

◆ GetHash()

uint64 FLandscapeEditLayerReadback::GetHash ( ) const
inline

Get the stored hash value.

◆ GetResult()

TArray< TArray< FColor > > const & FLandscapeEditLayerReadback::GetResult ( int32  InResultIndex) const

Get the result for the completed task index. Returned reference will be valid until we next call ReleaseCompletedResults().

◆ GetResultContext()

FLandscapeEditLayerReadback::FReadbackContext const & FLandscapeEditLayerReadback::GetResultContext ( int32  InResultIndex) const

Get the result context for the completed task index. Returned reference will be valid until we next call ReleaseCompletedResults().

◆ HasWork()

bool FLandscapeEditLayerReadback::HasWork ( )
static

Returns true if there are any queued tasks that haven't been released.

◆ ReleaseCompletedResults()

void FLandscapeEditLayerReadback::ReleaseCompletedResults ( int32  InResultNum)

◆ SetHash()

bool FLandscapeEditLayerReadback::SetHash ( uint64  InHash)

Update the stored hash value. Return true if this changes the value.

◆ Tick()

void FLandscapeEditLayerReadback::Tick ( )

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