25 #ifndef OPENSUBDIV3_OSD_CPU_EVALUATOR_H
26 #define OPENSUBDIV3_OSD_CPU_EVALUATOR_H
28 #include "../version.h"
32 #include "../osd/bufferDescriptor.h"
33 #include "../osd/types.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) {
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());
244 const float * weights,
245 const float * duWeights,
246 const float * dvWeights,
283 template <
typename SRC_BUFFER,
typename DST_BUFFER,
284 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
289 PATCHCOORD_BUFFER *patchCoords,
290 PATCH_TABLE *patchTable,
292 void * deviceContext = NULL) {
297 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
298 dstBuffer->BindCpuBuffer(), dstDesc,
300 (
const PatchCoord*)patchCoords->BindCpuBuffer(),
301 patchTable->GetPatchArrayBuffer(),
302 patchTable->GetPatchIndexBuffer(),
303 patchTable->GetPatchParamBuffer());
346 template <
typename SRC_BUFFER,
typename DST_BUFFER,
347 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
354 PATCHCOORD_BUFFER *patchCoords,
355 PATCH_TABLE *patchTable,
357 void * deviceContext = NULL) {
366 return EvalPatches(srcBuffer->BindCpuBuffer(), srcDesc,
367 dstBuffer->BindCpuBuffer(), dstDesc,
368 duBuffer->BindCpuBuffer(), duDesc,
369 dvBuffer->BindCpuBuffer(), dvDesc,
371 (
const PatchCoord*)patchCoords->BindCpuBuffer(),
372 patchTable->GetPatchArrayBuffer(),
373 patchTable->GetPatchIndexBuffer(),
374 patchTable->GetPatchParamBuffer());
410 const int *patchIndexBuffer,
458 const int *patchIndexBuffer,
477 using namespace OPENSUBDIV_VERSION;
482 #endif // OPENSUBDIV3_OSD_CPU_EVALUATOR_H
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 void Synchronize(void *)
synchronize all asynchronous computation invoked on this device.
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 CpuEvaluator *instance=NULL, void *deviceContext=NULL)
Generic static eval stencils function with derivatives. This function has a same signature as other d...
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, CpuEvaluator 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, STENCIL_TABLE const *stencilTable, const CpuEvaluator *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, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, CpuEvaluator const *instance=NULL, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...