OpenSubdiv: opensubdiv/osd/clEvaluator.h Source File

| OpenSubdiv

Loading...
Searching...
No Matches
clEvaluator.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_CL_EVALUATOR_H
9#define OPENSUBDIV3_OSD_CL_EVALUATOR_H
10
11#include "../version.h"
12
13#include "../osd/opencl.h"
14#include "../osd/types.h"
15#include "../osd/bufferDescriptor.h"
16
17namespace OpenSubdiv {
18namespace OPENSUBDIV_VERSION {
19
20namespace Far {
21 class PatchTable;
22 class StencilTable;
23 class LimitStencilTable;
24}
25
26namespace Osd {
27
35 class CLStencilTable {
36public:
37 template <typename DEVICE_CONTEXT>
38 static CLStencilTable *Create(Far::StencilTable const *stencilTable,
39 DEVICE_CONTEXT context) {
40 return new CLStencilTable(stencilTable, context->GetContext());
41 }
42
43 template <typename DEVICE_CONTEXT>
44 static CLStencilTable *Create(
45 Far::LimitStencilTable const *limitStencilTable,
46 DEVICE_CONTEXT context) {
47 return new CLStencilTable(limitStencilTable, context->GetContext());
48 }
49
50 CLStencilTable(Far::StencilTable const *stencilTable,
51 cl_context clContext);
52 CLStencilTable(Far::LimitStencilTable const *limitStencilTable,
53 cl_context clContext);
54 ~CLStencilTable();
55
56 // interfaces needed for CLComputeKernel
57 cl_mem GetSizesBuffer() const { return _sizes; }
58 cl_mem GetOffsetsBuffer() const { return _offsets; }
59 cl_mem GetIndicesBuffer() const { return _indices; }
60 cl_mem GetWeightsBuffer() const { return _weights; }
61 cl_mem GetDuWeightsBuffer() const { return _duWeights; }
62 cl_mem GetDvWeightsBuffer() const { return _dvWeights; }
63 cl_mem GetDuuWeightsBuffer() const { return _duuWeights; }
64 cl_mem GetDuvWeightsBuffer() const { return _duvWeights; }
65 cl_mem GetDvvWeightsBuffer() const { return _dvvWeights; }
66 int GetNumStencils() const { return _numStencils; }
67
68private:
69 cl_mem _sizes;
70 cl_mem _offsets;
71 cl_mem _indices;
72 cl_mem _weights;
73 cl_mem _duWeights;
74 cl_mem _dvWeights;
75 cl_mem _duuWeights;
76 cl_mem _duvWeights;
77 cl_mem _dvvWeights;
78 int _numStencils;
79};
80
81// ---------------------------------------------------------------------------
82
83 class CLEvaluator {
84public:
85 using Instantiatable = bool; // Enable compiled kernel evaluator cache
86
88 template <typename DEVICE_CONTEXT>
89 static CLEvaluator *Create(BufferDescriptor const &srcDesc,
90 BufferDescriptor const &dstDesc,
91 BufferDescriptor const &duDesc,
92 BufferDescriptor const &dvDesc,
93 DEVICE_CONTEXT deviceContext) {
94 return Create(srcDesc, dstDesc, duDesc, dvDesc,
95 deviceContext->GetContext(),
96 deviceContext->GetCommandQueue());
97 }
98
99 static CLEvaluator * Create(BufferDescriptor const &srcDesc,
100 BufferDescriptor const &dstDesc,
101 BufferDescriptor const &duDesc,
102 BufferDescriptor const &dvDesc,
103 cl_context clContext,
104 cl_command_queue clCommandQueue) {
105 CLEvaluator *instance = new CLEvaluator(clContext, clCommandQueue);
106 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc))
107 return instance;
108 delete instance;
109 return NULL;
110 }
111
113 template <typename DEVICE_CONTEXT>
114 static CLEvaluator *Create(BufferDescriptor const &srcDesc,
115 BufferDescriptor const &dstDesc,
116 BufferDescriptor const &duDesc,
117 BufferDescriptor const &dvDesc,
118 BufferDescriptor const &duuDesc,
119 BufferDescriptor const &duvDesc,
120 BufferDescriptor const &dvvDesc,
121 DEVICE_CONTEXT deviceContext) {
122 return Create(srcDesc, dstDesc, duDesc, dvDesc,
123 duuDesc, duvDesc, dvvDesc,
124 deviceContext->GetContext(),
125 deviceContext->GetCommandQueue());
126 }
127
128 static CLEvaluator * Create(BufferDescriptor const &srcDesc,
129 BufferDescriptor const &dstDesc,
130 BufferDescriptor const &duDesc,
131 BufferDescriptor const &dvDesc,
132 BufferDescriptor const &duuDesc,
133 BufferDescriptor const &duvDesc,
134 BufferDescriptor const &dvvDesc,
135 cl_context clContext,
136 cl_command_queue clCommandQueue) {
137 CLEvaluator *instance = new CLEvaluator(clContext, clCommandQueue);
138 if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc,
139 duuDesc, duvDesc, dvvDesc))
140 return instance;
141 delete instance;
142 return NULL;
143 }
144
146 CLEvaluator(cl_context context, cl_command_queue queue);
147
149 ~CLEvaluator();
150
156
200 template <typename SRC_BUFFER, typename DST_BUFFER,
201 typename STENCIL_TABLE, typename DEVICE_CONTEXT>
202 static bool EvalStencils(
203 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
204 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
205 STENCIL_TABLE const *stencilTable,
206 CLEvaluator const *instance,
207 DEVICE_CONTEXT deviceContext,
208 unsigned int numStartEvents=0,
209 const cl_event* startEvents=NULL,
210 cl_event* endEvent=NULL) {
211
212 if (instance) {
213 return instance->EvalStencils(srcBuffer, srcDesc,
214 dstBuffer, dstDesc,
215 stencilTable,
216 numStartEvents, startEvents, endEvent);
217 } else {
218 // Create an instance on demand (slow)
219 instance = Create(srcDesc, dstDesc,
220 BufferDescriptor(),
221 BufferDescriptor(),
222 deviceContext);
223 if (instance) {
224 bool r = instance->EvalStencils(srcBuffer, srcDesc,
225 dstBuffer, dstDesc,
226 stencilTable,
227 numStartEvents, startEvents, endEvent);
228 delete instance;
229 return r;
230 }
231 return false;
232 }
233 }
234
290 template <typename SRC_BUFFER, typename DST_BUFFER,
291 typename STENCIL_TABLE, typename DEVICE_CONTEXT>
292 static bool EvalStencils(
293 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
294 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
295 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
296 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
297 STENCIL_TABLE const *stencilTable,
298 CLEvaluator const *instance,
299 DEVICE_CONTEXT deviceContext,
300 unsigned int numStartEvents=0,
301 const cl_event* startEvents=NULL,
302 cl_event* endEvent=NULL) {
303
304 if (instance) {
305 return instance->EvalStencils(srcBuffer, srcDesc,
306 dstBuffer, dstDesc,
307 duBuffer, duDesc,
308 dvBuffer, dvDesc,
309 stencilTable,
310 numStartEvents, startEvents, endEvent);
311 } else {
312 // Create an instance on demand (slow)
313 instance = Create(srcDesc, dstDesc, duDesc, dvDesc,
314 deviceContext);
315 if (instance) {
316 bool r = instance->EvalStencils(srcBuffer, srcDesc,
317 dstBuffer, dstDesc,
318 duBuffer, duDesc,
319 dvBuffer, dvDesc,
320 stencilTable,
321 numStartEvents, startEvents, endEvent);
322 delete instance;
323 return r;
324 }
325 return false;
326 }
327 }
328
402 template <typename SRC_BUFFER, typename DST_BUFFER,
403 typename STENCIL_TABLE, typename DEVICE_CONTEXT>
404 static bool EvalStencils(
405 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
406 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
407 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
408 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
409 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
410 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
411 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
412 STENCIL_TABLE const *stencilTable,
413 CLEvaluator const *instance,
414 DEVICE_CONTEXT deviceContext,
415 unsigned int numStartEvents=0,
416 const cl_event* startEvents=NULL,
417 cl_event* endEvent=NULL) {
418
419 if (instance) {
420 return instance->EvalStencils(srcBuffer, srcDesc,
421 dstBuffer, dstDesc,
422 duBuffer, duDesc,
423 dvBuffer, dvDesc,
424 duuBuffer, duuDesc,
425 duvBuffer, duvDesc,
426 dvvBuffer, dvvDesc,
427 stencilTable,
428 numStartEvents, startEvents, endEvent);
429 } else {
430 // Create an instance on demand (slow)
431 instance = Create(srcDesc, dstDesc,
432 duDesc, dvDesc,
433 duuDesc, duvDesc, dvvDesc,
434 deviceContext);
435 if (instance) {
436 bool r = instance->EvalStencils(srcBuffer, srcDesc,
437 dstBuffer, dstDesc,
438 duBuffer, duDesc,
439 dvBuffer, dvDesc,
440 duuBuffer, duuDesc,
441 duvBuffer, duvDesc,
442 dvvBuffer, dvvDesc,
443 stencilTable,
444 numStartEvents, startEvents, endEvent);
445 delete instance;
446 return r;
447 }
448 return false;
449 }
450 }
451
482 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
483 bool EvalStencils(
484 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
485 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
486 STENCIL_TABLE const *stencilTable,
487 unsigned int numStartEvents=0,
488 const cl_event* startEvents=NULL,
489 cl_event* endEvent=NULL) const {
490 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
491 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
492 stencilTable->GetSizesBuffer(),
493 stencilTable->GetOffsetsBuffer(),
494 stencilTable->GetIndicesBuffer(),
495 stencilTable->GetWeightsBuffer(),
496 0,
497 stencilTable->GetNumStencils(),
498 numStartEvents, startEvents, endEvent);
499 }
500
543 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
544 bool EvalStencils(
545 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
546 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
547 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
548 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
549 STENCIL_TABLE const *stencilTable,
550 unsigned int numStartEvents=0,
551 const cl_event* startEvents=NULL,
552 cl_event* endEvent=NULL) const {
553 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
554 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
555 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
556 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
557 stencilTable->GetSizesBuffer(),
558 stencilTable->GetOffsetsBuffer(),
559 stencilTable->GetIndicesBuffer(),
560 stencilTable->GetWeightsBuffer(),
561 stencilTable->GetDuWeightsBuffer(),
562 stencilTable->GetDvWeightsBuffer(),
563 0,
564 stencilTable->GetNumStencils(),
565 numStartEvents, startEvents, endEvent);
566 }
567
628 template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
629 bool EvalStencils(
630 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
631 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
632 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
633 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
634 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
635 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
636 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
637 STENCIL_TABLE const *stencilTable,
638 unsigned int numStartEvents=0,
639 const cl_event* startEvents=NULL,
640 cl_event* endEvent=NULL) const {
641 return EvalStencils(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
642 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
643 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
644 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
645 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
646 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
647 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
648 stencilTable->GetSizesBuffer(),
649 stencilTable->GetOffsetsBuffer(),
650 stencilTable->GetIndicesBuffer(),
651 stencilTable->GetWeightsBuffer(),
652 stencilTable->GetDuWeightsBuffer(),
653 stencilTable->GetDvWeightsBuffer(),
654 stencilTable->GetDuuWeightsBuffer(),
655 stencilTable->GetDuvWeightsBuffer(),
656 stencilTable->GetDvvWeightsBuffer(),
657 0,
658 stencilTable->GetNumStencils(),
659 numStartEvents, startEvents, endEvent);
660 }
661
664 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc,
665 cl_mem dst, BufferDescriptor const &dstDesc,
666 cl_mem sizes,
667 cl_mem offsets,
668 cl_mem indices,
669 cl_mem weights,
670 int start,
671 int end,
672 unsigned int numStartEvents=0,
673 const cl_event* startEvents=NULL,
674 cl_event* endEvent=NULL) const;
675
724 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc,
725 cl_mem dst, BufferDescriptor const &dstDesc,
726 cl_mem du, BufferDescriptor const &duDesc,
727 cl_mem dv, BufferDescriptor const &dvDesc,
728 cl_mem sizes,
729 cl_mem offsets,
730 cl_mem indices,
731 cl_mem weights,
732 cl_mem duWeights,
733 cl_mem dvWeights,
734 int start,
735 int end,
736 unsigned int numStartEvents=0,
737 const cl_event* startEvents=NULL,
738 cl_event* endEvent=NULL) const;
739
806 bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc,
807 cl_mem dst, BufferDescriptor const &dstDesc,
808 cl_mem du, BufferDescriptor const &duDesc,
809 cl_mem dv, BufferDescriptor const &dvDesc,
810 cl_mem duu, BufferDescriptor const &duuDesc,
811 cl_mem duv, BufferDescriptor const &duvDesc,
812 cl_mem dvv, BufferDescriptor const &dvvDesc,
813 cl_mem sizes,
814 cl_mem offsets,
815 cl_mem indices,
816 cl_mem weights,
817 cl_mem duWeights,
818 cl_mem dvWeights,
819 cl_mem duuWeights,
820 cl_mem duvWeights,
821 cl_mem dvvWeights,
822 int start,
823 int end,
824 unsigned int numStartEvents=0,
825 const cl_event* startEvents=NULL,
826 cl_event* endEvent=NULL) const;
827
833
882 template <typename SRC_BUFFER, typename DST_BUFFER,
883 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
884 typename DEVICE_CONTEXT>
885 static bool EvalPatches(
886 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
887 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
888 int numPatchCoords,
889 PATCHCOORD_BUFFER *patchCoords,
890 PATCH_TABLE *patchTable,
891 CLEvaluator const *instance,
892 DEVICE_CONTEXT deviceContext,
893 unsigned int numStartEvents=0,
894 const cl_event* startEvents=NULL,
895 cl_event* endEvent=NULL) {
896
897 if (instance) {
898 return instance->EvalPatches(srcBuffer, srcDesc,
899 dstBuffer, dstDesc,
900 numPatchCoords, patchCoords,
901 patchTable,
902 numStartEvents, startEvents, endEvent);
903 } else {
904 // Create an instance on demand (slow)
905 (void)deviceContext; // unused
906 instance = Create(srcDesc, dstDesc,
907 BufferDescriptor(),
908 BufferDescriptor(),
909 deviceContext);
910 if (instance) {
911 bool r = instance->EvalPatches(srcBuffer, srcDesc,
912 dstBuffer, dstDesc,
913 numPatchCoords, patchCoords,
914 patchTable,
915 numStartEvents, startEvents, endEvent);
916 delete instance;
917 return r;
918 }
919 return false;
920 }
921 }
922
983 template <typename SRC_BUFFER, typename DST_BUFFER,
984 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
985 typename DEVICE_CONTEXT>
986 static bool EvalPatches(
987 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
988 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
989 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
990 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
991 int numPatchCoords,
992 PATCHCOORD_BUFFER *patchCoords,
993 PATCH_TABLE *patchTable,
994 CLEvaluator const *instance,
995 DEVICE_CONTEXT deviceContext,
996 unsigned int numStartEvents=0,
997 const cl_event* startEvents=NULL,
998 cl_event* endEvent=NULL) {
999
1000 if (instance) {
1001 return instance->EvalPatches(srcBuffer, srcDesc,
1002 dstBuffer, dstDesc,
1003 duBuffer, duDesc,
1004 dvBuffer, dvDesc,
1005 numPatchCoords, patchCoords,
1006 patchTable,
1007 numStartEvents, startEvents, endEvent);
1008 } else {
1009 // Create an instance on demand (slow)
1010 (void)deviceContext; // unused
1011 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, deviceContext);
1012 if (instance) {
1013 bool r = instance->EvalPatches(srcBuffer, srcDesc,
1014 dstBuffer, dstDesc,
1015 duBuffer, duDesc,
1016 dvBuffer, dvDesc,
1017 numPatchCoords, patchCoords,
1018 patchTable,
1019 numStartEvents, startEvents, endEvent);
1020 delete instance;
1021 return r;
1022 }
1023 return false;
1024 }
1025 }
1026
1105 template <typename SRC_BUFFER, typename DST_BUFFER,
1106 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
1107 typename DEVICE_CONTEXT>
1108 static bool EvalPatches(
1109 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1110 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1111 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1112 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1113 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
1114 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
1115 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
1116 int numPatchCoords,
1117 PATCHCOORD_BUFFER *patchCoords,
1118 PATCH_TABLE *patchTable,
1119 CLEvaluator const *instance,
1120 DEVICE_CONTEXT deviceContext,
1121 unsigned int numStartEvents=0,
1122 const cl_event* startEvents=NULL,
1123 cl_event* endEvent=NULL) {
1124
1125 if (instance) {
1126 return instance->EvalPatches(srcBuffer, srcDesc,
1127 dstBuffer, dstDesc,
1128 duBuffer, duDesc,
1129 dvBuffer, dvDesc,
1130 duuBuffer, duuDesc,
1131 duvBuffer, duvDesc,
1132 dvvBuffer, dvvDesc,
1133 numPatchCoords, patchCoords,
1134 patchTable,
1135 numStartEvents, startEvents, endEvent);
1136 } else {
1137 // Create an instance on demand (slow)
1138 (void)deviceContext; // unused
1139 instance = Create(srcDesc, dstDesc,
1140 duDesc, dvDesc,
1141 duuDesc, duvDesc, dvvDesc,
1142 deviceContext);
1143 if (instance) {
1144 bool r = instance->EvalPatches(srcBuffer, srcDesc,
1145 dstBuffer, dstDesc,
1146 duBuffer, duDesc,
1147 dvBuffer, dvDesc,
1148 duuBuffer, duuDesc,
1149 duvBuffer, duvDesc,
1150 dvvBuffer, dvvDesc,
1151 numPatchCoords, patchCoords,
1152 patchTable,
1153 numStartEvents, startEvents, endEvent);
1154 delete instance;
1155 return r;
1156 }
1157 return false;
1158 }
1159 }
1160
1198 template <typename SRC_BUFFER, typename DST_BUFFER,
1199 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1200 bool EvalPatches(
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,
1206 unsigned int numStartEvents=0,
1207 const cl_event* startEvents=NULL,
1208 cl_event* endEvent=NULL) const {
1209
1210 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
1211 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
1212 0, BufferDescriptor(),
1213 0, BufferDescriptor(),
1214 numPatchCoords,
1215 patchCoords->BindCLBuffer(_clCommandQueue),
1216 patchTable->GetPatchArrayBuffer(),
1217 patchTable->GetPatchIndexBuffer(),
1218 patchTable->GetPatchParamBuffer(),
1219 numStartEvents, startEvents, endEvent);
1220 }
1221
1269 template <typename SRC_BUFFER, typename DST_BUFFER,
1270 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1271 bool EvalPatches(
1272 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1273 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1274 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1275 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1276 int numPatchCoords,
1277 PATCHCOORD_BUFFER *patchCoords,
1278 PATCH_TABLE *patchTable,
1279 unsigned int numStartEvents=0,
1280 const cl_event* startEvents=NULL,
1281 cl_event* endEvent=NULL) const {
1282
1283 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
1284 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
1285 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
1286 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
1287 numPatchCoords,
1288 patchCoords->BindCLBuffer(_clCommandQueue),
1289 patchTable->GetPatchArrayBuffer(),
1290 patchTable->GetPatchIndexBuffer(),
1291 patchTable->GetPatchParamBuffer(),
1292 numStartEvents, startEvents, endEvent);
1293 }
1294
1360 template <typename SRC_BUFFER, typename DST_BUFFER,
1361 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1362 bool EvalPatches(
1363 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1364 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1365 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1366 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1367 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
1368 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
1369 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
1370 int numPatchCoords,
1371 PATCHCOORD_BUFFER *patchCoords,
1372 PATCH_TABLE *patchTable,
1373 unsigned int numStartEvents=0,
1374 const cl_event* startEvents=NULL,
1375 cl_event* endEvent=NULL) const {
1376
1377 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
1378 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
1379 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
1380 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
1381 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
1382 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
1383 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
1384 numPatchCoords,
1385 patchCoords->BindCLBuffer(_clCommandQueue),
1386 patchTable->GetPatchArrayBuffer(),
1387 patchTable->GetPatchIndexBuffer(),
1388 patchTable->GetPatchParamBuffer(),
1389 numStartEvents, startEvents, endEvent);
1390 }
1391
1392 bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc,
1393 cl_mem dst, BufferDescriptor const &dstDesc,
1394 cl_mem du, BufferDescriptor const &duDesc,
1395 cl_mem dv, BufferDescriptor const &dvDesc,
1396 int numPatchCoords,
1397 cl_mem patchCoordsBuffer,
1398 cl_mem patchArrayBuffer,
1399 cl_mem patchIndexBuffer,
1400 cl_mem patchParamsBuffer,
1401 unsigned int numStartEvents=0,
1402 const cl_event* startEvents=NULL,
1403 cl_event* endEvent=NULL) const;
1404
1405 bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc,
1406 cl_mem dst, BufferDescriptor const &dstDesc,
1407 cl_mem du, BufferDescriptor const &duDesc,
1408 cl_mem dv, BufferDescriptor const &dvDesc,
1409 cl_mem duu, BufferDescriptor const &duuDesc,
1410 cl_mem duv, BufferDescriptor const &duvDesc,
1411 cl_mem dvv, BufferDescriptor const &dvvDesc,
1412 int numPatchCoords,
1413 cl_mem patchCoordsBuffer,
1414 cl_mem patchArrayBuffer,
1415 cl_mem patchIndexBuffer,
1416 cl_mem patchParamsBuffer,
1417 unsigned int numStartEvents=0,
1418 const cl_event* startEvents=NULL,
1419 cl_event* endEvent=NULL) const;
1420
1469 template <typename SRC_BUFFER, typename DST_BUFFER,
1470 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
1471 typename DEVICE_CONTEXT>
1472 static bool EvalPatchesVarying(
1473 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1474 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1475 int numPatchCoords,
1476 PATCHCOORD_BUFFER *patchCoords,
1477 PATCH_TABLE *patchTable,
1478 CLEvaluator const *instance,
1479 DEVICE_CONTEXT deviceContext,
1480 unsigned int numStartEvents=0,
1481 const cl_event* startEvents=NULL,
1482 cl_event* endEvent=NULL) {
1483
1484 if (instance) {
1485 return instance->EvalPatchesVarying(
1486 srcBuffer, srcDesc,
1487 dstBuffer, dstDesc,
1488 numPatchCoords, patchCoords,
1489 patchTable,
1490 numStartEvents, startEvents, endEvent);
1491 } else {
1492 // Create an instance on demand (slow)
1493 (void)deviceContext; // unused
1494 instance = Create(srcDesc, dstDesc,
1495 BufferDescriptor(),
1496 BufferDescriptor(),
1497 deviceContext);
1498 if (instance) {
1499 bool r = instance->EvalPatchesVarying(
1500 srcBuffer, srcDesc,
1501 dstBuffer, dstDesc,
1502 numPatchCoords, patchCoords,
1503 patchTable,
1504 numStartEvents, startEvents, endEvent);
1505 delete instance;
1506 return r;
1507 }
1508 return false;
1509 }
1510 }
1511
1549 template <typename SRC_BUFFER, typename DST_BUFFER,
1550 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1551 bool EvalPatchesVarying(
1552 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1553 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1554 int numPatchCoords,
1555 PATCHCOORD_BUFFER *patchCoords,
1556 PATCH_TABLE *patchTable,
1557 unsigned int numStartEvents=0,
1558 const cl_event* startEvents=NULL,
1559 cl_event* endEvent=NULL) const {
1560
1561 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
1562 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
1563 0, BufferDescriptor(),
1564 0, BufferDescriptor(),
1565 numPatchCoords,
1566 patchCoords->BindCLBuffer(_clCommandQueue),
1567 patchTable->GetVaryingPatchArrayBuffer(),
1568 patchTable->GetVaryingPatchIndexBuffer(),
1569 patchTable->GetPatchParamBuffer(),
1570 numStartEvents, startEvents, endEvent);
1571 }
1572
1633 template <typename SRC_BUFFER, typename DST_BUFFER,
1634 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
1635 typename DEVICE_CONTEXT>
1636 static bool EvalPatchesVarying(
1637 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1638 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1639 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1640 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1641 int numPatchCoords,
1642 PATCHCOORD_BUFFER *patchCoords,
1643 PATCH_TABLE *patchTable,
1644 CLEvaluator const *instance,
1645 DEVICE_CONTEXT deviceContext,
1646 unsigned int numStartEvents=0,
1647 const cl_event* startEvents=NULL,
1648 cl_event* endEvent=NULL) {
1649
1650 if (instance) {
1651 return instance->EvalPatchesVarying(
1652 srcBuffer, srcDesc,
1653 dstBuffer, dstDesc,
1654 duBuffer, duDesc,
1655 dvBuffer, dvDesc,
1656 numPatchCoords, patchCoords,
1657 patchTable,
1658 numStartEvents, startEvents, endEvent);
1659 } else {
1660 // Create an instance on demand (slow)
1661 (void)deviceContext; // unused
1662 instance = Create(srcDesc, dstDesc,
1663 duDesc, dvDesc,
1664 deviceContext);
1665 if (instance) {
1666 bool r = instance->EvalPatchesVarying(
1667 srcBuffer, srcDesc,
1668 dstBuffer, dstDesc,
1669 duBuffer, duDesc,
1670 dvBuffer, dvDesc,
1671 numPatchCoords, patchCoords,
1672 patchTable,
1673 numStartEvents, startEvents, endEvent);
1674 delete instance;
1675 return r;
1676 }
1677 return false;
1678 }
1679 }
1680
1730 template <typename SRC_BUFFER, typename DST_BUFFER,
1731 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1732 bool EvalPatchesVarying(
1733 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1734 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1735 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1736 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1737 int numPatchCoords,
1738 PATCHCOORD_BUFFER *patchCoords,
1739 PATCH_TABLE *patchTable,
1740 unsigned int numStartEvents=0,
1741 const cl_event* startEvents=NULL,
1742 cl_event* endEvent=NULL) const {
1743
1744 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
1745 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
1746 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
1747 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
1748 numPatchCoords,
1749 patchCoords->BindCLBuffer(_clCommandQueue),
1750 patchTable->GetVaryingPatchArrayBuffer(),
1751 patchTable->GetVaryingPatchIndexBuffer(),
1752 patchTable->GetPatchParamBuffer(),
1753 numStartEvents, startEvents, endEvent);
1754 }
1755
1834 template <typename SRC_BUFFER, typename DST_BUFFER,
1835 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
1836 typename DEVICE_CONTEXT>
1837 static bool EvalPatchesVarying(
1838 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1839 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1840 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1841 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1842 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
1843 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
1844 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
1845 int numPatchCoords,
1846 PATCHCOORD_BUFFER *patchCoords,
1847 PATCH_TABLE *patchTable,
1848 CLEvaluator const *instance,
1849 DEVICE_CONTEXT deviceContext,
1850 unsigned int numStartEvents=0,
1851 const cl_event* startEvents=NULL,
1852 cl_event* endEvent=NULL) {
1853
1854 if (instance) {
1855 return instance->EvalPatchesVarying(
1856 srcBuffer, srcDesc,
1857 dstBuffer, dstDesc,
1858 duBuffer, duDesc,
1859 dvBuffer, dvDesc,
1860 duuBuffer, duuDesc,
1861 duvBuffer, duvDesc,
1862 dvvBuffer, dvvDesc,
1863 numPatchCoords, patchCoords,
1864 patchTable,
1865 numStartEvents, startEvents, endEvent);
1866 } else {
1867 // Create an instance on demand (slow)
1868 (void)deviceContext; // unused
1869 instance = Create(srcDesc, dstDesc,
1870 duDesc, dvDesc,
1871 duuDesc, duvDesc, dvvDesc,
1872 deviceContext);
1873 if (instance) {
1874 bool r = instance->EvalPatchesVarying(
1875 srcBuffer, srcDesc,
1876 dstBuffer, dstDesc,
1877 duBuffer, duDesc,
1878 dvBuffer, dvDesc,
1879 duuBuffer, duuDesc,
1880 duvBuffer, duvDesc,
1881 dvvBuffer, dvvDesc,
1882 numPatchCoords, patchCoords,
1883 patchTable,
1884 numStartEvents, startEvents, endEvent);
1885 delete instance;
1886 return r;
1887 }
1888 return false;
1889 }
1890 }
1891
1959 template <typename SRC_BUFFER, typename DST_BUFFER,
1960 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
1961 bool EvalPatchesVarying(
1962 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
1963 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
1964 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
1965 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
1966 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
1967 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
1968 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
1969 int numPatchCoords,
1970 PATCHCOORD_BUFFER *patchCoords,
1971 PATCH_TABLE *patchTable,
1972 unsigned int numStartEvents=0,
1973 const cl_event* startEvents=NULL,
1974 cl_event* endEvent=NULL) const {
1975
1976 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
1977 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
1978 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
1979 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
1980 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
1981 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
1982 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
1983 numPatchCoords,
1984 patchCoords->BindCLBuffer(_clCommandQueue),
1985 patchTable->GetVaryingPatchArrayBuffer(),
1986 patchTable->GetVaryingPatchIndexBuffer(),
1987 patchTable->GetPatchParamBuffer(),
1988 numStartEvents, startEvents, endEvent);
1989 }
1990
2041 template <typename SRC_BUFFER, typename DST_BUFFER,
2042 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
2043 typename DEVICE_CONTEXT>
2044 static bool EvalPatchesFaceVarying(
2045 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
2046 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
2047 int numPatchCoords,
2048 PATCHCOORD_BUFFER *patchCoords,
2049 PATCH_TABLE *patchTable,
2050 int fvarChannel,
2051 CLEvaluator const *instance,
2052 DEVICE_CONTEXT deviceContext,
2053 unsigned int numStartEvents=0,
2054 const cl_event* startEvents=NULL,
2055 cl_event* endEvent=NULL) {
2056
2057 if (instance) {
2058 return instance->EvalPatchesFaceVarying(
2059 srcBuffer, srcDesc,
2060 dstBuffer, dstDesc,
2061 numPatchCoords, patchCoords,
2062 patchTable, fvarChannel,
2063 numStartEvents, startEvents, endEvent);
2064 } else {
2065 // Create an instance on demand (slow)
2066 (void)deviceContext; // unused
2067 instance = Create(srcDesc, dstDesc,
2068 BufferDescriptor(),
2069 BufferDescriptor(),
2070 deviceContext);
2071 if (instance) {
2072 bool r = instance->EvalPatchesFaceVarying(
2073 srcBuffer, srcDesc,
2074 dstBuffer, dstDesc,
2075 numPatchCoords, patchCoords,
2076 patchTable, fvarChannel,
2077 numStartEvents, startEvents, endEvent);
2078 delete instance;
2079 return r;
2080 }
2081 return false;
2082 }
2083 }
2084
2124 template <typename SRC_BUFFER, typename DST_BUFFER,
2125 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
2126 bool EvalPatchesFaceVarying(
2127 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
2128 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
2129 int numPatchCoords,
2130 PATCHCOORD_BUFFER *patchCoords,
2131 PATCH_TABLE *patchTable,
2132 int fvarChannel = 0,
2133 unsigned int numStartEvents=0,
2134 const cl_event* startEvents=NULL,
2135 cl_event* endEvent=NULL) const {
2136
2137 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
2138 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
2139 0, BufferDescriptor(),
2140 0, BufferDescriptor(),
2141 numPatchCoords,
2142 patchCoords->BindCLBuffer(_clCommandQueue),
2143 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
2144 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
2145 patchTable->GetFVarPatchParamBuffer(fvarChannel),
2146 numStartEvents, startEvents, endEvent);
2147 }
2148
2211 template <typename SRC_BUFFER, typename DST_BUFFER,
2212 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
2213 typename DEVICE_CONTEXT>
2214 static bool EvalPatchesFaceVarying(
2215 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
2216 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
2217 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
2218 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
2219 int numPatchCoords,
2220 PATCHCOORD_BUFFER *patchCoords,
2221 PATCH_TABLE *patchTable,
2222 int fvarChannel,
2223 CLEvaluator const *instance,
2224 DEVICE_CONTEXT deviceContext,
2225 unsigned int numStartEvents=0,
2226 const cl_event* startEvents=NULL,
2227 cl_event* endEvent=NULL) {
2228
2229 if (instance) {
2230 return instance->EvalPatchesFaceVarying(
2231 srcBuffer, srcDesc,
2232 dstBuffer, dstDesc,
2233 duBuffer, duDesc,
2234 dvBuffer, dvDesc,
2235 numPatchCoords, patchCoords,
2236 patchTable, fvarChannel,
2237 numStartEvents, startEvents, endEvent);
2238 } else {
2239 // Create an instance on demand (slow)
2240 (void)deviceContext; // unused
2241 instance = Create(srcDesc, dstDesc,
2242 duDesc, dvDesc, deviceContext);
2243 if (instance) {
2244 bool r = instance->EvalPatchesFaceVarying(
2245 srcBuffer, srcDesc,
2246 dstBuffer, dstDesc,
2247 duBuffer, duDesc,
2248 dvBuffer, dvDesc,
2249 numPatchCoords, patchCoords,
2250 patchTable, fvarChannel,
2251 numStartEvents, startEvents, endEvent);
2252 delete instance;
2253 return r;
2254 }
2255 return false;
2256 }
2257 }
2258
2310 template <typename SRC_BUFFER, typename DST_BUFFER,
2311 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
2312 bool EvalPatchesFaceVarying(
2313 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
2314 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
2315 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
2316 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
2317 int numPatchCoords,
2318 PATCHCOORD_BUFFER *patchCoords,
2319 PATCH_TABLE *patchTable,
2320 int fvarChannel = 0,
2321 unsigned int numStartEvents=0,
2322 const cl_event* startEvents=NULL,
2323 cl_event* endEvent=NULL) const {
2324
2325 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
2326 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
2327 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
2328 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
2329 numPatchCoords,
2330 patchCoords->BindCLBuffer(_clCommandQueue),
2331 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
2332 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
2333 patchTable->GetFVarPatchParamBuffer(fvarChannel),
2334 numStartEvents, startEvents, endEvent);
2335 }
2336
2417 template <typename SRC_BUFFER, typename DST_BUFFER,
2418 typename PATCHCOORD_BUFFER, typename PATCH_TABLE,
2419 typename DEVICE_CONTEXT>
2420 static bool EvalPatchesFaceVarying(
2421 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
2422 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
2423 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
2424 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
2425 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
2426 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
2427 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
2428 int numPatchCoords,
2429 PATCHCOORD_BUFFER *patchCoords,
2430 PATCH_TABLE *patchTable,
2431 int fvarChannel,
2432 CLEvaluator const *instance,
2433 DEVICE_CONTEXT deviceContext,
2434 unsigned int numStartEvents=0,
2435 const cl_event* startEvents=NULL,
2436 cl_event* endEvent=NULL) {
2437
2438 if (instance) {
2439 return instance->EvalPatchesFaceVarying(
2440 srcBuffer, srcDesc,
2441 dstBuffer, dstDesc,
2442 duBuffer, duDesc,
2443 dvBuffer, dvDesc,
2444 duuBuffer, duuDesc,
2445 duvBuffer, duvDesc,
2446 dvvBuffer, dvvDesc,
2447 numPatchCoords, patchCoords,
2448 patchTable, fvarChannel,
2449 numStartEvents, startEvents, endEvent);
2450 } else {
2451 // Create an instance on demand (slow)
2452 (void)deviceContext; // unused
2453 instance = Create(srcDesc, dstDesc,
2454 duDesc, dvDesc,
2455 duuDesc, duvDesc, dvvDesc,
2456 deviceContext);
2457 if (instance) {
2458 bool r = instance->EvalPatchesFaceVarying(
2459 srcBuffer, srcDesc,
2460 dstBuffer, dstDesc,
2461 duBuffer, duDesc,
2462 dvBuffer, dvDesc,
2463 duuBuffer, duuDesc,
2464 duvBuffer, duvDesc,
2465 dvvBuffer, dvvDesc,
2466 numPatchCoords, patchCoords,
2467 patchTable, fvarChannel,
2468 numStartEvents, startEvents, endEvent);
2469 delete instance;
2470 return r;
2471 }
2472 return false;
2473 }
2474 }
2475
2545 template <typename SRC_BUFFER, typename DST_BUFFER,
2546 typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
2547 bool EvalPatchesFaceVarying(
2548 SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
2549 DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
2550 DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
2551 DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
2552 DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
2553 DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
2554 DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
2555 int numPatchCoords,
2556 PATCHCOORD_BUFFER *patchCoords,
2557 PATCH_TABLE *patchTable,
2558 int fvarChannel = 0,
2559 unsigned int numStartEvents=0,
2560 const cl_event* startEvents=NULL,
2561 cl_event* endEvent=NULL) const {
2562
2563 return EvalPatches(srcBuffer->BindCLBuffer(_clCommandQueue), srcDesc,
2564 dstBuffer->BindCLBuffer(_clCommandQueue), dstDesc,
2565 duBuffer->BindCLBuffer(_clCommandQueue), duDesc,
2566 dvBuffer->BindCLBuffer(_clCommandQueue), dvDesc,
2567 duuBuffer->BindCLBuffer(_clCommandQueue), duuDesc,
2568 duvBuffer->BindCLBuffer(_clCommandQueue), duvDesc,
2569 dvvBuffer->BindCLBuffer(_clCommandQueue), dvvDesc,
2570 numPatchCoords,
2571 patchCoords->BindCLBuffer(_clCommandQueue),
2572 patchTable->GetFVarPatchArrayBuffer(fvarChannel),
2573 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
2574 patchTable->GetFVarPatchParamBuffer(fvarChannel),
2575 numStartEvents, startEvents, endEvent);
2576 }
2577
2583
2586 bool Compile(BufferDescriptor const &srcDesc,
2587 BufferDescriptor const &dstDesc,
2588 BufferDescriptor const &duDesc = BufferDescriptor(),
2589 BufferDescriptor const &dvDesc = BufferDescriptor(),
2590 BufferDescriptor const &duuDesc = BufferDescriptor(),
2591 BufferDescriptor const &duvDesc = BufferDescriptor(),
2592 BufferDescriptor const &dvvDesc = BufferDescriptor());
2593
2595 template <typename DEVICE_CONTEXT>
2596 static void Synchronize(DEVICE_CONTEXT deviceContext) {
2597 Synchronize(deviceContext->GetCommandQueue());
2598 }
2599
2600 static void Synchronize(cl_command_queue queue);
2601
2602private:
2603 cl_context _clContext;
2604 cl_command_queue _clCommandQueue;
2605 cl_program _program;
2606 cl_kernel _stencilKernel;
2607 cl_kernel _stencilDerivKernel;
2608 cl_kernel _patchKernel;
2609};
2610
2611} // end namespace Osd
2612
2613} // end namespace OPENSUBDIV_VERSION
2614using namespace OPENSUBDIV_VERSION;
2615
2616} // end namespace OpenSubdiv
2617
2618
2619#endif // OPENSUBDIV3_OSD_CL_EVALUATOR_H
opencl.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::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::CLStencilTable::GetDvvWeightsBuffer
cl_mem GetDvvWeightsBuffer() const
Definition clEvaluator.h:65
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::CLStencilTable
CLStencilTable(Far::StencilTable const *stencilTable, cl_context clContext)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetOffsetsBuffer
cl_mem GetOffsetsBuffer() const
Definition clEvaluator.h:58
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::Create
static CLStencilTable * Create(Far::LimitStencilTable const *limitStencilTable, DEVICE_CONTEXT context)
Definition clEvaluator.h:44
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetIndicesBuffer
cl_mem GetIndicesBuffer() const
Definition clEvaluator.h:59
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetNumStencils
int GetNumStencils() const
Definition clEvaluator.h:66
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetSizesBuffer
cl_mem GetSizesBuffer() const
Definition clEvaluator.h:57
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDuuWeightsBuffer
cl_mem GetDuuWeightsBuffer() const
Definition clEvaluator.h:63
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDvWeightsBuffer
cl_mem GetDvWeightsBuffer() const
Definition clEvaluator.h:62
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDuvWeightsBuffer
cl_mem GetDuvWeightsBuffer() const
Definition clEvaluator.h:64
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetDuWeightsBuffer
cl_mem GetDuWeightsBuffer() const
Definition clEvaluator.h:61
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::~CLStencilTable
~CLStencilTable()
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::Create
static CLStencilTable * Create(Far::StencilTable const *stencilTable, DEVICE_CONTEXT context)
Definition clEvaluator.h:38
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::CLStencilTable
CLStencilTable(Far::LimitStencilTable const *limitStencilTable, cl_context clContext)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLStencilTable::GetWeightsBuffer
cl_mem GetWeightsBuffer() const
Definition clEvaluator.h:60
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition clEvaluator.h:292
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Synchronize
static void Synchronize(cl_command_queue queue)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::~CLEvaluator
~CLEvaluator()
Destructor.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils
bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, cl_mem weights, cl_mem duWeights, cl_mem dvWeights, int start, int end, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Dispatch the CL compute kernel asynchronously. returns false if the kernel hasn't been compiled yet.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition clEvaluator.h:202
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, cl_context clContext, cl_command_queue clCommandQueue)
Definition clEvaluator.h:99
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:2214
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches
bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, int numPatchCoords, cl_mem patchCoordsBuffer, cl_mem patchArrayBuffer, cl_mem patchIndexBuffer, cl_mem patchParamsBuffer, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:1961
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic stencil function.
Definition clEvaluator.h:544
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition clEvaluator.h:1362
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
Definition clEvaluator.h:89
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:2044
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
Definition clEvaluator.h:114
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches
bool EvalPatches(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, cl_mem duu, BufferDescriptor const &duuDesc, cl_mem duv, BufferDescriptor const &duvDesc, cl_mem dvv, BufferDescriptor const &dvvDesc, int numPatchCoords, cl_mem patchCoordsBuffer, cl_mem patchArrayBuffer, cl_mem patchIndexBuffer, cl_mem patchParamsBuffer, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils
bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem du, BufferDescriptor const &duDesc, cl_mem dv, BufferDescriptor const &dvDesc, cl_mem duu, BufferDescriptor const &duuDesc, cl_mem duv, BufferDescriptor const &duvDesc, cl_mem dvv, BufferDescriptor const &dvvDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, cl_mem weights, cl_mem duWeights, cl_mem dvWeights, cl_mem duuWeights, cl_mem duvWeights, cl_mem dvvWeights, int start, int end, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Dispatch the CL compute kernel asynchronously. returns false if the kernel hasn't been compiled yet.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:2547
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:1200
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic stencil function.
Definition clEvaluator.h:629
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:1636
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Synchronize
static void Synchronize(DEVICE_CONTEXT deviceContext)
Wait the OpenCL kernels finish.
Definition clEvaluator.h:2596
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:1108
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition clEvaluator.h:404
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils
bool EvalStencils(cl_mem src, BufferDescriptor const &srcDesc, cl_mem dst, BufferDescriptor const &dstDesc, cl_mem sizes, cl_mem offsets, cl_mem indices, cl_mem weights, int start, int end, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Instantiatable
bool Instantiatable
Definition clEvaluator.h:85
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:1472
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:2312
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:2420
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::Create
static CLEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, cl_context clContext, cl_command_queue clCommandQueue)
Definition clEvaluator.h:128
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:986
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:1732
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatches
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:885
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalPatchesVarying
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:1551
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, CLEvaluator const *instance, DEVICE_CONTEXT deviceContext, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:1837
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::EvalStencils
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic stencil function.
Definition clEvaluator.h:483
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition clEvaluator.h:1271
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::CLEvaluator
CLEvaluator(cl_context context, cl_command_queue queue)
Constructor.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::CLEvaluator::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::CLEvaluator::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, unsigned int numStartEvents=0, const cl_event *startEvents=NULL, cl_event *endEvent=NULL) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition clEvaluator.h:2126
types.h