Class GPUTask
Describes GPU work object.
Assembly: FlaxEngine.dll
File: Engine/Graphics/Async/GPUTask.h
Syntax
public class GPUTask : public Task
Constructors
DECLARE_ENUM_4(Result, Ok, Failed, MissingResources, MissingData)
Describes GPU work result value
Declaration
public DECLARE_ENUM_4(Result, Ok, Failed, MissingResources, MissingData)
Parameters
Result
GPUTask_DECLARE_ENUM_4_Result_Ok_Failed_MissingResources_MissingData_
|
Ok
GPUTask_DECLARE_ENUM_4_Result_Ok_Failed_MissingResources_MissingData_
|
Failed
GPUTask_DECLARE_ENUM_4_Result_Ok_Failed_MissingResources_MissingData_
|
MissingResources
GPUTask_DECLARE_ENUM_4_Result_Ok_Failed_MissingResources_MissingData_
|
MissingData
GPUTask_DECLARE_ENUM_4_Result_Ok_Failed_MissingResources_MissingData_
|
DECLARE_ENUM_EX_4(Type, byte, 0, Custom, CopyResource, UploadTexture, UploadBuffer)
Describes GPU work type
Declaration
public DECLARE_ENUM_EX_4(Type, byte, 0, Custom, CopyResource, UploadTexture, UploadBuffer)
Parameters
Type
GPUTask_DECLARE_ENUM_EX_4_Type_byte_0_Custom_CopyResource_UploadTexture_UploadBuffer_
|
byte
GPUTask_DECLARE_ENUM_EX_4_Type_byte_0_Custom_CopyResource_UploadTexture_UploadBuffer_
|
0
GPUTask_DECLARE_ENUM_EX_4_Type_byte_0_Custom_CopyResource_UploadTexture_UploadBuffer_
|
Custom
GPUTask_DECLARE_ENUM_EX_4_Type_byte_0_Custom_CopyResource_UploadTexture_UploadBuffer_
|
CopyResource
GPUTask_DECLARE_ENUM_EX_4_Type_byte_0_Custom_CopyResource_UploadTexture_UploadBuffer_
|
UploadTexture
GPUTask_DECLARE_ENUM_EX_4_Type_byte_0_Custom_CopyResource_UploadTexture_UploadBuffer_
|
UploadBuffer
GPUTask_DECLARE_ENUM_EX_4_Type_byte_0_Custom_CopyResource_UploadTexture_UploadBuffer_
|
GPUTask(const Type type, byte syncLatency=GPU_ASYNC_LATENCY)
Initializes a new instance of the GPUTask class.
Declaration
protected GPUTask(const Type type, byte syncLatency=GPU_ASYNC_LATENCY)
Parameters
Type
type
The type. |
byte
syncLatency
Amount of frames until async operation is synced with GPU. |
Methods
CancelSync()
Cancels the task results synchronization.
Declaration
public void CancelSync()
Enqueue()
Execute(GPUTasksContext* context)
Executes this task.
Declaration
public void Execute(GPUTasksContext* context)
Parameters
GPUTasksContext
context
The context. |
GetSyncPoint()
Gets work finish synchronization point
Declaration
public GPUSyncPoint GetSyncPoint() const
Returns
GPUSyncPoint
|
GetType()
Gets a task type.
Declaration
public Type GetType() const
Returns
Type
|
IsSyncing()
Checks if operation is syncing
Declaration
public bool IsSyncing() const
Returns
bool
|
OnCancel()
OnSync()
Declaration
protected virtual void OnSync()
Run()
Runs the task specified operations. It does not handle any task related logic, but only performs the actual job.
Declaration
protected virtual bool Run() override
Returns
bool
The task execution result. Returns true if failed, otherwise false. |
Overrides
run(GPUTasksContext* context)
Declaration
protected virtual Result run(GPUTasksContext* context) = 0
Parameters
GPUTasksContext
context
|
Returns
Result
|
Sync()
Action fired when asynchronous operation has been synchronized with a GPU
Declaration
public void Sync()
ToString()
Gets the string representation of this object.
Declaration
public virtual String ToString() const override
Returns
String
|