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"
35 namespace OpenSubdiv {
36 namespace OPENSUBDIV_VERSION {
72 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
76 STENCIL_TABLE
const *stencilTable,
78 void *deviceContext = NULL) {
83 if (stencilTable->GetNumStencils() == 0)
87 dstBuffer->BindCpuBuffer(), dstDesc,
88 &stencilTable->GetSizes()[0],
89 &stencilTable->GetOffsets()[0],
90 &stencilTable->GetControlIndices()[0],
91 &stencilTable->GetWeights()[0],
93 stencilTable->GetNumStencils());
129 const float *weights,
169 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
175 STENCIL_TABLE
const *stencilTable,
177 void * deviceContext = NULL) {
182 return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
183 dstBuffer->BindCpuBuffer(), dstDesc,
184 duBuffer->BindCpuBuffer(), duDesc,
185 dvBuffer->BindCpuBuffer(), dvDesc,
186 &stencilTable->GetSizes()[0],
187 &stencilTable->GetOffsets()[0],
188 &stencilTable->GetControlIndices()[0],
189 &stencilTable->GetWeights()[0],
190 &stencilTable->GetDuWeights()[0],
191 &stencilTable->GetDvWeights()[0],
193 stencilTable->GetNumStencils());
245 const float * weights,
246 const float * duWeights,
247 const float * dvWeights,
282 template <
typename SRC_BUFFER,
typename DST_BUFFER,
283 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
288 PATCHCOORD_BUFFER *patchCoords,
289 PATCH_TABLE *patchTable,
291 void * deviceContext = NULL) {
298 dstBuffer->BindCpuBuffer(),
301 (
const PatchCoord*)patchCoords->BindCpuBuffer(),
302 patchTable->GetPatchArrayBuffer(),
303 patchTable->GetPatchIndexBuffer(),
304 patchTable->GetPatchParamBuffer());
345 template <
typename SRC_BUFFER,
typename DST_BUFFER,
346 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
353 PATCHCOORD_BUFFER *patchCoords,
354 PATCH_TABLE *patchTable,
356 void * deviceContext = NULL) {
362 srcBuffer->BindCpuBuffer(), srcDesc,
363 dstBuffer->BindCpuBuffer(), dstDesc,
364 duBuffer->BindCpuBuffer(), duDesc,
365 dvBuffer->BindCpuBuffer(), dvDesc,
367 (
const PatchCoord*)patchCoords->BindCpuBuffer(),
368 patchTable->GetPatchArrayBuffer(),
369 patchTable->GetPatchIndexBuffer(),
370 patchTable->GetPatchParamBuffer());
406 const int *patchIndexBuffer,
454 const int *patchIndexBuffer,
464 static void Synchronize(
void *deviceContext = NULL);
478 using namespace OPENSUBDIV_VERSION;
483 #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.