Loading...
Searching...
No Matches
computation.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HD_ST_COMPUTATION_H
8#define PXR_IMAGING_HD_ST_COMPUTATION_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hdSt/api.h"
12
13#include <memory>
14#include <vector>
15
16PXR_NAMESPACE_OPEN_SCOPE
17
18
20
21using HdBufferArrayRangeSharedPtr = std::shared_ptr<class HdBufferArrayRange>;
22using HdBufferSpecVector = std::vector<struct HdBufferSpec>;
23
24using HdStComputationSharedPtr = std::shared_ptr<class HdStComputation>;
25using HdStComputationSharedPtrVector = std::vector<HdStComputationSharedPtr>;
26
36{
37public:
38 HDST_API
39 virtual ~HdStComputation();
40
42 virtual void Execute(
43 HdBufferArrayRangeSharedPtr const &range,
44 HdResourceRegistry *resourceRegistry) = 0;
45
51 virtual int GetNumOutputElements() const = 0;
52
56 virtual void GetBufferSpecs(HdBufferSpecVector *specs) const = 0;
57
62 bool IsValid() { return true; }
63};
64
65
66PXR_NAMESPACE_CLOSE_SCOPE
67
68#endif // PXR_IMAGING_HD_ST_COMPUTATION_H
A central registry for resources.
An interface class for GPU computation.
Definition: computation.h:36
virtual void Execute(HdBufferArrayRangeSharedPtr const &range, HdResourceRegistry *resourceRegistry)=0
Execute computation.
virtual void GetBufferSpecs(HdBufferSpecVector *specs) const =0
Add the buffer spec for this computation into given bufferspec vector.
bool IsValid()
This function is needed as HdStComputation shares a templatized interface with HdBufferSource.
Definition: computation.h:62
virtual int GetNumOutputElements() const =0
Returns the size of its destination buffer (located by range argument of Execute()).