extComputationSchema.h
1 //
2 // Copyright 2021 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 //
25 // This file is generated by a script. Do not edit directly. Edit the
26 // schema.template.h file to make changes.
27 
28 #ifndef PXR_IMAGING_HD_EXT_COMPUTATION_SCHEMA_H
29 #define PXR_IMAGING_HD_EXT_COMPUTATION_SCHEMA_H
30 
31 #include "pxr/imaging/hd/api.h"
32 
33 #include "pxr/imaging/hd/schema.h"
34 
35 PXR_NAMESPACE_OPEN_SCOPE
36 
37 //-----------------------------------------------------------------------------
38 
39 #define HDEXTCOMPUTATION_SCHEMA_TOKENS \
40  (extComputation) \
41  (inputValues) \
42  (inputComputations) \
43  (outputs) \
44  (glslKernel) \
45  (cpuCallback) \
46  (dispatchCount) \
47  (elementCount) \
48 
49 TF_DECLARE_PUBLIC_TOKENS(HdExtComputationSchemaTokens, HD_API,
50  HDEXTCOMPUTATION_SCHEMA_TOKENS);
51 
52 //-----------------------------------------------------------------------------
53 
54 class HdExtComputationSchema : public HdSchema
55 {
56 public:
57  HdExtComputationSchema(HdContainerDataSourceHandle container)
58  : HdSchema(container) {}
59 
60  //ACCESSORS
61 
62  HD_API
63  HdContainerDataSourceHandle GetInputValues();
64  HD_API
65  HdVectorDataSourceHandle GetInputComputations();
66  HD_API
67  HdVectorDataSourceHandle GetOutputs();
68  HD_API
69  HdStringDataSourceHandle GetGlslKernel();
70  HD_API
71  HdDataSourceBaseHandle GetCpuCallback();
72  HD_API
73  HdSizetDataSourceHandle GetDispatchCount();
74  HD_API
75  HdSizetDataSourceHandle GetElementCount();
76 
77  // RETRIEVING AND CONSTRUCTING
78 
84  HD_API
85  static HdContainerDataSourceHandle
86  BuildRetained(
87  const HdContainerDataSourceHandle &inputValues,
88  const HdVectorDataSourceHandle &inputComputations,
89  const HdVectorDataSourceHandle &outputs,
90  const HdStringDataSourceHandle &glslKernel,
91  const HdDataSourceBaseHandle &cpuCallback,
92  const HdSizetDataSourceHandle &dispatchCount,
93  const HdSizetDataSourceHandle &elementCount
94  );
95 
102  class Builder
103  {
104  public:
105  HD_API
106  Builder &SetInputValues(
107  const HdContainerDataSourceHandle &inputValues);
108  HD_API
109  Builder &SetInputComputations(
110  const HdVectorDataSourceHandle &inputComputations);
111  HD_API
112  Builder &SetOutputs(
113  const HdVectorDataSourceHandle &outputs);
114  HD_API
115  Builder &SetGlslKernel(
116  const HdStringDataSourceHandle &glslKernel);
117  HD_API
118  Builder &SetCpuCallback(
119  const HdDataSourceBaseHandle &cpuCallback);
120  HD_API
121  Builder &SetDispatchCount(
122  const HdSizetDataSourceHandle &dispatchCount);
123  HD_API
124  Builder &SetElementCount(
125  const HdSizetDataSourceHandle &elementCount);
126 
128  HD_API
129  HdContainerDataSourceHandle Build();
130 
131  private:
132  HdContainerDataSourceHandle _inputValues;
133  HdVectorDataSourceHandle _inputComputations;
134  HdVectorDataSourceHandle _outputs;
135  HdStringDataSourceHandle _glslKernel;
136  HdDataSourceBaseHandle _cpuCallback;
137  HdSizetDataSourceHandle _dispatchCount;
138  HdSizetDataSourceHandle _elementCount;
139  };
140 
146  HD_API
147  static HdExtComputationSchema GetFromParent(
148  const HdContainerDataSourceHandle &fromParentContainer);
149 
152  HD_API
153  static const HdDataSourceLocator &GetDefaultLocator();
154 
155 
160  HD_API
161  static const HdDataSourceLocator &GetInputValuesLocator();
162 
167  HD_API
168  static const HdDataSourceLocator &GetInputComputationsLocator();
169 
174  HD_API
175  static const HdDataSourceLocator &GetOutputsLocator();
176 
181  HD_API
182  static const HdDataSourceLocator &GetDispatchCountLocator();
183 
188  HD_API
189  static const HdDataSourceLocator &GetElementCountLocator();
190 
195  HD_API
196  static const HdDataSourceLocator &GetGlslKernelLocator();
197 
198 };
199 
200 PXR_NAMESPACE_CLOSE_SCOPE
201 
202 #endif
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
Represents an object that can identify the location of a data source.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:118
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:43