All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
extCompGpuComputationBufferSource.h
1 //
2 // Copyright 2017 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef HDST_EXT_COMP_GPU_COMPUTATION_BUFFER_SOURCE_H
25 #define HDST_EXT_COMP_GPU_COMPUTATION_BUFFER_SOURCE_H
26 
27 #include "pxr/pxr.h"
28 #include "pxr/imaging/hdSt/api.h"
29 #include "pxr/imaging/hd/bufferSource.h"
30 #include "pxr/imaging/hdSt/extCompGpuComputationResource.h"
31 
32 #include "pxr/usd/sdf/path.h"
33 
34 #include "pxr/base/tf/token.h"
35 #include "pxr/base/vt/value.h"
36 
37 PXR_NAMESPACE_OPEN_SCOPE
38 
39 typedef boost::shared_ptr<class HdStExtCompGpuComputationBufferSource>
40  HdStExtCompGpuComputationBufferSourceSharedPtr;
41 
68 public:
77  HdBufferSourceVector const &inputs,
78  HdStExtCompGpuComputationResourceSharedPtr const &resource);
79 
80  HDST_API
81  virtual ~HdStExtCompGpuComputationBufferSource() = default;
82 
88  HDST_API
89  virtual bool Resolve() override;
90 
93  virtual HdBufferSourceVector const &GetInputs() const {
94  return _inputs;
95  }
96 
97 protected:
98  virtual bool _CheckValid() const override;
99 
100 private:
101 
102  HdBufferSourceVector _inputs;
103  HdStExtCompGpuComputationResourceSharedPtr _resource;
104 
107  const HdStExtCompGpuComputationBufferSource &) = delete;
109  const HdStExtCompGpuComputationBufferSource &) = delete;
110 };
111 
112 PXR_NAMESPACE_CLOSE_SCOPE
113 
114 #endif // HDST_EXT_COMP_GPU_COMPUTATION_BUFFER_SOURCE_H
A Buffer Source that represents input processing for a GPU implementation of an ExtComputation.
virtual bool _CheckValid() const override
Checks the validity of the source buffer.
virtual HdBufferSourceVector const & GetInputs() const
Returns the vector of HdBufferSource inputs that this source intends to commit to GPU...
A abstract base class for pure cpu computation.
Definition: bufferSource.h:235
virtual HDST_API bool Resolve() override
Resolves the source and populates the HdStExtCompGpuComputationResource.