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

#include <extCompCpuComputation.h>

+ Inheritance diagram for HdStExtCompCpuComputation:

Public Member Functions

 HdStExtCompCpuComputation (const SdfPath &id, const HdSt_ExtCompInputSourceSharedPtrVector &inputs, const TfTokenVector &outputs, int numElements, HdSceneDelegate *sceneDelegate)
 
HDST_API ~HdStExtCompCpuComputation () override
 
HDST_API TfToken const & GetName () const override
 Returns the id for this computation as a token. More...
 
HDST_API bool Resolve () override
 
HDST_API size_t GetNumElements () const override
 
HDST_API size_t GetOutputIndex (const TfToken &outputName) const
 Converts a output name token into an index. More...
 
HDST_API const VtValueGetOutputByIndex (size_t index) const
 
- 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
 
- 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
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 HDST_API
HdStExtCompCpuComputationSharedPtr 
CreateComputation (HdSceneDelegate *sceneDelegate, const HdExtComputation &computation, HdBufferSourceSharedPtrVector *computationSources)
 

Static Public Attributes

static HDST_API const size_t INVALID_OUTPUT_INDEX
 

Protected Member Functions

HDST_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 67 of file extCompCpuComputation.h.

Constructor & Destructor Documentation

HdStExtCompCpuComputation::HdStExtCompCpuComputation ( const SdfPath id,
const HdSt_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.

HDST_API HdStExtCompCpuComputation::~HdStExtCompCpuComputation ( )
override

Member Function Documentation

HDST_API bool HdStExtCompCpuComputation::_CheckValid ( ) const
overrideprotectedvirtual

Returns if the computation is specified correctly.

Implements HdBufferSource.

static HDST_API HdStExtCompCpuComputationSharedPtr HdStExtCompCpuComputation::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.

HDST_API TfToken const& HdStExtCompCpuComputation::GetName ( ) const
overridevirtual

Returns the id for this computation as a token.

Reimplemented from HdNullBufferSource.

HDST_API size_t HdStExtCompCpuComputation::GetNumElements ( ) const
overridevirtual

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

Reimplemented from HdNullBufferSource.

HDST_API const VtValue& HdStExtCompCpuComputation::GetOutputByIndex ( size_t  index) const

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

HDST_API size_t HdStExtCompCpuComputation::GetOutputIndex ( const TfToken outputName) const

Converts a output name token into an index.

HDST_API bool HdStExtCompCpuComputation::Resolve ( )
overridevirtual

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

Implements HdBufferSource.

Member Data Documentation

HDST_API const size_t HdStExtCompCpuComputation::INVALID_OUTPUT_INDEX
static

Definition at line 71 of file extCompCpuComputation.h.


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