25#ifndef OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H
26#define OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H
28#include "../version.h"
30#include "../osd/types.h"
31#include "../osd/bufferDescriptor.h"
32#include "../osd/mtlCommon.h"
37@protocol MTLComputePipelineState;
40namespace OPENSUBDIV_VERSION {
45 class LimitStencilTable;
53 template<
typename STENCIL_TABLE,
typename DEVICE_CONTEXT>
55 DEVICE_CONTEXT context)
78 id<MTLBuffer> _sizesBuffer;
79 id<MTLBuffer> _offsetsBuffer;
80 id<MTLBuffer> _indicesBuffer;
81 id<MTLBuffer> _weightsBuffer;
82 id<MTLBuffer> _duWeightsBuffer;
83 id<MTLBuffer> _dvWeightsBuffer;
84 id<MTLBuffer> _duuWeightsBuffer;
85 id<MTLBuffer> _duvWeightsBuffer;
86 id<MTLBuffer> _dvvWeightsBuffer;
148 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
152 STENCIL_TABLE
const *stencilTable,
163 instance = Create(srcDesc, dstDesc,
219 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
225 STENCIL_TABLE
const *stencilTable,
238 instance = Create(srcDesc, dstDesc, duDesc, dvDesc, context);
311 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
320 STENCIL_TABLE
const *stencilTable,
336 instance = Create(srcDesc, dstDesc, duDesc, dvDesc,
337 duuDesc, duvDesc, dvvDesc, context);
375 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
379 STENCIL_TABLE
const *stencilTable,
382 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
383 dstBuffer->BindMTLBuffer(context), dstDesc,
386 stencilTable->GetSizesBuffer(),
387 stencilTable->GetOffsetsBuffer(),
388 stencilTable->GetIndicesBuffer(),
389 stencilTable->GetWeightsBuffer(),
393 stencilTable->GetNumStencils(),
429 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
435 STENCIL_TABLE
const *stencilTable,
438 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
439 dstBuffer->BindMTLBuffer(context), dstDesc,
440 duBuffer->BindMTLBuffer(context), duDesc,
441 dvBuffer->BindMTLBuffer(context), dvDesc,
442 stencilTable->GetSizesBuffer(),
443 stencilTable->GetOffsetsBuffer(),
444 stencilTable->GetIndicesBuffer(),
445 stencilTable->GetWeightsBuffer(),
446 stencilTable->GetDuWeightsBuffer(),
447 stencilTable->GetDvWeightsBuffer(),
449 stencilTable->GetNumStencils(),
503 template <
typename SRC_BUFFER,
typename DST_BUFFER,
typename STENCIL_TABLE>
512 STENCIL_TABLE
const *stencilTable,
515 return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
516 dstBuffer->BindMTLBuffer(context), dstDesc,
517 duBuffer->BindMTLBuffer(context), duDesc,
518 dvBuffer->BindMTLBuffer(context), dvDesc,
519 duuBuffer->BindMTLBuffer(context), duuDesc,
520 duvBuffer->BindMTLBuffer(context), duvDesc,
521 dvvBuffer->BindMTLBuffer(context), dvvDesc,
522 stencilTable->GetSizesBuffer(),
523 stencilTable->GetOffsetsBuffer(),
524 stencilTable->GetIndicesBuffer(),
525 stencilTable->GetWeightsBuffer(),
526 stencilTable->GetDuWeightsBuffer(),
527 stencilTable->GetDvWeightsBuffer(),
528 stencilTable->GetDuuWeightsBuffer(),
529 stencilTable->GetDuvWeightsBuffer(),
530 stencilTable->GetDvvWeightsBuffer(),
532 stencilTable->GetNumStencils(),
578 id<MTLBuffer> sizesBuffer,
579 id<MTLBuffer> offsetsBuffer,
580 id<MTLBuffer> indicesBuffer,
581 id<MTLBuffer> weightsBuffer,
582 id<MTLBuffer> duWeightsBuffer,
583 id<MTLBuffer> dvWeightsBuffer,
651 id<MTLBuffer> sizesBuffer,
652 id<MTLBuffer> offsetsBuffer,
653 id<MTLBuffer> indicesBuffer,
654 id<MTLBuffer> weightsBuffer,
655 id<MTLBuffer> duWeightsBuffer,
656 id<MTLBuffer> dvWeightsBuffer,
657 id<MTLBuffer> duuWeightsBuffer,
658 id<MTLBuffer> duvWeightsBuffer,
659 id<MTLBuffer> dvvWeightsBuffer,
703 template <
typename SRC_BUFFER,
typename DST_BUFFER,
704 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
709 PATCHCOORD_BUFFER *patchCoords,
710 PATCH_TABLE *patchTable,
717 numPatchCoords, patchCoords,
722 instance = Create(srcDesc, dstDesc,
729 numPatchCoords, patchCoords,
784 template <
typename SRC_BUFFER,
typename DST_BUFFER,
785 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
792 PATCHCOORD_BUFFER *patchCoords,
793 PATCH_TABLE *patchTable,
802 numPatchCoords, patchCoords,
807 instance = Create(srcDesc, dstDesc,
808 duDesc, dvDesc, context);
814 numPatchCoords, patchCoords,
887 template <
typename SRC_BUFFER,
typename DST_BUFFER,
888 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
898 PATCHCOORD_BUFFER *patchCoords,
899 PATCH_TABLE *patchTable,
911 numPatchCoords, patchCoords,
916 instance = Create(srcDesc, dstDesc,
918 duuDesc, duvDesc, dvvDesc, context);
927 numPatchCoords, patchCoords,
964 template <
typename SRC_BUFFER,
typename DST_BUFFER,
965 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
970 PATCHCOORD_BUFFER *patchCoords,
971 PATCH_TABLE *patchTable,
974 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
975 dstBuffer->BindMTLBuffer(context), dstDesc,
979 patchCoords->BindMTLBuffer(context),
980 patchTable->GetPatchArrays(),
981 patchTable->GetPatchIndexBuffer(),
982 patchTable->GetPatchParamBuffer(),
1023 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1024 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1031 PATCHCOORD_BUFFER *patchCoords,
1032 PATCH_TABLE *patchTable,
1035 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
1036 dstBuffer->BindMTLBuffer(context), dstDesc,
1037 duBuffer->BindMTLBuffer(context), duDesc,
1038 dvBuffer->BindMTLBuffer(context), dvDesc,
1040 patchCoords->BindMTLBuffer(context),
1041 patchTable->GetPatchArrays(),
1042 patchTable->GetPatchIndexBuffer(),
1043 patchTable->GetPatchParamBuffer(),
1102 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1103 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1113 PATCHCOORD_BUFFER *patchCoords,
1114 PATCH_TABLE *patchTable,
1117 return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
1118 dstBuffer->BindMTLBuffer(context), dstDesc,
1119 duBuffer->BindMTLBuffer(context), duDesc,
1120 dvBuffer->BindMTLBuffer(context), dvDesc,
1121 duuBuffer->BindMTLBuffer(context), duuDesc,
1122 duvBuffer->BindMTLBuffer(context), duvDesc,
1123 dvvBuffer->BindMTLBuffer(context), dvvDesc,
1125 patchCoords->BindMTLBuffer(context),
1126 patchTable->GetPatchArrays(),
1127 patchTable->GetPatchIndexBuffer(),
1128 patchTable->GetPatchParamBuffer(),
1137 id<MTLBuffer> patchCoordsBuffer,
1139 id<MTLBuffer> patchIndexBuffer,
1140 id<MTLBuffer> patchParamsBuffer,
1151 id<MTLBuffer> patchCoordsBuffer,
1153 id<MTLBuffer> patchIndexBuffer,
1154 id<MTLBuffer> patchParamsBuffer,
1190 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1191 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1196 PATCHCOORD_BUFFER *patchCoords,
1197 PATCH_TABLE *patchTable,
1205 numPatchCoords, patchCoords,
1210 instance = Create(srcDesc, dstDesc,
1218 numPatchCoords, patchCoords,
1255 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1256 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1261 PATCHCOORD_BUFFER *patchCoords,
1262 PATCH_TABLE *patchTable,
1265 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
1266 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
1270 patchCoords->BindMTLBuffer(deviceContext),
1271 patchTable->GetVaryingPatchArrays(),
1272 patchTable->GetVaryingPatchIndexBuffer(),
1273 patchTable->GetPatchParamBuffer(),
1323 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1324 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1331 PATCHCOORD_BUFFER *patchCoords,
1332 PATCH_TABLE *patchTable,
1342 numPatchCoords, patchCoords,
1347 instance = Create(srcDesc, dstDesc,
1356 numPatchCoords, patchCoords,
1405 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1406 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1413 PATCHCOORD_BUFFER *patchCoords,
1414 PATCH_TABLE *patchTable,
1417 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
1418 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
1419 duBuffer->BindMTLBuffer(deviceContext), duDesc,
1420 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
1422 patchCoords->BindMTLBuffer(deviceContext),
1423 patchTable->GetVaryingPatchArrays(),
1424 patchTable->GetVaryingPatchIndexBuffer(),
1425 patchTable->GetPatchParamBuffer(),
1494 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1495 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1505 PATCHCOORD_BUFFER *patchCoords,
1506 PATCH_TABLE *patchTable,
1519 numPatchCoords, patchCoords,
1524 instance = Create(srcDesc, dstDesc,
1526 duuDesc, duvDesc, dvvDesc,
1537 numPatchCoords, patchCoords,
1604 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1605 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1615 PATCHCOORD_BUFFER *patchCoords,
1616 PATCH_TABLE *patchTable,
1619 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
1620 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
1621 duBuffer->BindMTLBuffer(deviceContext), duDesc,
1622 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
1623 duuBuffer->BindMTLBuffer(deviceContext), duuDesc,
1624 duvBuffer->BindMTLBuffer(deviceContext), duvDesc,
1625 dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc,
1627 patchCoords->BindMTLBuffer(deviceContext),
1628 patchTable->GetVaryingPatchArrays(),
1629 patchTable->GetVaryingPatchIndexBuffer(),
1630 patchTable->GetPatchParamBuffer(),
1670 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1671 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1676 PATCHCOORD_BUFFER *patchCoords,
1677 PATCH_TABLE *patchTable,
1686 numPatchCoords, patchCoords,
1692 instance = Create(srcDesc, dstDesc,
1700 numPatchCoords, patchCoords,
1740 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1741 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1746 PATCHCOORD_BUFFER *patchCoords,
1747 PATCH_TABLE *patchTable,
1751 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
1752 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
1756 patchCoords->BindMTLBuffer(deviceContext),
1757 patchTable->GetFVarPatchArrays(fvarChannel),
1758 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
1759 patchTable->GetFVarPatchParamBuffer(fvarChannel),
1811 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1812 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1819 PATCHCOORD_BUFFER *patchCoords,
1820 PATCH_TABLE *patchTable,
1831 numPatchCoords, patchCoords,
1837 instance = Create(srcDesc, dstDesc,
1846 numPatchCoords, patchCoords,
1898 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1899 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
1906 PATCHCOORD_BUFFER *patchCoords,
1907 PATCH_TABLE *patchTable,
1911 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
1912 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
1913 duBuffer->BindMTLBuffer(deviceContext), duDesc,
1914 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
1916 patchCoords->BindMTLBuffer(deviceContext),
1917 patchTable->GetFVarPatchArrays(fvarChannel),
1918 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
1919 patchTable->GetFVarPatchParamBuffer(fvarChannel),
1989 template <
typename SRC_BUFFER,
typename DST_BUFFER,
1990 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
2000 PATCHCOORD_BUFFER *patchCoords,
2001 PATCH_TABLE *patchTable,
2015 numPatchCoords, patchCoords,
2021 instance = Create(srcDesc, dstDesc,
2023 duuDesc, duvDesc, dvvDesc,
2034 numPatchCoords, patchCoords,
2104 template <
typename SRC_BUFFER,
typename DST_BUFFER,
2105 typename PATCHCOORD_BUFFER,
typename PATCH_TABLE>
2115 PATCHCOORD_BUFFER *patchCoords,
2116 PATCH_TABLE *patchTable,
2120 return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
2121 dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
2122 duBuffer->BindMTLBuffer(deviceContext), duDesc,
2123 dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
2124 duuBuffer->BindMTLBuffer(deviceContext), duuDesc,
2125 duvBuffer->BindMTLBuffer(deviceContext), duvDesc,
2126 dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc,
2128 patchCoords->BindMTLBuffer(deviceContext),
2129 patchTable->GetFVarPatchArrays(fvarChannel),
2130 patchTable->GetFVarPatchIndexBuffer(fvarChannel),
2131 patchTable->GetFVarPatchParamBuffer(fvarChannel),
2152 id<MTLLibrary> _computeLibrary;
2153 id<MTLComputePipelineState> _evalStencils;
2154 id<MTLComputePipelineState> _evalPatches;
2155 id<MTLBuffer> _parameterBuffer;
2163using namespace OPENSUBDIV_VERSION;
std::vector< PatchArray > PatchArrayVector
Stencil table class wrapping the template for compatibility.
Limit stencil table class wrapping the template for compatibility.
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
MTLStencilTable(Far::LimitStencilTable const *stencilTable, MTLContext *context)
id< MTLBuffer > GetDuWeightsBuffer() const
id< MTLBuffer > GetDvvWeightsBuffer() const
MTLStencilTable(Far::StencilTable const *stencilTable, MTLContext *context)
id< MTLBuffer > GetDuuWeightsBuffer() const
id< MTLBuffer > GetDuvWeightsBuffer() const
int GetNumStencils() const
id< MTLBuffer > GetIndicesBuffer() const
id< MTLBuffer > GetSizesBuffer() const
id< MTLBuffer > GetOffsetsBuffer() const
id< MTLBuffer > GetWeightsBuffer() const
static MTLStencilTable * Create(STENCIL_TABLE *stencilTable, DEVICE_CONTEXT context)
id< MTLBuffer > GetDvWeightsBuffer() const
bool EvalStencils(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, id< MTLBuffer > duuBuffer, BufferDescriptor const &duuDesc, id< MTLBuffer > duvBuffer, BufferDescriptor const &duvDesc, id< MTLBuffer > dvvBuffer, BufferDescriptor const &dvvDesc, id< MTLBuffer > sizesBuffer, id< MTLBuffer > offsetsBuffer, id< MTLBuffer > indicesBuffer, id< MTLBuffer > weightsBuffer, id< MTLBuffer > duWeightsBuffer, id< MTLBuffer > dvWeightsBuffer, id< MTLBuffer > duuWeightsBuffer, id< MTLBuffer > duvWeightsBuffer, id< MTLBuffer > dvvWeightsBuffer, int start, int end, MTLContext *context) const
Dispatch the MTL compute kernel on GPU asynchronously returns false if the kernel hasn't been compile...
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, MTLComputeEvaluator *instance, MTLContext *context)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
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, MTLComputeEvaluator const *instance, MTLContext *context)
Generic static stencil function. This function has a same signature as other device kernels have so t...
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, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, MTLContext *context)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
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, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
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, MTLComputeEvaluator const *instance, MTLContext *context)
Generic static stencil function. This function has a same signature as other device kernels have so t...
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, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
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, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
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, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, MTLContext *context) const
Generic stencil function.
bool EvalPatches(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, id< MTLBuffer > duuBuffer, BufferDescriptor const &duuDesc, id< MTLBuffer > duvBuffer, BufferDescriptor const &duvDesc, id< MTLBuffer > dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, id< MTLBuffer > patchCoordsBuffer, const PatchArrayVector &patchArrays, id< MTLBuffer > patchIndexBuffer, id< MTLBuffer > patchParamsBuffer, MTLContext *context) const
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, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
static void Synchronize(MTLContext *context)
Wait for the dispatched kernel to finish.
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, MTLContext *context) const
Generic stencil function.
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, MTLComputeEvaluator *instance, MTLContext *context)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
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, MTLContext *context) const
Generic stencil function.
bool EvalStencils(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, id< MTLBuffer > sizesBuffer, id< MTLBuffer > offsetsBuffer, id< MTLBuffer > indicesBuffer, id< MTLBuffer > weightsBuffer, id< MTLBuffer > duWeightsBuffer, id< MTLBuffer > dvWeightsBuffer, int start, int end, MTLContext *context) const
Dispatch the MTL compute kernel on GPU asynchronously returns false if the kernel hasn't been compile...
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, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *context) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, MTLComputeEvaluator const *instance, MTLContext *context)
Generic static stencil function. This function has a same signature as other device kernels have so t...
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, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
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, MTLContext *context) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
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, MTLContext *context) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
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, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, MTLContext *context)
static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, MTLContext *context)
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, MTLContext *context)
Configure compute pipline state. Returns false if it fails to create the pipeline state.
bool EvalPatches(id< MTLBuffer > srcBuffer, BufferDescriptor const &srcDesc, id< MTLBuffer > dstBuffer, BufferDescriptor const &dstDesc, id< MTLBuffer > duBuffer, BufferDescriptor const &duDesc, id< MTLBuffer > dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, id< MTLBuffer > patchCoordsBuffer, const PatchArrayVector &patchArrays, id< MTLBuffer > patchIndexBuffer, id< MTLBuffer > patchParamsBuffer, MTLContext *context) const