Loading...
Searching...
No Matches
extComputationSchema.h
Go to the documentation of this file.
1//
2// Copyright 2023 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
8
9/* ************************************************************************** */
10/* ** ** */
11/* ** This file is generated by a script. ** */
12/* ** ** */
13/* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14/* ** Edit hdSchemaDefs.py instead to make changes. ** */
15/* ** ** */
16/* ************************************************************************** */
17
18#ifndef PXR_IMAGING_HD_EXT_COMPUTATION_SCHEMA_H
19#define PXR_IMAGING_HD_EXT_COMPUTATION_SCHEMA_H
20
22
23#include "pxr/imaging/hd/api.h"
24#include "pxr/imaging/hd/schemaTypeDefs.h"
25
26#include "pxr/imaging/hd/schema.h"
27
28// --(BEGIN CUSTOM CODE: Includes)--
29// --(END CUSTOM CODE: Includes)--
30
31PXR_NAMESPACE_OPEN_SCOPE
32
33// --(BEGIN CUSTOM CODE: Declares)--
34
35using HdExtComputationCpuCallbackSharedPtr =
36 std::shared_ptr<class HdExtComputationCpuCallback>;
39using HdExtComputationCpuCallbackDataSourceHandle =
40 HdExtComputationCpuCallbackDataSource::Handle;
41
42// --(END CUSTOM CODE: Declares)--
43
44#define HD_EXT_COMPUTATION_SCHEMA_TOKENS \
45 (extComputation) \
46 (inputValues) \
47 (inputComputations) \
48 (outputs) \
49 (glslKernel) \
50 (cpuCallback) \
51 (dispatchCount) \
52 (elementCount) \
53
54TF_DECLARE_PUBLIC_TOKENS(HdExtComputationSchemaTokens, HD_API,
55 HD_EXT_COMPUTATION_SCHEMA_TOKENS);
56
57//-----------------------------------------------------------------------------
58
59
60class HdExtComputationSchema : public HdSchema
61{
62public:
65
66 HdExtComputationSchema(HdContainerDataSourceHandle container)
67 : HdSchema(container) {}
68
74 HD_API
75 static HdExtComputationSchema GetFromParent(
76 const HdContainerDataSourceHandle &fromParentContainer);
77
79
80// --(BEGIN CUSTOM CODE: Schema Methods)--
81// --(END CUSTOM CODE: Schema Methods)--
82
85
86 HD_API
87 HdSampledDataSourceContainerSchema GetInputValues() const;
88
89 HD_API
90 HdExtComputationInputComputationContainerSchema GetInputComputations() const;
91
92 HD_API
94
95 HD_API
96 HdStringDataSourceHandle GetGlslKernel() const;
97
98 HD_API
99 HdExtComputationCpuCallbackDataSourceHandle GetCpuCallback() const;
100
101 HD_API
102 HdSizetDataSourceHandle GetDispatchCount() const;
103
104 HD_API
105 HdSizetDataSourceHandle GetElementCount() const;
106
108
111
114 HD_API
115 static const TfToken &GetSchemaToken();
116
119 HD_API
120 static const HdDataSourceLocator &GetDefaultLocator();
121
123
132
134 HD_API
135 static const HdDataSourceLocator &GetInputValuesLocator();
136
138 HD_API
139 static const HdDataSourceLocator &GetInputComputationsLocator();
140
142 HD_API
143 static const HdDataSourceLocator &GetOutputsLocator();
144
146 HD_API
147 static const HdDataSourceLocator &GetGlslKernelLocator();
148
150 HD_API
151 static const HdDataSourceLocator &GetCpuCallbackLocator();
152
154 HD_API
155 static const HdDataSourceLocator &GetDispatchCountLocator();
156
158 HD_API
159 static const HdDataSourceLocator &GetElementCountLocator();
161
164
172 HD_API
173 static HdContainerDataSourceHandle
174 BuildRetained(
175 const HdContainerDataSourceHandle &inputValues,
176 const HdContainerDataSourceHandle &inputComputations,
177 const HdContainerDataSourceHandle &outputs,
178 const HdStringDataSourceHandle &glslKernel,
179 const HdExtComputationCpuCallbackDataSourceHandle &cpuCallback,
180 const HdSizetDataSourceHandle &dispatchCount,
181 const HdSizetDataSourceHandle &elementCount
182 );
183
191 {
192 public:
193 HD_API
194 Builder &SetInputValues(
195 const HdContainerDataSourceHandle &inputValues);
196 HD_API
197 Builder &SetInputComputations(
198 const HdContainerDataSourceHandle &inputComputations);
199 HD_API
200 Builder &SetOutputs(
201 const HdContainerDataSourceHandle &outputs);
202 HD_API
203 Builder &SetGlslKernel(
204 const HdStringDataSourceHandle &glslKernel);
205 HD_API
206 Builder &SetCpuCallback(
207 const HdExtComputationCpuCallbackDataSourceHandle &cpuCallback);
208 HD_API
209 Builder &SetDispatchCount(
210 const HdSizetDataSourceHandle &dispatchCount);
211 HD_API
212 Builder &SetElementCount(
213 const HdSizetDataSourceHandle &elementCount);
214
216 HD_API
217 HdContainerDataSourceHandle Build();
218
219 private:
220 HdContainerDataSourceHandle _inputValues;
221 HdContainerDataSourceHandle _inputComputations;
222 HdContainerDataSourceHandle _outputs;
223 HdStringDataSourceHandle _glslKernel;
224 HdExtComputationCpuCallbackDataSourceHandle _cpuCallback;
225 HdSizetDataSourceHandle _dispatchCount;
226 HdSizetDataSourceHandle _elementCount;
227
228 };
229
231};
232
233PXR_NAMESPACE_CLOSE_SCOPE
234
235#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.
Template class for a schema backed by a container whose children have arbitrary names but an expected...
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:26
Template class for a schema backed by a container whose children have arbitrary names but an expected...
A datasource representing a concretely-typed sampled value.
Definition: dataSource.h:193
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:81