Loading...
Searching...
No Matches
extComputationSchema.h
1//
2// Copyright 2023 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
26/* ************************************************************************** */
27/* ** ** */
28/* ** This file is generated by a script. ** */
29/* ** ** */
30/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
31/* ** Edit hdGen/schema.py instead to make changes. ** */
32/* ** ** */
33/* ************************************************************************** */
34
35#ifndef PXR_IMAGING_HD_EXT_COMPUTATION_SCHEMA_H
36#define PXR_IMAGING_HD_EXT_COMPUTATION_SCHEMA_H
37
38#include "pxr/imaging/hd/api.h"
39
40#include "pxr/imaging/hd/schema.h"
41
42// --(BEGIN CUSTOM CODE: Includes)--
43// --(END CUSTOM CODE: Includes)--
44
45PXR_NAMESPACE_OPEN_SCOPE
46
47//-----------------------------------------------------------------------------
48
49// --(BEGIN CUSTOM CODE: Declares)--
50// --(END CUSTOM CODE: Declares)--
51
52//-----------------------------------------------------------------------------
53
54#define HD_EXT_COMPUTATION_SCHEMA_TOKENS \
55 (extComputation) \
56 (inputValues) \
57 (inputComputations) \
58 (outputs) \
59 (glslKernel) \
60 (cpuCallback) \
61 (dispatchCount) \
62 (elementCount) \
63
64TF_DECLARE_PUBLIC_TOKENS(HdExtComputationSchemaTokens, HD_API,
65 HD_EXT_COMPUTATION_SCHEMA_TOKENS);
66
67//-----------------------------------------------------------------------------
68class HdExtComputationSchema : public HdSchema
69{
70public:
71 HdExtComputationSchema(HdContainerDataSourceHandle container)
72 : HdSchema(container) {}
73
74// --(BEGIN CUSTOM CODE: Schema Methods)--
75// --(END CUSTOM CODE: Schema Methods)--
76
77 //ACCESSORS
78
79
80 HD_API
81 HdContainerDataSourceHandle GetInputValues();
82
83 HD_API
84 HdVectorDataSourceHandle GetInputComputations();
85
86 HD_API
87 HdVectorDataSourceHandle GetOutputs();
88
89 HD_API
90 HdStringDataSourceHandle GetGlslKernel();
91
92 HD_API
93 HdDataSourceBaseHandle GetCpuCallback();
94
95 HD_API
96 HdSizetDataSourceHandle GetDispatchCount();
97
98 HD_API
99 HdSizetDataSourceHandle GetElementCount();
100
101 // RETRIEVING AND CONSTRUCTING
102
108 HD_API
109 static HdContainerDataSourceHandle
110 BuildRetained(
111 const HdContainerDataSourceHandle &inputValues,
112 const HdVectorDataSourceHandle &inputComputations,
113 const HdVectorDataSourceHandle &outputs,
114 const HdStringDataSourceHandle &glslKernel,
115 const HdDataSourceBaseHandle &cpuCallback,
116 const HdSizetDataSourceHandle &dispatchCount,
117 const HdSizetDataSourceHandle &elementCount
118 );
119
127 {
128 public:
129 HD_API
130 Builder &SetInputValues(
131 const HdContainerDataSourceHandle &inputValues);
132 HD_API
133 Builder &SetInputComputations(
134 const HdVectorDataSourceHandle &inputComputations);
135 HD_API
136 Builder &SetOutputs(
137 const HdVectorDataSourceHandle &outputs);
138 HD_API
139 Builder &SetGlslKernel(
140 const HdStringDataSourceHandle &glslKernel);
141 HD_API
142 Builder &SetCpuCallback(
143 const HdDataSourceBaseHandle &cpuCallback);
144 HD_API
145 Builder &SetDispatchCount(
146 const HdSizetDataSourceHandle &dispatchCount);
147 HD_API
148 Builder &SetElementCount(
149 const HdSizetDataSourceHandle &elementCount);
150
152 HD_API
153 HdContainerDataSourceHandle Build();
154
155 private:
156 HdContainerDataSourceHandle _inputValues;
157 HdVectorDataSourceHandle _inputComputations;
158 HdVectorDataSourceHandle _outputs;
159 HdStringDataSourceHandle _glslKernel;
160 HdDataSourceBaseHandle _cpuCallback;
161 HdSizetDataSourceHandle _dispatchCount;
162 HdSizetDataSourceHandle _elementCount;
163 };
164
170 HD_API
171 static HdExtComputationSchema GetFromParent(
172 const HdContainerDataSourceHandle &fromParentContainer);
173
176 HD_API
177 static const TfToken &GetSchemaToken();
178
181 HD_API
182 static const HdDataSourceLocator &GetDefaultLocator();
183
184 // DATA SOURCE LOCATORS FOR MEMBERS
185 //
186 // The following methods return an HdDataSourceLocator (relative to the
187 // prim-level data source) where the data source for a member can be found.
188 //
189 // This is often useful for checking intersection against the
190 // HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
191
192
194 HD_API
195 static const HdDataSourceLocator &GetInputValuesLocator();
196
198 HD_API
199 static const HdDataSourceLocator &GetInputComputationsLocator();
200
202 HD_API
203 static const HdDataSourceLocator &GetOutputsLocator();
204
206 HD_API
207 static const HdDataSourceLocator &GetGlslKernelLocator();
208
210 HD_API
211 static const HdDataSourceLocator &GetCpuCallbackLocator();
212
214 HD_API
215 static const HdDataSourceLocator &GetDispatchCountLocator();
216
218 HD_API
219 static const HdDataSourceLocator &GetElementCountLocator();
220
221
222};
223
224PXR_NAMESPACE_CLOSE_SCOPE
225
226#endif
Represents an object that can identify the location of a data source.
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:43
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:108