7#ifndef PXR_IMAGING_HD_ST_EXT_COMP_CPU_COMPUTATION_H
8#define PXR_IMAGING_HD_ST_EXT_COMP_CPU_COMPUTATION_H
11#include "pxr/imaging/hdSt/api.h"
13#include "pxr/imaging/hd/bufferSource.h"
15#include "pxr/usd/sdf/path.h"
18#include "pxr/base/vt/value.h"
23PXR_NAMESPACE_OPEN_SCOPE
29using HdStExtCompCpuComputationSharedPtr =
30 std::shared_ptr<class HdStExtCompCpuComputation>;
31using HdSt_ExtCompInputSourceSharedPtr =
32 std::shared_ptr<class HdSt_ExtCompInputSource>;
33using HdSt_ExtCompInputSourceSharedPtrVector =
34 std::vector<HdSt_ExtCompInputSourceSharedPtr>;
54 static const size_t INVALID_OUTPUT_INDEX;
67 const HdSt_ExtCompInputSourceSharedPtrVector &inputs,
78 static HdStExtCompCpuComputationSharedPtr
81 HdBufferSourceSharedPtrVector *computationSources);
112 HdSt_ExtCompInputSourceSharedPtrVector _inputs;
117 std::vector<VtValue> _outputValues;
127PXR_NAMESPACE_CLOSE_SCOPE
Hydra Representation of a Client defined computation.
A abstract base class for pure cpu computation.
Adapter class providing data exchange with the client scene graph.
A Buffer Source that represents a CPU implementation of a ExtComputation.
HDST_API bool Resolve() override
Ask the scene delegate to run the computation and captures the output signals.
HdStExtCompCpuComputation(const SdfPath &id, const HdSt_ExtCompInputSourceSharedPtrVector &inputs, const TfTokenVector &outputs, int numElements, HdSceneDelegate *sceneDelegate)
Constructs a new Cpu ExtComputation source.
static HDST_API HdStExtCompCpuComputationSharedPtr CreateComputation(HdSceneDelegate *sceneDelegate, const HdExtComputation &computation, HdBufferSourceSharedPtrVector *computationSources)
Create a CPU computation implementing the given abstract computation.
HDST_API size_t GetNumElements() const override
Returns the number of elements (e.g.
HDST_API TfToken const & GetName() const override
Returns the id for this computation as a token.
HDST_API size_t GetOutputIndex(const TfToken &outputName) const
Converts a output name token into an index.
HDST_API bool _CheckValid() const override
Returns if the computation is specified correctly.
HDST_API const VtValue & GetOutputByIndex(size_t index) const
Returns the value of the specified output (after the computations been Resolved).
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.