HdExtComputation Class Reference

Hydra Representation of a Client defined computation. More...

+ Inheritance diagram for HdExtComputation:

Public Types

enum  DirtyBits : HdDirtyBits {
  Clean = 0, DirtyInputDesc = 1 << 0, DirtyOutputDesc = 1 << 1, DirtyElementCount = 1 << 2,
  DirtySceneInput = 1 << 3, DirtyCompInput = 1 << 4, DirtyKernel = 1 << 5, DirtyDispatchCount = 1 << 6,
 Change tracking. More...

Public Member Functions

HD_API HdExtComputation (SdfPath const &id)
 Construct a new ExtComputation identified by id. More...
HD_API void Sync (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override
 Synchronizes state from the delegate to this object. More...
HD_API HdDirtyBits GetInitialDirtyBitsMask () const override
 Returns the minimal set of dirty bits to place in the change tracker for use in the first sync of this prim. More...
HD_API size_t GetDispatchCount () const
HD_API size_t GetElementCount () const
HD_API TfTokenVector const & GetSceneInputNames () const
HD_API TfTokenVector GetOutputNames () const
HD_API HdExtComputationInputDescriptorVector const & GetComputationInputs () const
HD_API HdExtComputationOutputDescriptorVector const & GetComputationOutputs () const
HD_API const std::string & GetGpuKernelSource () const
HD_API bool IsInputAggregation () const
- Public Member Functions inherited from HdSprim
HD_API HdSprim (SdfPath const &id)
SdfPath const & GetId () const
 Returns the identifier by which this state is known. More...
virtual HD_API void Finalize (HdRenderParam *renderParam)
 Finalizes object resources. More...

Protected Member Functions

HD_API void _Sync (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits)

Static Protected Member Functions

static HD_API bool _IsEnabledSharedExtComputationData ()

Detailed Description

Hydra Representation of a Client defined computation.

A computation provides a way to procedurally generate a primvar.

It represents a basic Input -> Processing -> Output model.

Primarily inputs are provided by the scene delegate via the Get() mechanism.

Computations can also be chained together, such that the output from one computation can be an input to another.

The results of a computation is designed to be in SOA form (structure or array), where each output is a member of the "structure" producing several parallel arrays. While the type of the elements of the array is defined by the output member, the number of elements in each array is the same across all outputs.

ExtComputations use a pull model, so processing is only triggered if a downstream computation or prim pulls on one the computations outputs.

Definition at line 56 of file extComputation.h.

Member Enumeration Documentation

◆ DirtyBits

enum DirtyBits : HdDirtyBits

Change tracking.


The list of inputs or input bindings changed.


The list of outputs changed.


The number of elements in the output arrays changed.


A scene input changed value.


A computation input changed value.


The compute kernel binding changed.


The number of kernel invocations to execute changed.

Definition at line 69 of file extComputation.h.

Constructor & Destructor Documentation

◆ HdExtComputation()

HD_API HdExtComputation ( SdfPath const &  id)

Construct a new ExtComputation identified by id.

Member Function Documentation

◆ GetInitialDirtyBitsMask()

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.

Typically this would be all dirty bits.

Implements HdSprim.

◆ Sync()

HD_API void Sync ( HdSceneDelegate sceneDelegate,
HdRenderParam renderParam,
HdDirtyBits *  dirtyBits 

Synchronizes state from the delegate to this object.

[in,out]dirtyBitsOn input specifies which state is is dirty and can be pulled from the scene delegate. On output specifies which bits are still dirty and were not cleaned by the sync.

Implements HdSprim.

Reimplemented in HdStExtComputation.

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