Loading...
Searching...
No Matches
HdComputedBufferSource Class Reference

A abstract base class for cpu computation followed by buffer transfer to the GPU. More...

#include <bufferSource.h>

+ Inheritance diagram for HdComputedBufferSource:

Public Member Functions

virtual HD_API TfToken const & GetName () const override
 Return the name of this buffer source.
 
virtual HD_API size_t ComputeHash () const override
 Computes and returns a hash value for the underlying data.
 
virtual HD_API void const * GetData () const override
 Following interfaces will be called after Resolve.
 
virtual HD_API HdTupleType GetTupleType () const override
 Returns the data type and count (array size) for this buffer source.
 
virtual HD_API size_t GetNumElements () const override
 Returns the number of elements (e.g.
 
- Public Member Functions inherited from HdBufferSource
virtual TfToken const & GetName () const =0
 Return the name of this buffer source.
 
virtual void GetBufferSpecs (HdBufferSpecVector *specs) const =0
 Add the buffer spec for this buffer source into given bufferspec vector.
 
virtual HD_API size_t ComputeHash () const
 Computes and returns a hash value for the underlying data.
 
virtual bool Resolve ()=0
 Prepare the access of GetData().
 
virtual void const * GetData () const =0
 Following interfaces will be called after Resolve.
 
virtual HdTupleType GetTupleType () const =0
 Returns the data type and count (array size) for this buffer source.
 
virtual size_t GetNumElements () const =0
 Returns the number of elements (e.g.
 
bool IsResolved () const
 Returns true it this computation has already been resolved.
 
bool HasResolveError () const
 Returns true if an error occurred during resolve.
 
HD_API bool IsValid () const
 Checks the validity of the source buffer.
 
virtual HD_API bool HasPreChainedBuffer () const
 Returns true if this buffer has a pre-chained buffer.
 
virtual HD_API HdBufferSourceSharedPtr GetPreChainedBuffer () const
 Returns the pre-chained buffer.
 
virtual HD_API bool HasChainedBuffer () const
 Returns true if this buffer has any chained buffer(s)
 
virtual HD_API HdBufferSourceSharedPtrVector GetChainedBuffers () const
 Returns the vector of chained buffers.
 

Protected Member Functions

void _SetResult (HdBufferSourceSharedPtr const &result)
 
- Protected Member Functions inherited from HdBufferSource
void _SetResolved ()
 Marks this buffer source as resolved.
 
void _SetResolveError ()
 Called during Resolve() to indicate an unrecoverable failure occurred and the results of the computation can not be used.
 
bool _TryLock ()
 Non-blocking lock acquisition.
 
virtual bool _CheckValid () const =0
 Checks the validity of the source buffer.
 

Detailed Description

A abstract base class for cpu computation followed by buffer transfer to the GPU.

concrete class needs to implement virtual void GetBufferSpecs(HdBufferSpecVector *specs) const; virtual void Resolve(); and set the result via _SetResult().

Definition at line 213 of file bufferSource.h.

Member Function Documentation

◆ _SetResult()

void _SetResult ( HdBufferSourceSharedPtr const &  result)
inlineprotected

Definition at line 227 of file bufferSource.h.

◆ ComputeHash()

virtual HD_API size_t ComputeHash ( ) const
overridevirtual

Computes and returns a hash value for the underlying data.

Reimplemented from HdBufferSource.

◆ GetData()

virtual HD_API void const * GetData ( ) const
overridevirtual

Following interfaces will be called after Resolve.

Returns the raw pointer to the underlying data.

Implements HdBufferSource.

◆ GetName()

virtual HD_API TfToken const & GetName ( ) const
overridevirtual

Return the name of this buffer source.

Implements HdBufferSource.

◆ GetNumElements()

virtual HD_API size_t GetNumElements ( ) const
overridevirtual

Returns the number of elements (e.g.

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

Implements HdBufferSource.

◆ GetTupleType()

virtual HD_API HdTupleType GetTupleType ( ) const
overridevirtual

Returns the data type and count (array size) for this buffer source.

Implements HdBufferSource.


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