Base class for (some) tasks in Hdx that provides common progressive rendering and Hgi functionality. More...
Public Member Functions | |
HDX_API | HdxTask (SdfPath const &id) |
virtual HDX_API bool | IsConverged () const |
This function returns true when a (progressive) task considers its execution results converged. More... | |
void | Sync (HdSceneDelegate *delegate, HdTaskContext *ctx, HdDirtyBits *dirtyBits) final |
We override HdTask::Sync, but make it 'final' to make sure derived classes can't override it and instead override _Sync. More... | |
Public Member Functions inherited from HdTask | |
HD_API | HdTask (SdfPath const &id) |
Construct a new task. More... | |
virtual void | Sync (HdSceneDelegate *delegate, HdTaskContext *ctx, HdDirtyBits *dirtyBits)=0 |
Sync Phase: Obtain task state from Scene delegate based on change processing. More... | |
virtual void | Prepare (HdTaskContext *ctx, HdRenderIndex *renderIndex)=0 |
Prepare Phase: Resolve bindings and manage resources. More... | |
virtual void | Execute (HdTaskContext *ctx)=0 |
Execute Phase: Runs the task. More... | |
virtual HD_API const TfTokenVector & | GetRenderTags () const |
Render Tag Gather. More... | |
SdfPath const & | GetId () const |
virtual HD_API HdDirtyBits | GetInitialDirtyBitsMask () const |
Returns the minimal set of dirty bits to place in the change tracker for use in the first sync of this prim. More... | |
Protected Member Functions | |
virtual void | _Sync (HdSceneDelegate *delegate, HdTaskContext *ctx, HdDirtyBits *dirtyBits)=0 |
void | _ToggleRenderTarget (HdTaskContext *ctx) |
HDX_API Hgi * | _GetHgi () const |
Protected Member Functions inherited from HdTask | |
template<class T > | |
bool | _GetTaskParams (HdSceneDelegate *delegate, T *outValue) |
Extracts a typed value out of the task context at the given id. More... | |
HD_API TfTokenVector | _GetTaskRenderTags (HdSceneDelegate *delegate) |
Protected Attributes | |
Hgi * | _hgi |
Additional Inherited Members | |
Static Protected Member Functions inherited from HdTask | |
static HD_API bool | _HasTaskContextData (HdTaskContext const *ctx, TfToken const &id) |
Check if the shared context contains a value for the given id. More... | |
template<class T > | |
static bool | _GetTaskContextData (HdTaskContext const *ctx, TfToken const &id, T *outValue) |
Extracts a typed value out of the task context at the given id. More... | |
template<class T > | |
static T | _GetDriver (HdTaskContext const *ctx, TfToken const &driverName) |
Extract an object from a HdDriver inside the task context. More... | |
Base class for (some) tasks in Hdx that provides common progressive rendering and Hgi functionality.
Tasks that require neither progressive rendering nor Hgi can continue to derive directly from HdTask.
|
virtual |
This function returns true when a (progressive) task considers its execution results converged.
Usually this means that a progressive render delegate is finished rendering into the HdRenderBuffers used by this task. Returns true by default which is a good default for rasterizers.
Applications with data-driven task lists can determine their convergence state by determining which tasks are HdxTasks and then querying specifically those tasks for IsConverged.
Reimplemented in HdxPickFromRenderBufferTask, HdxColorizeSelectionTask, HdxRenderTask, and HdxAovInputTask.
|
final |
We override HdTask::Sync, but make it 'final' to make sure derived classes can't override it and instead override _Sync.
This 'non-virtual interface'-like pattern allows us to ensure we always initialized Hgi during the Sync task so derived classes don't have to.