24 #ifndef PXR_IMAGING_HD_EXT_COMP_PRIMVAR_BUFFER_SOURCE_H
25 #define PXR_IMAGING_HD_EXT_COMP_PRIMVAR_BUFFER_SOURCE_H
28 #include "pxr/imaging/hd/api.h"
29 #include "pxr/imaging/hd/bufferSource.h"
30 #include "pxr/imaging/hd/types.h"
35 PXR_NAMESPACE_OPEN_SCOPE
39 using HdExtCompCpuComputationSharedPtr =
40 std::shared_ptr<HdExtCompCpuComputation>;
55 const HdExtCompCpuComputationSharedPtr &source,
56 const TfToken &sourceOutputName,
60 virtual ~HdExtCompPrimvarBufferSource() =
default;
68 virtual void GetBufferSpecs(HdBufferSpecVector *specs)
const override;
76 virtual bool Resolve()
override;
80 virtual void const *
GetData()
const override;
97 template <
class HashState>
98 friend void TfHashAppend(HashState &h,
99 HdExtCompPrimvarBufferSource
const &);
102 HdExtCompCpuComputationSharedPtr _source;
103 size_t _sourceOutputIdx;
105 void const *_rawDataPtr;
107 HdExtCompPrimvarBufferSource() =
delete;
108 HdExtCompPrimvarBufferSource(
const HdExtCompPrimvarBufferSource &)
110 HdExtCompPrimvarBufferSource &operator = (
111 const HdExtCompPrimvarBufferSource &)
115 PXR_NAMESPACE_CLOSE_SCOPE
117 #endif // PXR_IMAGING_HD_EXT_COMP_PRIMVAR_BUFFER_SOURCE_H
A Buffer Source that represents a CPU implementation of a ExtComputation.
virtual HD_API void const * GetData() const override
Returns a raw pointer to the primvar data.
HdTupleType represents zero, one, or more values of the same HdType.
Hd Buffer Source that binds a primvar to a Ext Computation output.
virtual HD_API HdTupleType GetTupleType() const override
Returns the tuple data format of the primvar data.
Token for efficient comparison, assignment, and hashing of known strings.
virtual HD_API size_t ComputeHash() const override
Computes and returns a hash value for the underlying data.
A transient buffer of data that has not yet been committed.
virtual HD_API TfToken const & GetName() const override
Returns the name of the primvar.
virtual HD_API bool _CheckValid() const override
Returns true if the binding to the source computation was successful.
virtual HD_API void GetBufferSpecs(HdBufferSpecVector *specs) const override
Adds this Primvar's buffer description to the buffer spec vector.
virtual HD_API size_t GetNumElements() const override
Returns a count of the number of elements.
virtual HD_API bool Resolve() override
Extracts the primvar from the source computation.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...