25 #ifndef OPENSUBDIV3_OSD_TBB_EVALUATOR_H
26 #define OPENSUBDIV3_OSD_TBB_EVALUATOR_H
28 #include "../version.h"
29 #include "../osd/types.h"
30 #include "../osd/bufferDescriptor.h"
31 #include "../far/patchTable.h"
36 namespace OPENSUBDIV_VERSION {
72 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
76 STENCIL_TABLE
const *stencilTable,
78 void *deviceContext = NULL) {
84 dstBuffer->BindCpuBuffer(), dstDesc,
85 &stencilTable->GetSizes()[0],
86 &stencilTable->GetOffsets()[0],
87 &stencilTable->GetControlIndices()[0],
88 &stencilTable->GetWeights()[0],
90 stencilTable->GetNumStencils());
126 const float *weights,
166 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
172 STENCIL_TABLE
const *stencilTable,
174 void * deviceContext = NULL) {
179 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
180 dstBuffer->BindCpuBuffer(), dstDesc,
181 duBuffer->BindCpuBuffer(), duDesc,
182 dvBuffer->BindCpuBuffer(), dvDesc,
183 &stencilTable->GetSizes()[0],
184 &stencilTable->GetOffsets()[0],
185 &stencilTable->GetControlIndices()[0],
186 &stencilTable->GetWeights()[0],
187 &stencilTable->GetDuWeights()[0],
188 &stencilTable->GetDvWeights()[0],
190 stencilTable->GetNumStencils());
242 const float * weights,
243 const float * duWeights,
244 const float * dvWeights,
279 template <
typename SRC_BUFFER,
typename DST_BUFFER,
280 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
285 PATCHCOORD_BUFFER *patchCoords,
286 PATCH_TABLE *patchTable,
288 void * deviceContext = NULL) {
295 dstBuffer->BindCpuBuffer(),
298 (
const PatchCoord*)patchCoords->BindCpuBuffer(),
299 patchTable->GetPatchArrayBuffer(),
300 patchTable->GetPatchIndexBuffer(),
301 patchTable->GetPatchParamBuffer());
342 template <
typename SRC_BUFFER,
typename DST_BUFFER,
343 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
350 PATCHCOORD_BUFFER *patchCoords,
351 PATCH_TABLE *patchTable,
353 void * deviceContext = NULL) {
359 srcBuffer->BindCpuBuffer(), srcDesc,
360 dstBuffer->BindCpuBuffer(), dstDesc,
361 duBuffer->BindCpuBuffer(), duDesc,
362 dvBuffer->BindCpuBuffer(), dvDesc,
364 (
const PatchCoord*)patchCoords->BindCpuBuffer(),
365 patchTable->GetPatchArrayBuffer(),
366 patchTable->GetPatchIndexBuffer(),
367 patchTable->GetPatchParamBuffer());
403 const int *patchIndexBuffer,
451 const int *patchIndexBuffer,
461 static void Synchronize(
void *deviceContext = NULL);
475 using namespace OPENSUBDIV_VERSION;
480 #endif // OPENSUBDIV3_OSD_TBB_EVALUATOR_H
static void SetNumThreads(int numThreads)
initialize tbb task schedular (optional: client may use tbb::task_scheduler_init) ...
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers. Almost all Osd Evaluator APIs take BufferDescriptors along with device-specific buffer objects.
Coordinates set on a patch table.
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function. This function has a same signature as other device kernels hav...
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, TbbEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function with derivatives. This function has a same signature as other device kern...
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, const TbbEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
static void Synchronize(void *deviceContext=NULL)
synchronize all asynchronous computation invoked on this device.