UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TRenderAssetUpdate< TContext > Class Template Reference

#include <RenderAssetUpdate.h>

+ Inheritance diagram for TRenderAssetUpdate< TContext >:

Public Types

typedef TContext FContext
 
typedef TFunction< void(const FContext &Context)> FCallback
 
- Public Types inherited from FRenderAssetUpdate
enum  EThreadType {
  TT_None , TT_Render , TT_Async , TT_GameThread ,
  TT_GameRunningAsync
}
 
enum  ETaskState {
  TS_Done , TS_Suspended , TS_InProgress , TS_Locked ,
  TS_Init
}
 

Public Member Functions

 TRenderAssetUpdate (const UStreamableRenderAsset *InAsset)
 
void PushTask (const FContext &Context, EThreadType InTaskThread, const FCallback &InTaskCallback, EThreadType InCancelationThread, const FCallback &InCancelationCallback)
 
EThreadType GetRelevantThread () const final override
 
- Public Member Functions inherited from FRenderAssetUpdate
UE_API FRenderAssetUpdate (const UStreamableRenderAsset *InAsset)
 
UE_API void Tick (EThreadType InCurrentThread)
 
bool IsCompleted () const
 
virtual void Abort ()
 
virtual bool CanAbandon () const
 
virtual void OnAbandoned ()
 
bool IsCancelled () const
 
bool IsSuccessfullyFinished () const
 
UE_API ETaskState DoLock ()
 
UE_API void DoUnlock (ETaskState PreviousTaskState)
 
bool IsLocked () const
 
FReturnedRefCountValue AddRef () const final override
 
UE_API uint32 Release () const final override
 
uint32 GetRefCount () const final override
 
- Public Member Functions inherited from IRefCountedObject
virtual ~IRefCountedObject ()
 

Protected Member Functions

ETaskState TickInternal (EThreadType InCurrentThread, bool bCheckForSuspension) final override
 
void ClearCallbacks ()
 
- Protected Member Functions inherited from FRenderAssetUpdate
virtual UE_API ~FRenderAssetUpdate ()
 
void MarkAsCancelled ()
 
void MarkAsSuccessfullyFinished ()
 
UE_API void ScheduleGTTask ()
 
UE_API void ScheduleRenderTask ()
 
UE_API void ScheduleAsyncTask ()
 

Protected Attributes

EThreadType TaskThread
 
FCallback TaskCallback
 
EThreadType CancelationThread
 
FCallback CancelationCallback
 
- Protected Attributes inherited from FRenderAssetUpdate
const FStreamableRenderResourceState ResourceState
 
const int32 CurrentFirstLODIdx = INDEX_NONE
 
const int32 PendingFirstLODIdx = INDEX_NONE
 
FCriticalSection CS
 
int32 ScheduledGTTasks
 
int32 ScheduledRenderTasks
 
int32 ScheduledAsyncTasks
 
const UStreamableRenderAssetStreamableAsset = nullptr
 
FThreadSafeCounter TaskSynchronization
 
bool bIsCancelled
 
bool bDeferExecution
 
bool bSuccess
 
volatile ETaskState TaskState
 

Additional Inherited Members

- Protected Types inherited from FRenderAssetUpdate
typedef FAutoDeleteAsyncTask< FMipUpdateTaskFAsyncMipUpdateTask
 

Detailed Description

template<typename TContext>
class TRenderAssetUpdate< TContext >

This class provides a framework for loading and unloading the texture/mesh LODs. Each thread essentially calls Tick() until the job is done. The object can be safely deleted when IsCompleted() returns true.

Member Typedef Documentation

◆ FCallback

A callback used to perform a task in the update process. Each task must be executed on a specific thread.

◆ FContext

Constructor & Destructor Documentation

◆ TRenderAssetUpdate()

Member Function Documentation

◆ ClearCallbacks()

template<typename TContext >
void TRenderAssetUpdate< TContext >::ClearCallbacks ( )
inlineprotected

◆ GetRelevantThread()

template<typename TContext >
EThreadType TRenderAssetUpdate< TContext >::GetRelevantThread ( ) const
inlinefinaloverridevirtual

Return the thread relevant to the next step of execution.

Implements FRenderAssetUpdate.

◆ PushTask()

template<typename TContext >
void TRenderAssetUpdate< TContext >::PushTask ( const FContext Context,
EThreadType  InTaskThread,
const FCallback InTaskCallback,
EThreadType  InCancelationThread,
const FCallback InCancelationCallback 
)

Defines the next step to be executed. The next step will be executed by calling the callback on the specified thread. The callback (for both success and cancelation) will only be executed if TaskSynchronization reaches 0. If all requirements are immediately satisfied when calling the PushTask the relevant callback will be called immediately.

Parameters
Context- The context defining which texture is being updated and on which thread this is being called.
InTaskThread- The thread on which to call the next step of the update, being TaskCallback.
InTaskCallback- The callback that will perform the next step of the update.
InCancelationThread- The thread on which to call the cancellation of the update (only if the update gets cancelled).
InCancelationCallback- The callback handling the cancellation of the update (only if the update gets cancelled).

◆ TickInternal()

template<typename TContext >
FRenderAssetUpdate::ETaskState TRenderAssetUpdate< TContext >::TickInternal ( EThreadType  InCurrentThread,
bool  bCheckForSuspension 
)
finaloverrideprotectedvirtual

Implements FRenderAssetUpdate.

Member Data Documentation

◆ CancelationCallback

template<typename TContext >
FCallback TRenderAssetUpdate< TContext >::CancelationCallback
protected

The callback handling the cancellation of the update (only if the update gets cancelled).

◆ CancelationThread

template<typename TContext >
EThreadType TRenderAssetUpdate< TContext >::CancelationThread
protected

The thread on which to call the cancellation of the update (only if the update gets cancelled).

◆ TaskCallback

template<typename TContext >
FCallback TRenderAssetUpdate< TContext >::TaskCallback
protected

The callback that will perform the next step of the update.

◆ TaskThread

template<typename TContext >
EThreadType TRenderAssetUpdate< TContext >::TaskThread
protected

The thread on which to call the next step of the update, being TaskCallback.


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