OpenSubdiv: opensubdiv/osd/glComputeEvaluator.h Source File

| OpenSubdiv

Loading...
Searching...
No Matches
glComputeEvaluator.h
Go to the documentation of this file.
1//
2// Copyright 2015 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://opensubdiv.org/license.
6//
7
8#ifndef OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H
9#define OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H
10
11#include "../version.h"
12
13#include "../osd/types.h"
14#include "../osd/bufferDescriptor.h"
15
16namespace OpenSubdiv {
17namespace OPENSUBDIV_VERSION {
18
19namespace Far {
20 class PatchTable;
21 class StencilTable;
22 class LimitStencilTable;
23}
24
25namespace Osd {
26
33 class GLStencilTableSSBO {
34public:
35 using ID = unsigned int; // GLuint resource ID
36
37 static GLStencilTableSSBO *Create(Far::StencilTable const *stencilTable,
38 void *deviceContext = NULL) {
39 (void)deviceContext; // unused
40 return new GLStencilTableSSBO(stencilTable);
41 }
42 static GLStencilTableSSBO *Create(
43 Far::LimitStencilTable const *limitStencilTable,
44 void *deviceContext = NULL) {
45 (void)deviceContext; // unused
46 return new GLStencilTableSSBO(limitStencilTable);
47 }
48
49 explicit GLStencilTableSSBO(Far::StencilTable const *stencilTable);
50 explicit GLStencilTableSSBO(Far::LimitStencilTable const *limitStencilTable);
51 ~GLStencilTableSSBO();
52
53 // interfaces needed for GLSLComputeKernel
54 ID GetSizesBuffer() const { return _sizes; }
55 ID GetOffsetsBuffer() const { return _offsets; }
56 ID GetIndicesBuffer() const { return _indices; }
57 ID GetWeightsBuffer() const { return _weights; }
58 ID GetDuWeightsBuffer() const { return _duWeights; }
59 ID GetDvWeightsBuffer() const { return _dvWeights; }
60 ID GetDuuWeightsBuffer() const { return _duuWeights; }
61 ID GetDuvWeightsBuffer() const { return _duvWeights; }
62 ID GetDvvWeightsBuffer() const { return _dvvWeights; }
63 int GetNumStencils() const { return _numStencils; }
64
65private:
66 ID _sizes;
67 ID _offsets;
68 ID _indices;
69 ID _weights;
70 ID _duWeights;
71 ID _dvWeights;
72 ID _duuWeights;
73 ID _duvWeights;
74 ID _dvvWeights;
75 int _numStencils;
76};
77
78// ---------------------------------------------------------------------------
79
80 class GLComputeEvaluator {
81public:
82 using ID = unsigned int; // GLuint resource ID
83 using Instantiatable = bool; // Enable compiled kernel evaluator cache
84
85 static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc,
86 BufferDescriptor const &dstDesc,
87 BufferDescriptor const &duDesc,
88 BufferDescriptor const &dvDesc,
89 void * deviceContext = NULL) {
90 return Create(srcDesc, dstDesc, duDesc, dvDesc,
91 BufferDescriptor(),
92 BufferDescriptor(),
93 BufferDescriptor(),
94 deviceContext);
95 }
96
97 static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc,
98 BufferDescriptor const &dstDesc,
99 BufferDescriptor const &duDesc,
100 BufferDescriptor const &dvDesc,
101 BufferDescriptor const &duuDesc,
102 BufferDescriptor const &duvDesc,
103 BufferDescriptor const &dvvDesc,
104 void * deviceContext = NULL) {
105 (void)deviceContext; // not used
106 GLComputeEvaluator *instance = new GLComputeEvaluator();
107 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc,
108 duuDesc, duvDesc, dvvDesc))
109 return instance;
110 delete instance;
111 return NULL;
112 }
113
115 GLComputeEvaluator();
116
118 ~GLComputeEvaluator();
119
125
153 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
154 static bool EvalStencils(
155 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
156 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
157 STENCIL_TABLE const *stencilTable,
158 GLComputeEvaluator const *instance,
159 void * deviceContext = NULL) {
160
161 if (instance) {
162 return instance->EvalStencils(srcBuffer, srcDesc,
163 dstBuffer, dstDesc,
164 stencilTable);
165 } else {
166 // Create an instance on demand (slow)
167 (void)deviceContext; // unused
168 instance = Create(srcDesc, dstDesc,
169 BufferDescriptor(),
170 BufferDescriptor());
171 if (instance) {
172 bool r = instance->EvalStencils(srcBuffer, srcDesc,
173 dstBuffer, dstDesc,
174 stencilTable);
175 delete instance;
176 return r;
177 }
178 return false;
179 }
180 }
181
221 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
222 static bool EvalStencils(
223 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
224 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
225 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
226 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
227 STENCIL_TABLE const *stencilTable,
228 GLComputeEvaluator const *instance,
229 void * deviceContext = NULL) {
230
231 if (instance) {
232 return instance->EvalStencils(srcBuffer, srcDesc,
233 dstBuffer, dstDesc,
234 duBuffer, duDesc,
235 dvBuffer, dvDesc,
236 stencilTable);
237 } else {
238 // Create an instance on demand (slow)
239 (void)deviceContext; // unused
240 instance = Create(srcDesc, dstDesc, duDesc, dvDesc);
241 if (instance) {
242 bool r = instance->EvalStencils(srcBuffer, srcDesc,
243 dstBuffer, dstDesc,
244 duBuffer, duDesc,
245 dvBuffer, dvDesc,
246 stencilTable);
247 delete instance;
248 return r;
249 }
250 return false;
251 }
252 }
253
311 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
312 static bool EvalStencils(
313 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
314 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
315 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
316 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
317 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
318 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
319 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
320 STENCIL_TABLE const *stencilTable,
321 GLComputeEvaluator const *instance,
322 void * deviceContext = NULL) {
323
324 if (instance) {
325 return instance->EvalStencils(srcBuffer, srcDesc,
326 dstBuffer, dstDesc,
327 duBuffer, duDesc,
328 dvBuffer, dvDesc,
329 duuBuffer, duuDesc,
330 duvBuffer, duvDesc,
331 dvvBuffer, dvvDesc,
332 stencilTable);
333 } else {
334 // Create an instance on demand (slow)
335 (void)deviceContext; // unused
336 instance = Create(srcDesc, dstDesc, duDesc, dvDesc,
337 duuDesc, duvDesc, dvvDesc);
338 if (instance) {
339 bool r = instance->EvalStencils(srcBuffer, srcDesc,
340 dstBuffer, dstDesc,
341 duBuffer, duDesc,
342 dvBuffer, dvDesc,
343 duuBuffer, duuDesc,
344 duvBuffer, duvDesc,
345 dvvBuffer, dvvDesc,
346 stencilTable);
347 delete instance;
348 return r;
349 }
350 return false;
351 }
352 }
353
371 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
372 bool EvalStencils(
373 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
374 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
375 STENCIL_TABLE const *stencilTable) const {
376 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
377 dstBuffer->BindVBO(), dstDesc,
378 0, BufferDescriptor(),
379 0, BufferDescriptor(),
380 stencilTable->GetSizesBuffer(),
381 stencilTable->GetOffsetsBuffer(),
382 stencilTable->GetIndicesBuffer(),
383 stencilTable->GetWeightsBuffer(),
384 0,
385 0,
386 /* start = */ 0,
387 /* end = */ stencilTable->GetNumStencils());
388 }
389
419 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
420 bool EvalStencils(
421 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
422 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
423 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
424 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
425 STENCIL_TABLE const *stencilTable) const {
426 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
427 dstBuffer->BindVBO(), dstDesc,
428 duBuffer->BindVBO(), duDesc,
429 dvBuffer->BindVBO(), dvDesc,
430 stencilTable->GetSizesBuffer(),
431 stencilTable->GetOffsetsBuffer(),
432 stencilTable->GetIndicesBuffer(),
433 stencilTable->GetWeightsBuffer(),
434 stencilTable->GetDuWeightsBuffer(),
435 stencilTable->GetDvWeightsBuffer(),
436 /* start = */ 0,
437 /* end = */ stencilTable->GetNumStencils());
438 }
439
487 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
488 bool EvalStencils(
489 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
490 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
491 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
492 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
493 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
494 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
495 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
496 STENCIL_TABLE const *stencilTable) const {
497 return EvalStencils(srcBuffer->BindVBO(), srcDesc,
498 dstBuffer->BindVBO(), dstDesc,
499 duBuffer->BindVBO(), duDesc,
500 dvBuffer->BindVBO(), dvDesc,
501 duuBuffer->BindVBO(), duuDesc,
502 duvBuffer->BindVBO(), duvDesc,
503 dvvBuffer->BindVBO(), dvvDesc,
504 stencilTable->GetSizesBuffer(),
505 stencilTable->GetOffsetsBuffer(),
506 stencilTable->GetIndicesBuffer(),
507 stencilTable->GetWeightsBuffer(),
508 stencilTable->GetDuWeightsBuffer(),
509 stencilTable->GetDvWeightsBuffer(),
510 stencilTable->GetDuuWeightsBuffer(),
511 stencilTable->GetDuvWeightsBuffer(),
512 stencilTable->GetDvvWeightsBuffer(),
513 /* start = */ 0,
514 /* end = */ stencilTable->GetNumStencils());
515 }
516
552 bool EvalStencils(ID srcBuffer, BufferDescriptor const &srcDesc,
553 ID dstBuffer, BufferDescriptor const &dstDesc,
554 ID duBuffer, BufferDescriptor const &duDesc,
555 ID dvBuffer, BufferDescriptor const &dvDesc,
556 ID sizesBuffer,
557 ID offsetsBuffer,
558 ID indicesBuffer,
559 ID weightsBuffer,
560 ID duWeightsBuffer,
561 ID dvWeightsBuffer,
562 int start,
563 int end) const;
564
618 bool EvalStencils(ID srcBuffer, BufferDescriptor const &srcDesc,
619 ID dstBuffer, BufferDescriptor const &dstDesc,
620 ID duBuffer, BufferDescriptor const &duDesc,
621 ID dvBuffer, BufferDescriptor const &dvDesc,
622 ID duuBuffer, BufferDescriptor const &duuDesc,
623 ID duvBuffer, BufferDescriptor const &duvDesc,
624 ID dvvBuffer, BufferDescriptor const &dvvDesc,
625 ID sizesBuffer,
626 ID offsetsBuffer,
627 ID indicesBuffer,
628 ID weightsBuffer,
629 ID duWeightsBuffer,
630 ID dvWeightsBuffer,
631 ID duuWeightsBuffer,
632 ID duvWeightsBuffer,
633 ID dvvWeightsBuffer,
634 int start,
635 int end) const;
636
642
675 template <typename SRC_BUFFER, typename DST_BUFFER,
676 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
677 static bool EvalPatches(
678 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
679 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
680 int numPatchCoords,
681 PATCHCOORD_BUFFER *patchCoords,
682 PATCH_TABLE *patchTable,
683 GLComputeEvaluator const *instance,
684 void * deviceContext = NULL) {
685
686 if (instance) {
687 return instance->EvalPatches(srcBuffer, srcDesc,
688 dstBuffer, dstDesc,
689 numPatchCoords, patchCoords,
690 patchTable);
691 } else {
692 // Create an instance on demand (slow)
693 (void)deviceContext; // unused
694 instance = Create(srcDesc, dstDesc,
695 BufferDescriptor(),
696 BufferDescriptor());
697 if (instance) {
698 bool r = instance->EvalPatches(srcBuffer, srcDesc,
699 dstBuffer, dstDesc,
700 numPatchCoords, patchCoords,
701 patchTable);
702 delete instance;
703 return r;
704 }
705 return false;
706 }
707 }
708
753 template <typename SRC_BUFFER, typename DST_BUFFER,
754 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
755 static bool EvalPatches(
756 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
757 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
758 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
759 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
760 int numPatchCoords,
761 PATCHCOORD_BUFFER *patchCoords,
762 PATCH_TABLE *patchTable,
763 GLComputeEvaluator const *instance,
764 void * deviceContext = NULL) {
765
766 if (instance) {
767 return instance->EvalPatches(srcBuffer, srcDesc,
768 dstBuffer, dstDesc,
769 duBuffer, duDesc,
770 dvBuffer, dvDesc,
771 numPatchCoords, patchCoords,
772 patchTable);
773 } else {
774 // Create an instance on demand (slow)
775 (void)deviceContext; // unused
776 instance = Create(srcDesc, dstDesc,
777 duDesc, dvDesc);
778 if (instance) {
779 bool r = instance->EvalPatches(srcBuffer, srcDesc,
780 dstBuffer, dstDesc,
781 duBuffer, duDesc,
782 dvBuffer, dvDesc,
783 numPatchCoords, patchCoords,
784 patchTable);
785 delete instance;
786 return r;
787 }
788 return false;
789 }
790 }
791
854 template <typename SRC_BUFFER, typename DST_BUFFER,
855 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
856 static bool EvalPatches(
857 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
858 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
859 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
860 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
861 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
862 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
863 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
864 int numPatchCoords,
865 PATCHCOORD_BUFFER *patchCoords,
866 PATCH_TABLE *patchTable,
867 GLComputeEvaluator const *instance,
868 void * deviceContext = NULL) {
869
870 if (instance) {
871 return instance->EvalPatches(srcBuffer, srcDesc,
872 dstBuffer, dstDesc,
873 duBuffer, duDesc,
874 dvBuffer, dvDesc,
875 duuBuffer, duuDesc,
876 duvBuffer, duvDesc,
877 dvvBuffer, dvvDesc,
878 numPatchCoords, patchCoords,
879 patchTable);
880 } else {
881 // Create an instance on demand (slow)
882 (void)deviceContext; // unused
883 instance = Create(srcDesc, dstDesc,
884 duDesc, dvDesc,
885 duuDesc, duvDesc, dvvDesc);
886 if (instance) {
887 bool r = instance->EvalPatches(srcBuffer, srcDesc,
888 dstBuffer, dstDesc,
889 duBuffer, duDesc,
890 dvBuffer, dvDesc,
891 duuBuffer, duuDesc,
892 duvBuffer, duvDesc,
893 dvvBuffer, dvvDesc,
894 numPatchCoords, patchCoords,
895 patchTable);
896 delete instance;
897 return r;
898 }
899 return false;
900 }
901 }
902
927 template <typename SRC_BUFFER, typename DST_BUFFER,
928 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
929 bool EvalPatches(
930 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
931 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
932 int numPatchCoords,
933 PATCHCOORD_BUFFER *patchCoords,
934 PATCH_TABLE *patchTable) const {
935
936 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
937 dstBuffer->BindVBO(), dstDesc,
938 0, BufferDescriptor(),
939 0, BufferDescriptor(),
940 numPatchCoords,
941 patchCoords->BindVBO(),
942 patchTable->GetPatchArrays(),
943 patchTable->GetPatchIndexBuffer(),
944 patchTable->GetPatchParamBuffer());
945 }
946
981 template <typename SRC_BUFFER, typename DST_BUFFER,
982 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
983 bool EvalPatches(
984 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
985 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
986 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
987 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
988 int numPatchCoords,
989 PATCHCOORD_BUFFER *patchCoords,
990 PATCH_TABLE *patchTable) const {
991
992 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
993 dstBuffer->BindVBO(), dstDesc,
994 duBuffer->BindVBO(), duDesc,
995 dvBuffer->BindVBO(), dvDesc,
996 numPatchCoords,
997 patchCoords->BindVBO(),
998 patchTable->GetPatchArrays(),
999 patchTable->GetPatchIndexBuffer(),
1000 patchTable->GetPatchParamBuffer());
1001 }
1002
1055 template <typename SRC_BUFFER, typename DST_BUFFER,
1056 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1057 bool EvalPatches(
1058 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1059 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1060 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1061 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1062 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
1063 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
1064 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
1065 int numPatchCoords,
1066 PATCHCOORD_BUFFER *patchCoords,
1067 PATCH_TABLE *patchTable) const {
1068
1069 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
1070 dstBuffer->BindVBO(), dstDesc,
1071 duBuffer->BindVBO(), duDesc,
1072 dvBuffer->BindVBO(), dvDesc,
1073 duuBuffer->BindVBO(), duuDesc,
1074 duvBuffer->BindVBO(), duvDesc,
1075 dvvBuffer->BindVBO(), dvvDesc,
1076 numPatchCoords,
1077 patchCoords->BindVBO(),
1078 patchTable->GetPatchArrays(),
1079 patchTable->GetPatchIndexBuffer(),
1080 patchTable->GetPatchParamBuffer());
1081 }
1082
1083 bool EvalPatches(ID srcBuffer, BufferDescriptor const &srcDesc,
1084 ID dstBuffer, BufferDescriptor const &dstDesc,
1085 ID duBuffer, BufferDescriptor const &duDesc,
1086 ID dvBuffer, BufferDescriptor const &dvDesc,
1087 int numPatchCoords,
1088 ID patchCoordsBuffer,
1089 const PatchArrayVector &patchArrays,
1090 ID patchIndexBuffer,
1091 ID patchParamsBuffer) const;
1092
1093 bool EvalPatches(ID srcBuffer, BufferDescriptor const &srcDesc,
1094 ID dstBuffer, BufferDescriptor const &dstDesc,
1095 ID duBuffer, BufferDescriptor const &duDesc,
1096 ID dvBuffer, BufferDescriptor const &dvDesc,
1097 ID duuBuffer, BufferDescriptor const &duuDesc,
1098 ID duvBuffer, BufferDescriptor const &duvDesc,
1099 ID dvvBuffer, BufferDescriptor const &dvvDesc,
1100 int numPatchCoords,
1101 ID patchCoordsBuffer,
1102 const PatchArrayVector &patchArrays,
1103 ID patchIndexBuffer,
1104 ID patchParamsBuffer) const;
1105
1138 template <typename SRC_BUFFER, typename DST_BUFFER,
1139 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1140 static bool EvalPatchesVarying(
1141 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1142 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1143 int numPatchCoords,
1144 PATCHCOORD_BUFFER *patchCoords,
1145 PATCH_TABLE *patchTable,
1146 GLComputeEvaluator const *instance,
1147 void * deviceContext = NULL) {
1148
1149 if (instance) {
1150 return instance->EvalPatchesVarying(
1151 srcBuffer, srcDesc,
1152 dstBuffer, dstDesc,
1153 numPatchCoords, patchCoords,
1154 patchTable);
1155 } else {
1156 // Create an instance on demand (slow)
1157 (void)deviceContext; // unused
1158 instance = Create(srcDesc, dstDesc,
1159 BufferDescriptor(),
1160 BufferDescriptor());
1161 if (instance) {
1162 bool r = instance->EvalPatchesVarying(
1163 srcBuffer, srcDesc,
1164 dstBuffer, dstDesc,
1165 numPatchCoords, patchCoords,
1166 patchTable);
1167 delete instance;
1168 return r;
1169 }
1170 return false;
1171 }
1172 }
1173
1198 template <typename SRC_BUFFER, typename DST_BUFFER,
1199 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1200 bool EvalPatchesVarying(
1201 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1202 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1203 int numPatchCoords,
1204 PATCHCOORD_BUFFER *patchCoords,
1205 PATCH_TABLE *patchTable) const {
1206
1207 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
1208 dstBuffer->BindVBO(), dstDesc,
1209 0, BufferDescriptor(),
1210 0, BufferDescriptor(),
1211 numPatchCoords,
1212 patchCoords->BindVBO(),
1213 patchTable->GetVaryingPatchArrays(),
1214 patchTable->GetVaryingPatchIndexBuffer(),
1215 patchTable->GetPatchParamBuffer());
1216 }
1217
1262 template <typename SRC_BUFFER, typename DST_BUFFER,
1263 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1264 static bool EvalPatchesVarying(
1265 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1266 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1267 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1268 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1269 int numPatchCoords,
1270 PATCHCOORD_BUFFER *patchCoords,
1271 PATCH_TABLE *patchTable,
1272 GLComputeEvaluator const *instance,
1273 void * deviceContext = NULL) {
1274
1275 if (instance) {
1276 return instance->EvalPatchesVarying(
1277 srcBuffer, srcDesc,
1278 dstBuffer, dstDesc,
1279 duBuffer, duDesc,
1280 dvBuffer, dvDesc,
1281 numPatchCoords, patchCoords,
1282 patchTable);
1283 } else {
1284 // Create an instance on demand (slow)
1285 (void)deviceContext; // unused
1286 instance = Create(srcDesc, dstDesc,
1287 duDesc, dvDesc);
1288 if (instance) {
1289 bool r = instance->EvalPatchesVarying(
1290 srcBuffer, srcDesc,
1291 dstBuffer, dstDesc,
1292 duBuffer, duDesc,
1293 dvBuffer, dvDesc,
1294 numPatchCoords, patchCoords,
1295 patchTable);
1296 delete instance;
1297 return r;
1298 }
1299 return false;
1300 }
1301 }
1302
1339 template <typename SRC_BUFFER, typename DST_BUFFER,
1340 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1341 bool EvalPatchesVarying(
1342 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1343 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1344 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1345 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1346 int numPatchCoords,
1347 PATCHCOORD_BUFFER *patchCoords,
1348 PATCH_TABLE *patchTable) const {
1349
1350 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
1351 dstBuffer->BindVBO(), dstDesc,
1352 duBuffer->BindVBO(), duDesc,
1353 dvBuffer->BindVBO(), dvDesc,
1354 numPatchCoords,
1355 patchCoords->BindVBO(),
1356 patchTable->GetVaryingPatchArrays(),
1357 patchTable->GetVaryingPatchIndexBuffer(),
1358 patchTable->GetPatchParamBuffer());
1359 }
1360
1423 template <typename SRC_BUFFER, typename DST_BUFFER,
1424 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1425 static bool EvalPatchesVarying(
1426 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1427 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1428 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1429 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1430 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
1431 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
1432 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
1433 int numPatchCoords,
1434 PATCHCOORD_BUFFER *patchCoords,
1435 PATCH_TABLE *patchTable,
1436 GLComputeEvaluator const *instance,
1437 void * deviceContext = NULL) {
1438
1439 if (instance) {
1440 return instance->EvalPatchesVarying(
1441 srcBuffer, srcDesc,
1442 dstBuffer, dstDesc,
1443 duBuffer, duDesc,
1444 dvBuffer, dvDesc,
1445 duuBuffer, duuDesc,
1446 duvBuffer, duvDesc,
1447 dvvBuffer, dvvDesc,
1448 numPatchCoords, patchCoords,
1449 patchTable);
1450 } else {
1451 // Create an instance on demand (slow)
1452 (void)deviceContext; // unused
1453 instance = Create(srcDesc, dstDesc,
1454 duDesc, dvDesc,
1455 duuDesc, duvDesc, dvvDesc);
1456 if (instance) {
1457 bool r = instance->EvalPatchesVarying(
1458 srcBuffer, srcDesc,
1459 dstBuffer, dstDesc,
1460 duBuffer, duDesc,
1461 dvBuffer, dvDesc,
1462 duuBuffer, duuDesc,
1463 duvBuffer, duvDesc,
1464 dvvBuffer, dvvDesc,
1465 numPatchCoords, patchCoords,
1466 patchTable);
1467 delete instance;
1468 return r;
1469 }
1470 return false;
1471 }
1472 }
1473
1528 template <typename SRC_BUFFER, typename DST_BUFFER,
1529 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1530 bool EvalPatchesVarying(
1531 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1532 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1533 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1534 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1535 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
1536 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
1537 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
1538 int numPatchCoords,
1539 PATCHCOORD_BUFFER *patchCoords,
1540 PATCH_TABLE *patchTable) const {
1541
1542 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
1543 dstBuffer->BindVBO(), dstDesc,
1544 duBuffer->BindVBO(), duDesc,
1545 dvBuffer->BindVBO(), dvDesc,
1546 duuBuffer->BindVBO(), duuDesc,
1547 duvBuffer->BindVBO(), duvDesc,
1548 dvvBuffer->BindVBO(), dvvDesc,
1549 numPatchCoords,
1550 patchCoords->BindVBO(),
1551 patchTable->GetVaryingPatchArrays(),
1552 patchTable->GetVaryingPatchIndexBuffer(),
1553 patchTable->GetPatchParamBuffer());
1554 }
1555
1590 template <typename SRC_BUFFER, typename DST_BUFFER,
1591 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1592 static bool EvalPatchesFaceVarying(
1593 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1594 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1595 int numPatchCoords,
1596 PATCHCOORD_BUFFER *patchCoords,
1597 PATCH_TABLE *patchTable,
1598 int fvarChannel,
1599 GLComputeEvaluator const *instance,
1600 void * deviceContext = NULL) {
1601
1602 if (instance) {
1603 return instance->EvalPatchesFaceVarying(
1604 srcBuffer, srcDesc,
1605 dstBuffer, dstDesc,
1606 numPatchCoords, patchCoords,
1607 patchTable, fvarChannel);
1608 } else {
1609 // Create an instance on demand (slow)
1610 (void)deviceContext; // unused
1611 instance = Create(srcDesc, dstDesc,
1612 BufferDescriptor(),
1613 BufferDescriptor());
1614 if (instance) {
1615 bool r = instance->EvalPatchesFaceVarying(
1616 srcBuffer, srcDesc,
1617 dstBuffer, dstDesc,
1618 numPatchCoords, patchCoords,
1619 patchTable, fvarChannel);
1620 delete instance;
1621 return r;
1622 }
1623 return false;
1624 }
1625 }
1626
1653 template <typename SRC_BUFFER, typename DST_BUFFER,
1654 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1655 bool EvalPatchesFaceVarying(
1656 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1657 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1658 int numPatchCoords,
1659 PATCHCOORD_BUFFER *patchCoords,
1660 PATCH_TABLE *patchTable,
1661 int fvarChannel = 0) const {
1662
1663 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
1664 dstBuffer->BindVBO(), dstDesc,
1665 0, BufferDescriptor(),
1666 0, BufferDescriptor(),
1667 numPatchCoords,
1668 patchCoords->BindVBO(),
1669 patchTable->GetFVarPatchArrays(fvarChannel),
1670 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
1671 patchTable->GetFVarPatchParamBuffer(fvarChannel));
1672 }
1673
1720 template <typename SRC_BUFFER, typename DST_BUFFER,
1721 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1722 static bool EvalPatchesFaceVarying(
1723 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1724 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1725 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1726 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1727 int numPatchCoords,
1728 PATCHCOORD_BUFFER *patchCoords,
1729 PATCH_TABLE *patchTable,
1730 int fvarChannel,
1731 GLComputeEvaluator const *instance,
1732 void * deviceContext = NULL) {
1733
1734 if (instance) {
1735 return instance->EvalPatchesFaceVarying(
1736 srcBuffer, srcDesc,
1737 dstBuffer, dstDesc,
1738 duBuffer, duDesc,
1739 dvBuffer, dvDesc,
1740 numPatchCoords, patchCoords,
1741 patchTable, fvarChannel);
1742 } else {
1743 // Create an instance on demand (slow)
1744 (void)deviceContext; // unused
1745 instance = Create(srcDesc, dstDesc,
1746 duDesc, dvDesc);
1747 if (instance) {
1748 bool r = instance->EvalPatchesFaceVarying(
1749 srcBuffer, srcDesc,
1750 dstBuffer, dstDesc,
1751 duBuffer, duDesc,
1752 dvBuffer, dvDesc,
1753 numPatchCoords, patchCoords,
1754 patchTable, fvarChannel);
1755 delete instance;
1756 return r;
1757 }
1758 return false;
1759 }
1760 }
1761
1800 template <typename SRC_BUFFER, typename DST_BUFFER,
1801 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1802 bool EvalPatchesFaceVarying(
1803 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1804 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1805 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1806 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1807 int numPatchCoords,
1808 PATCHCOORD_BUFFER *patchCoords,
1809 PATCH_TABLE *patchTable,
1810 int fvarChannel = 0) const {
1811
1812 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
1813 dstBuffer->BindVBO(), dstDesc,
1814 duBuffer->BindVBO(), duDesc,
1815 dvBuffer->BindVBO(), dvDesc,
1816 numPatchCoords,
1817 patchCoords->BindVBO(),
1818 patchTable->GetFVarPatchArrays(fvarChannel),
1819 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
1820 patchTable->GetFVarPatchParamBuffer(fvarChannel));
1821 }
1822
1887 template <typename SRC_BUFFER, typename DST_BUFFER,
1888 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1889 static bool EvalPatchesFaceVarying(
1890 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1891 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1892 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1893 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1894 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
1895 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
1896 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
1897 int numPatchCoords,
1898 PATCHCOORD_BUFFER *patchCoords,
1899 PATCH_TABLE *patchTable,
1900 int fvarChannel,
1901 GLComputeEvaluator const *instance,
1902 void * deviceContext = NULL) {
1903
1904 if (instance) {
1905 return instance->EvalPatchesFaceVarying(
1906 srcBuffer, srcDesc,
1907 dstBuffer, dstDesc,
1908 duBuffer, duDesc,
1909 dvBuffer, dvDesc,
1910 duuBuffer, duuDesc,
1911 duvBuffer, duvDesc,
1912 dvvBuffer, dvvDesc,
1913 numPatchCoords, patchCoords,
1914 patchTable, fvarChannel);
1915 } else {
1916 // Create an instance on demand (slow)
1917 (void)deviceContext; // unused
1918 instance = Create(srcDesc, dstDesc,
1919 duDesc, dvDesc,
1920 duuDesc, duvDesc, dvvDesc);
1921 if (instance) {
1922 bool r = instance->EvalPatchesFaceVarying(
1923 srcBuffer, srcDesc,
1924 dstBuffer, dstDesc,
1925 duBuffer, duDesc,
1926 dvBuffer, dvDesc,
1927 duuBuffer, duuDesc,
1928 duvBuffer, duvDesc,
1929 dvvBuffer, dvvDesc,
1930 numPatchCoords, patchCoords,
1931 patchTable, fvarChannel);
1932 delete instance;
1933 return r;
1934 }
1935 return false;
1936 }
1937 }
1938
1995 template <typename SRC_BUFFER, typename DST_BUFFER,
1996 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1997 bool EvalPatchesFaceVarying(
1998 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1999 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
2000 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
2001 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
2002 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
2003 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
2004 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
2005 int numPatchCoords,
2006 PATCHCOORD_BUFFER *patchCoords,
2007 PATCH_TABLE *patchTable,
2008 int fvarChannel = 0) const {
2009
2010 return EvalPatches(srcBuffer->BindVBO(), srcDesc,
2011 dstBuffer->BindVBO(), dstDesc,
2012 duBuffer->BindVBO(), duDesc,
2013 dvBuffer->BindVBO(), dvDesc,
2014 duuBuffer->BindVBO(), duuDesc,
2015 duvBuffer->BindVBO(), duvDesc,
2016 dvvBuffer->BindVBO(), dvvDesc,
2017 numPatchCoords,
2018 patchCoords->BindVBO(),
2019 patchTable->GetFVarPatchArrays(fvarChannel),
2020 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
2021 patchTable->GetFVarPatchParamBuffer(fvarChannel));
2022 }
2023
2029
2032 bool Compile(BufferDescriptor const &srcDesc,
2033 BufferDescriptor const &dstDesc,
2034 BufferDescriptor const &duDesc = BufferDescriptor(),
2035 BufferDescriptor const &dvDesc = BufferDescriptor(),
2036 BufferDescriptor const &duuDesc = BufferDescriptor(),
2037 BufferDescriptor const &duvDesc = BufferDescriptor(),
2038 BufferDescriptor const &dvvDesc = BufferDescriptor());
2039
2041 static void Synchronize(void *deviceContext);
2042
2043private:
2044 struct _StencilKernel {
2045 _StencilKernel();
2046 ~_StencilKernel();
2047 bool Compile(BufferDescriptor const &srcDesc,
2048 BufferDescriptor const &dstDesc,
2049 BufferDescriptor const &duDesc,
2050 BufferDescriptor const &dvDesc,
2051 BufferDescriptor const &duuDesc,
2052 BufferDescriptor const &duvDesc,
2053 BufferDescriptor const &dvvDesc,
2054 int workGroupSize);
2055 ID program;
2056 ID uniformStart;
2057 ID uniformEnd;
2058 ID uniformSrcOffset;
2059 ID uniformDstOffset;
2060 ID uniformDuDesc;
2061 ID uniformDvDesc;
2062 ID uniformDuuDesc;
2063 ID uniformDuvDesc;
2064 ID uniformDvvDesc;
2065 } _stencilKernel;
2066
2067 struct _PatchKernel {
2068 _PatchKernel();
2069 ~_PatchKernel();
2070 bool Compile(BufferDescriptor const &srcDesc,
2071 BufferDescriptor const &dstDesc,
2072 BufferDescriptor const &duDesc,
2073 BufferDescriptor const &dvDesc,
2074 BufferDescriptor const &duuDesc,
2075 BufferDescriptor const &duvDesc,
2076 BufferDescriptor const &dvvDesc,
2077 int workGroupSize);
2078 ID program;
2079 ID uniformSrcOffset;
2080 ID uniformDstOffset;
2081 ID uniformPatchArray;
2082 ID uniformDuDesc;
2083 ID uniformDvDesc;
2084 ID uniformDuuDesc;
2085 ID uniformDuvDesc;
2086 ID uniformDvvDesc;
2087 } _patchKernel;
2088
2089 int _workGroupSize;
2090 ID _patchArraysSSBO;
2091};
2092
2093} // end namespace Osd
2094
2095} // end namespace OPENSUBDIV_VERSION
2096using namespace OPENSUBDIV_VERSION;
2097
2098} // end namespace OpenSubdiv
2099
2100
2101#endif // OPENSUBDIV3_OSD_GL_COMPUTE_EVALUATOR_H
bufferDescriptor.h
OpenSubdiv
Definition limits.h:15
OpenSubdiv::OPENSUBDIV_VERSION
Definition limits.h:16
OpenSubdiv::OPENSUBDIV_VERSION::Far
Definition refinerSurfaceFactory.h:19
OpenSubdiv::OPENSUBDIV_VERSION::Osd
Definition bufferDescriptor.h:17
OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector
std::vector< PatchArray > PatchArrayVector
Definition types.h:115
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable
Container for arrays of parametric patches.
Definition patchTable.h:38
OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable
Stencil table class wrapping the template for compatibility.
Definition stencilTable.h:256
OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable
Limit stencil table class wrapping the template for compatibility.
Definition stencilTable.h:566
OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
Definition bufferDescriptor.h:44
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetSizesBuffer
ID GetSizesBuffer() const
Definition glComputeEvaluator.h:54
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetIndicesBuffer
ID GetIndicesBuffer() const
Definition glComputeEvaluator.h:56
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GLStencilTableSSBO
GLStencilTableSSBO(Far::LimitStencilTable const *limitStencilTable)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDuuWeightsBuffer
ID GetDuuWeightsBuffer() const
Definition glComputeEvaluator.h:60
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetOffsetsBuffer
ID GetOffsetsBuffer() const
Definition glComputeEvaluator.h:55
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::~GLStencilTableSSBO
~GLStencilTableSSBO()
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetNumStencils
int GetNumStencils() const
Definition glComputeEvaluator.h:63
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDuWeightsBuffer
ID GetDuWeightsBuffer() const
Definition glComputeEvaluator.h:58
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GLStencilTableSSBO
GLStencilTableSSBO(Far::StencilTable const *stencilTable)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::Create
static GLStencilTableSSBO * Create(Far::LimitStencilTable const *limitStencilTable, void *deviceContext=NULL)
Definition glComputeEvaluator.h:42
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetWeightsBuffer
ID GetWeightsBuffer() const
Definition glComputeEvaluator.h:57
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDvWeightsBuffer
ID GetDvWeightsBuffer() const
Definition glComputeEvaluator.h:59
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::ID
unsigned int ID
Definition glComputeEvaluator.h:35
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::Create
static GLStencilTableSSBO * Create(Far::StencilTable const *stencilTable, void *deviceContext=NULL)
Definition glComputeEvaluator.h:37
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDuvWeightsBuffer
ID GetDuvWeightsBuffer() const
Definition glComputeEvaluator.h:61
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableSSBO::GetDvvWeightsBuffer
ID GetDvvWeightsBuffer() const
Definition glComputeEvaluator.h:62
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1200
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1722
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
Definition glComputeEvaluator.h:420
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1140
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1592
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
Definition glComputeEvaluator.h:488
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1264
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::~GLComputeEvaluator
~GLComputeEvaluator()
Destructor. note that the GL context must be made current.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition glComputeEvaluator.h:1057
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils
bool EvalStencils(ID srcBuffer, BufferDescriptor const &srcDesc, ID dstBuffer, BufferDescriptor const &dstDesc, ID duBuffer, BufferDescriptor const &duDesc, ID dvBuffer, BufferDescriptor const &dvDesc, ID sizesBuffer, ID offsetsBuffer, ID indicesBuffer, ID weightsBuffer, ID duWeightsBuffer, ID dvWeightsBuffer, int start, int end) const
Dispatch the GLSL compute kernel on GPU asynchronously returns false if the kernel hasn't been compil...
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition glComputeEvaluator.h:222
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition glComputeEvaluator.h:154
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1425
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:755
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1889
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1530
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Instantiatable
bool Instantiatable
Definition glComputeEvaluator.h:83
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1802
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches
bool EvalPatches(ID srcBuffer, BufferDescriptor const &srcDesc, ID dstBuffer, BufferDescriptor const &dstDesc, ID duBuffer, BufferDescriptor const &duDesc, ID dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, ID patchCoordsBuffer, const PatchArrayVector &patchArrays, ID patchIndexBuffer, ID patchParamsBuffer) const
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:929
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches
bool EvalPatches(ID srcBuffer, BufferDescriptor const &srcDesc, ID dstBuffer, BufferDescriptor const &dstDesc, ID duBuffer, BufferDescriptor const &duDesc, ID dvBuffer, BufferDescriptor const &dvDesc, ID duuBuffer, BufferDescriptor const &duuDesc, ID duvBuffer, BufferDescriptor const &duvDesc, ID dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, ID patchCoordsBuffer, const PatchArrayVector &patchArrays, ID patchIndexBuffer, ID patchParamsBuffer) const
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils
bool EvalStencils(ID srcBuffer, BufferDescriptor const &srcDesc, ID dstBuffer, BufferDescriptor const &dstDesc, ID duBuffer, BufferDescriptor const &duDesc, ID dvBuffer, BufferDescriptor const &dvDesc, ID duuBuffer, BufferDescriptor const &duuDesc, ID duvBuffer, BufferDescriptor const &duvDesc, ID dvvBuffer, BufferDescriptor const &dvvDesc, ID sizesBuffer, ID offsetsBuffer, ID indicesBuffer, ID weightsBuffer, ID duWeightsBuffer, ID dvWeightsBuffer, ID duuWeightsBuffer, ID duvWeightsBuffer, ID dvvWeightsBuffer, int start, int end) const
Dispatch the GLSL compute kernel on GPU asynchronously returns false if the kernel hasn't been compil...
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::GLComputeEvaluator
GLComputeEvaluator()
Constructor.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition glComputeEvaluator.h:983
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:677
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
Definition glComputeEvaluator.h:372
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1997
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Create
static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, void *deviceContext=NULL)
Definition glComputeEvaluator.h:85
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalStencils
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition glComputeEvaluator.h:312
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Synchronize
static void Synchronize(void *deviceContext)
Wait the dispatched kernel finishes.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Compile
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const &dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const &dvvDesc=BufferDescriptor())
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesVarying
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1341
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::ID
unsigned int ID
Definition glComputeEvaluator.h:82
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::Create
static GLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, void *deviceContext=NULL)
Definition glComputeEvaluator.h:97
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatchesFaceVarying
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:1655
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLComputeEvaluator::EvalPatches
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLComputeEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glComputeEvaluator.h:856
types.h