engine
 
载入中...
搜索中...
未找到
Public 类型 | Public 成员函数 | Protected 属性 | 所有成员列表
TRenderAssetUpdate< TContext > 模板类 参考

This class provides a framework for loading and unloading the texture/mesh LODs. 更多...

#include <RenderAssetUpdate.h>

+ 类 TRenderAssetUpdate< TContext > 继承关系图:

Public 类型

typedef TFunction< void(const FContext &Context)> FCallback
 A callback used to perform a task in the update process. 更多...
 
- Public 类型 继承自 FRenderAssetUpdate
enum  ETaskState
 The state of scheduled work for the update process.
 
enum  EThreadType
 A thread type used for doing a part of the update process. 更多...
 

Public 成员函数

EThreadType GetRelevantThread () const final override
 Return the thread relevant to the next step of execution.
 
void PushTask (const FContext &Context, EThreadType InTaskThread, const FCallback &InTaskCallback, EThreadType InCancelationThread, const FCallback &InCancelationCallback)
 Defines the next step to be executed. 更多...
 
- Public 成员函数 继承自 FRenderAssetUpdate
virtual void Abort ()
 Cancel the current update. 更多...
 
ETaskState DoLock ()
 Perform a lock on the object, preventing any other thread from processing a pending task in Tick().
 
void DoUnlock (ETaskState PreviousTaskState)
 Release any lock on the object, allowing other thread to modify it.
 
virtual EThreadType GetRelevantThread () const =0
 Return the thread relevant to the next step of execution.
 
bool IsCancelled () const
 Returns whether the task was aborted through Abort() or cancelled. 更多...
 
bool IsCompleted () const
 Returns whether the task has finished executing and there is no other thread possibly accessing it.
 
ENGINE_API void Tick (EThreadType InCurrentThread)
 Do or schedule any pending work for a given texture. 更多...
 

Protected 属性

FCallback CancelationCallback
 The callback handling the cancellation of the update (only if the update gets cancelled).
 
EThreadType CancelationThread
 The thread on which to call the cancellation of the update (only if the update gets cancelled).
 
FCallback TaskCallback
 The callback that will perform the next step of the update.
 
EThreadType TaskThread
 The thread on which to call the next step of the update, being TaskCallback.
 
- Protected 属性 继承自 FRenderAssetUpdate
bool bDeferExecution
 Defer execution even if a task pushes a new task on the same thread.
 
bool bIsCancelled
 Whether the task has been cancelled because the update could not proceed or because the user called Abort().
 
FCriticalSection CS
 Critical Section.
 
const FStreamableRenderResourceState ResourceState
 The streamable state requested.
 
int32 ScheduledAsyncTasks
 Number of Ticks scheduled on async tasks.
 
int32 ScheduledGTTasks
 Number of Ticks scheduled on the game thread.
 
int32 ScheduledRenderTasks
 Number of Ticks scheduled on the render thread.
 
const UStreamableRenderAsset * StreamableAsset = nullptr
 The asset updated
 
volatile ETaskState TaskState
 The state of the work yet to be performed to complete the update or cancelation.
 
FThreadSafeCounter TaskSynchronization
 Synchronization used for trigger the task next step execution.
 

额外继承的成员函数

- Protected 类型 继承自 FRenderAssetUpdate
typedef FAutoDeleteAsyncTask< FMipUpdateTask > FAsyncMipUpdateTask
 The async task to update this object, only one can be active at anytime. 更多...
 
- Protected 成员函数 继承自 FRenderAssetUpdate
void MarkAsCancelled ()
 Set the task state as cancelled. 更多...
 

详细描述

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.

成员类型定义说明

◆ FCallback

template<typename TContext >
typedef TFunction<void(const FContext& Context)> TRenderAssetUpdate< TContext >::FCallback

A callback used to perform a task in the update process.

Each task must be executed on a specific thread.

成员函数说明

◆ 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.

参数
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).

该类的文档由以下文件生成: