![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#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 () |
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.
Full context for processing read back results.
| FLandscapeEditLayerReadback::FLandscapeEditLayerReadback | ( | ) |
| FLandscapeEditLayerReadback::~FLandscapeEditLayerReadback | ( | ) |
| 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.
| void FLandscapeEditLayerReadback::Flush | ( | ) |
|
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.
|
static |
Optional call to allow garbage collection of any task resources and check for leaks. Call once per frame.
| int32 FLandscapeEditLayerReadback::GetCompletedResultNum | ( | ) | const |
Returns a value greater than 0 if there are completed read back tasks for which we can retrieve results.
|
inline |
Get the stored hash value.
| 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().
| 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().
|
static |
Returns true if there are any queued tasks that haven't been released.
Update the stored hash value. Return true if this changes the value.
| void FLandscapeEditLayerReadback::Tick | ( | ) |