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

#include <extCompCpuComputation.h>

+ Inheritance diagram for HdExtCompCpuComputation:

Public Member Functions

 HdExtCompCpuComputation (const SdfPath &id, const Hd_ExtCompInputSourceSharedPtrVector &inputs, const TfTokenVector &outputs, int numElements, HdSceneDelegate *sceneDelegate)
virtual HD_API ~HdExtCompCpuComputation ()=default
virtual HD_API TfToken constGetName () const override
 Returns the id for this computation as a token. More...
virtual HD_API bool Resolve () override
virtual HD_API size_t GetNumElements () const override
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
- Public Member Functions inherited from HdNullBufferSource
virtual HD_API void constGetData () 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
- Public Member Functions inherited from HdBufferSource
 HdBufferSource ()
virtual HD_API ~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
virtual HD_API bool HasPreChainedBuffer () const
 Returns true if this buffer has a pre-chained buffer. More...
virtual HD_API
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
GetChainedBuffers () const
 Returns the vector of chained buffers. More...

Static Public Member Functions

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

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 ()
void _SetResolveError ()
bool _TryLock ()

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::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.

virtual HD_API HdExtCompCpuComputation::~HdExtCompCpuComputation ( )

Member Function Documentation

virtual HD_API bool HdExtCompCpuComputation::_CheckValid ( ) const

Returns if the computation is specified correctly.

Implements HdBufferSource.

static HD_API HdExtCompCpuComputationSharedPtr HdExtCompCpuComputation::CreateComputation ( HdSceneDelegate sceneDelegate,
const HdExtComputation computation,
HdBufferSourceSharedPtrVector computationSources 

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& HdExtCompCpuComputation::GetName ( ) const

Returns the id for this computation as a token.

Reimplemented from HdNullBufferSource.

virtual HD_API size_t HdExtCompCpuComputation::GetNumElements ( ) const

Returns the number of elements (e.g. VtVec3dArray().GetLength()) from the source array.

Reimplemented from HdNullBufferSource.

HD_API const VtValue& HdExtCompCpuComputation::GetOutputByIndex ( size_t  index) const

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

HD_API size_t HdExtCompCpuComputation::GetOutputIndex ( const TfToken outputName) const

Converts a output name token into an index.

virtual HD_API bool HdExtCompCpuComputation::Resolve ( )

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

Implements HdBufferSource.

Member Data Documentation

const size_t HdExtCompCpuComputation::INVALID_OUTPUT_INDEX

Definition at line 63 of file extCompCpuComputation.h.

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