All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdExtCompCpuComputation Class Referencefinal

A Buffer Source that represents a CPU implementation of a ExtComputation. More...

+ Inheritance diagram for HdExtCompCpuComputation:

Public Member Functions

 HdExtCompCpuComputation (const SdfPath &id, const Hd_ExtCompInputSourceSharedPtrVector &inputs, const TfTokenVector &outputs, int numElements, HdSceneDelegate *sceneDelegate)
 Constructs a new Cpu ExtComputation source. More...
 
virtual HD_API TfToken const & GetName () const override
 Returns the id for this computation as a token. More...
 
virtual HD_API bool Resolve () override
 Ask the scene delegate to run the computation and captures the output signals. More...
 
virtual HD_API size_t GetNumElements () const override
 Returns the number of elements (e.g. More...
 
HD_API size_t GetOutputIndex (const TfToken &outputName) const
 Converts a output name token into an index. More...
 
HD_API const VtValueGetOutputByIndex (size_t index) const
 Returns the value of the specified output (after the computations been Resolved). More...
 
- Public Member Functions inherited from HdNullBufferSource
virtual HD_API void const * GetData () const override
 Following interfaces will be called after Resolve. More...
 
virtual HD_API size_t ComputeHash () const override
 Computes and returns a hash value for the underlying data. More...
 
virtual HD_API HdTupleType GetTupleType () const override
 Returns the data type and count (array size) for this buffer source. More...
 
virtual HD_API void GetBufferSpecs (HdBufferSpecVector *specs) const override
 Add the buffer spec for this buffer source into given bufferspec vector. More...
 
- Public Member Functions inherited from HdBufferSource
bool IsResolved () const
 Returns true it this computation has already been resolved. More...
 
bool HasResolveError () const
 Returns true if an error occurred during resolve. More...
 
HD_API bool IsValid () const
 Checks the validity of the source buffer. More...
 
virtual HD_API bool HasPreChainedBuffer () const
 Returns true if this buffer has a pre-chained buffer. More...
 
virtual HD_API
HdBufferSourceSharedPtr 
GetPreChainedBuffer () const
 Returns the pre-chained buffer. More...
 
virtual HD_API bool HasChainedBuffer () const
 Returns true if this buffer has any chained buffer(s) More...
 
virtual HD_API
HdBufferSourceSharedPtrVector 
GetChainedBuffers () const
 Returns the vector of chained buffers. More...
 

Static Public Member Functions

static HD_API
HdExtCompCpuComputationSharedPtr 
CreateComputation (HdSceneDelegate *sceneDelegate, const HdExtComputation &computation, HdBufferSourceSharedPtrVector *computationSources)
 Create a CPU computation implementing the given abstract computation. More...
 

Static Public Attributes

static const size_t INVALID_OUTPUT_INDEX
 

Protected Member Functions

virtual HD_API bool _CheckValid () const override
 Returns if the computation is specified correctly. More...
 
- Protected Member Functions inherited from HdBufferSource
void _SetResolved ()
 Marks this buffer source as resolved. More...
 
void _SetResolveError ()
 Called during Resolve() to indicate an unrecoverable failure occurred and the results of the computation can not be used. More...
 
bool _TryLock ()
 Non-blocking lock acquisition. More...
 

Detailed Description

A Buffer Source that represents a CPU implementation of a ExtComputation.

The computation implements the basic: input->processing->output model where the inputs are other buffer sources and processing happens during resolve.

As a computation may have many outputs, the outputs from the CPU Computation can not be directly associated with a BAR. Instead other buffer source computation bind the output to sources that can be used in a BAR.

Outputs to a computation are in SOA form, so a computation may have many outputs, but each output has the same number of elements in it.

Definition at line 61 of file extCompCpuComputation.h.

Constructor & Destructor Documentation

HdExtCompCpuComputation ( const SdfPath id,
const Hd_ExtCompInputSourceSharedPtrVector &  inputs,
const TfTokenVector outputs,
int  numElements,
HdSceneDelegate sceneDelegate 
)

Constructs a new Cpu ExtComputation source.

inputs provides a list of buffer sources that this computation requires. outputs is a list of outputs by names that the computation produces.

Num elements specifies the number of elements in the output.

sceneDelegate and id are used to callback to the scene delegate in order to invoke computation processing.

Member Function Documentation

virtual HD_API bool _CheckValid ( ) const
overrideprotectedvirtual

Returns if the computation is specified correctly.

Implements HdBufferSource.

static HD_API HdExtCompCpuComputationSharedPtr CreateComputation ( HdSceneDelegate sceneDelegate,
const HdExtComputation computation,
HdBufferSourceSharedPtrVector *  computationSources 
)
static

Create a CPU computation implementing the given abstract computation.

The scene delegate identifies which delegate to pull scene inputs from.

virtual HD_API TfToken const& GetName ( ) const
overridevirtual

Returns the id for this computation as a token.

Reimplemented from HdNullBufferSource.

virtual HD_API size_t GetNumElements ( ) const
overridevirtual

Returns the number of elements (e.g.

VtVec3dArray().GetLength()) from the source array.

Reimplemented from HdNullBufferSource.

HD_API const VtValue& GetOutputByIndex ( size_t  index) const

Returns the value of the specified output (after the computations been Resolved).

HD_API size_t GetOutputIndex ( const TfToken outputName) const

Converts a output name token into an index.

virtual HD_API bool Resolve ( )
overridevirtual

Ask the scene delegate to run the computation and captures the output signals.

Implements HdBufferSource.


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