Package icyllis.arc3d.engine.task

# Class Task

java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.engine.task.Task

All Implemented Interfaces:
  `RefCounted`

Direct Known Subclasses:
  `CopyBufferTask`, `CopyImageTask`, `DrawTask`, `ImageUploadTask`, `RenderPassTask`, `RootTask`

public abstract class Task extends RefCnt

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `RESULT_DISCARD`
  `static final int`
  `RESULT_FAILURE`
  `static final int`
  `RESULT_SUCCESS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Task()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `deallocate()`
  Cleanup resources.
  `abstract int`
  `execute(ImmediateContext context, CommandBuffer commandBuffer)`
  Add commands to command buffer on `ImmediateContext`.
  `abstract int`
  `prepare(RecordingContext context)`
  Prepare resources on `RecordingContext` using its `ResourceProvider`.

  ### Methods inherited from class icyllis.arc3d.core.RefCnt

  `create, create, getRefCnt, getRefCntAcquire, getRefCntVolatile, move, move, ref, unique, unref`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### RESULT_SUCCESS

    public static final int RESULT_SUCCESS
    See Also:
      - Constant Field Values

  - ### RESULT_FAILURE

    public static final int RESULT_FAILURE
    See Also:
      - Constant Field Values

  - ### RESULT_DISCARD

    public static final int RESULT_DISCARD
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Task

    public Task()

- ## Method Details

  - ### prepare

    public abstract int prepare(RecordingContext context)
    Prepare resources on `RecordingContext` using its `ResourceProvider`.

    If the task is directly added to the `ImmediateContext`, then this method will not be called.

  - ### execute

    public abstract int execute(ImmediateContext context, CommandBuffer commandBuffer)
    Add commands to command buffer on `ImmediateContext`. The `ResourceProvider` of `ImmediateContext` can also be used to create resources.

  - ### deallocate

    protected void deallocate()
    Cleanup resources.
    Specified by:
      `deallocate` in class `RefCnt`