Loading...
Searching...
No Matches
mtlComputeEvaluator.h
Go to the documentation of this file.
//
// Copyright 2013 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H
#define OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H
#include "../version.h"
#include "../osd/types.h"
#include "../osd/bufferDescriptor.h"
#include "../osd/mtlCommon.h"
@protocol MTLDevice;
@protocol MTLBuffer;
@protocol MTLLibrary;
@protocol MTLComputePipelineState;
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
namespace Far {
class PatchTable;
class StencilTable;
class LimitStencilTable;
}
namespace Osd {
class MTLStencilTable
{
public:
template<typename STENCIL_TABLE, typename DEVICE_CONTEXT>
static MTLStencilTable* Create(STENCIL_TABLE* stencilTable,
DEVICE_CONTEXT context)
{
return new MTLStencilTable(stencilTable, context);
}
MTLStencilTable(Far::StencilTable const* stencilTable, MTLContext* context);
MTLStencilTable(Far::LimitStencilTable const* stencilTable, MTLContext* context);
~MTLStencilTable();
id<MTLBuffer> GetSizesBuffer() const { return _sizesBuffer; }
id<MTLBuffer> GetOffsetsBuffer() const { return _offsetsBuffer; }
id<MTLBuffer> GetIndicesBuffer() const { return _indicesBuffer; }
id<MTLBuffer> GetWeightsBuffer() const { return _weightsBuffer; }
id<MTLBuffer> GetDuWeightsBuffer() const { return _duWeightsBuffer; }
id<MTLBuffer> GetDvWeightsBuffer() const { return _dvWeightsBuffer; }
id<MTLBuffer> GetDuuWeightsBuffer() const { return _duuWeightsBuffer; }
id<MTLBuffer> GetDuvWeightsBuffer() const { return _duvWeightsBuffer; }
id<MTLBuffer> GetDvvWeightsBuffer() const { return _dvvWeightsBuffer; }
int GetNumStencils() const { return _numStencils; }
private:
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 _numStencils;
};
class MTLComputeEvaluator
{
public:
typedef bool Instantiatable;
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);
MTLComputeEvaluator();
~MTLComputeEvaluator();
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
static bool EvalStencils(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
STENCIL_TABLE const *stencilTable,
MTLComputeEvaluator const *instance,
MTLContext* context)
{
if (instance) {
return instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
stencilTable,
context);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc,
BufferDescriptor(),
BufferDescriptor(),
context);
if (instance) {
bool r = instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
stencilTable,
context);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
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) {
if (instance) {
return instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
stencilTable,
context);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc, duDesc, dvDesc, context);
if (instance) {
bool r = instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
stencilTable,
context);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
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) {
if (instance) {
return instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
stencilTable,
context);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc, duDesc, dvDesc,
duuDesc, duvDesc, dvvDesc, context);
if (instance) {
bool r = instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
stencilTable,
context);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
bool EvalStencils(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
STENCIL_TABLE const *stencilTable,
MTLContext* context) const
{
return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
dstBuffer->BindMTLBuffer(context), dstDesc,
0, BufferDescriptor(),
0, BufferDescriptor(),
stencilTable->GetSizesBuffer(),
stencilTable->GetOffsetsBuffer(),
stencilTable->GetIndicesBuffer(),
stencilTable->GetWeightsBuffer(),
0,
0,
/* start = */ 0,
/* end = */ stencilTable->GetNumStencils(),
context);
}
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
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
{
return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
dstBuffer->BindMTLBuffer(context), dstDesc,
duBuffer->BindMTLBuffer(context), duDesc,
dvBuffer->BindMTLBuffer(context), dvDesc,
stencilTable->GetSizesBuffer(),
stencilTable->GetOffsetsBuffer(),
stencilTable->GetIndicesBuffer(),
stencilTable->GetWeightsBuffer(),
stencilTable->GetDuWeightsBuffer(),
stencilTable->GetDvWeightsBuffer(),
/* start = */ 0,
/* end = */ stencilTable->GetNumStencils(),
context);
}
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
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
{
return EvalStencils(srcBuffer->BindMTLBuffer(context), srcDesc,
dstBuffer->BindMTLBuffer(context), dstDesc,
duBuffer->BindMTLBuffer(context), duDesc,
dvBuffer->BindMTLBuffer(context), dvDesc,
duuBuffer->BindMTLBuffer(context), duuDesc,
duvBuffer->BindMTLBuffer(context), duvDesc,
dvvBuffer->BindMTLBuffer(context), dvvDesc,
stencilTable->GetSizesBuffer(),
stencilTable->GetOffsetsBuffer(),
stencilTable->GetIndicesBuffer(),
stencilTable->GetWeightsBuffer(),
stencilTable->GetDuWeightsBuffer(),
stencilTable->GetDvWeightsBuffer(),
stencilTable->GetDuuWeightsBuffer(),
stencilTable->GetDuvWeightsBuffer(),
stencilTable->GetDvvWeightsBuffer(),
/* start = */ 0,
/* end = */ stencilTable->GetNumStencils(),
context);
}
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;
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;
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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) {
if (instance) {
return instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable,
context);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc,
BufferDescriptor(),
BufferDescriptor(),
context);
if (instance) {
bool r = instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable,
context);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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) {
if (instance) {
return instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable,
context);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc, context);
if (instance) {
bool r = instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable,
context);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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) {
if (instance) {
return instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable,
context);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc,
duuDesc, duvDesc, dvvDesc, context);
if (instance) {
bool r = instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable,
context);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 {
return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
dstBuffer->BindMTLBuffer(context), dstDesc,
0, BufferDescriptor(),
0, BufferDescriptor(),
numPatchCoords,
patchCoords->BindMTLBuffer(context),
patchTable->GetPatchArrays(),
patchTable->GetPatchIndexBuffer(),
patchTable->GetPatchParamBuffer(),
context);
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 {
return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
dstBuffer->BindMTLBuffer(context), dstDesc,
duBuffer->BindMTLBuffer(context), duDesc,
dvBuffer->BindMTLBuffer(context), dvDesc,
numPatchCoords,
patchCoords->BindMTLBuffer(context),
patchTable->GetPatchArrays(),
patchTable->GetPatchIndexBuffer(),
patchTable->GetPatchParamBuffer(),
context);
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 {
return EvalPatches(srcBuffer->BindMTLBuffer(context), srcDesc,
dstBuffer->BindMTLBuffer(context), dstDesc,
duBuffer->BindMTLBuffer(context), duDesc,
dvBuffer->BindMTLBuffer(context), dvDesc,
duuBuffer->BindMTLBuffer(context), duuDesc,
duvBuffer->BindMTLBuffer(context), duvDesc,
dvvBuffer->BindMTLBuffer(context), dvvDesc,
numPatchCoords,
patchCoords->BindMTLBuffer(context),
patchTable->GetPatchArrays(),
patchTable->GetPatchIndexBuffer(),
patchTable->GetPatchParamBuffer(),
context);
}
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;
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;
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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) {
if (instance) {
return instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable,
deviceContext);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc,
BufferDescriptor(),
BufferDescriptor(),
deviceContext);
if (instance) {
bool r = instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable,
deviceContext);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 {
return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
0, BufferDescriptor(),
0, BufferDescriptor(),
numPatchCoords,
patchCoords->BindMTLBuffer(deviceContext),
patchTable->GetVaryingPatchArrays(),
patchTable->GetVaryingPatchIndexBuffer(),
patchTable->GetPatchParamBuffer(),
deviceContext
);
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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) {
if (instance) {
return instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable,
deviceContext);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc,
deviceContext);
if (instance) {
bool r = instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable,
deviceContext);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 {
return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
duBuffer->BindMTLBuffer(deviceContext), duDesc,
dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
numPatchCoords,
patchCoords->BindMTLBuffer(deviceContext),
patchTable->GetVaryingPatchArrays(),
patchTable->GetVaryingPatchIndexBuffer(),
patchTable->GetPatchParamBuffer(),
deviceContext
);
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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) {
if (instance) {
return instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable,
deviceContext);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc,
duuDesc, duvDesc, dvvDesc,
deviceContext);
if (instance) {
bool r = instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable,
deviceContext);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 {
return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
duBuffer->BindMTLBuffer(deviceContext), duDesc,
dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
duuBuffer->BindMTLBuffer(deviceContext), duuDesc,
duvBuffer->BindMTLBuffer(deviceContext), duvDesc,
dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc,
numPatchCoords,
patchCoords->BindMTLBuffer(deviceContext),
patchTable->GetVaryingPatchArrays(),
patchTable->GetVaryingPatchIndexBuffer(),
patchTable->GetPatchParamBuffer(),
deviceContext
);
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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) {
if (instance) {
return instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable,
fvarChannel,
deviceContext);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc,
BufferDescriptor(),
BufferDescriptor(),
deviceContext);
if (instance) {
bool r = instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable,
fvarChannel,
deviceContext);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 {
return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
0, BufferDescriptor(),
0, BufferDescriptor(),
numPatchCoords,
patchCoords->BindMTLBuffer(deviceContext),
patchTable->GetFVarPatchArrays(fvarChannel),
patchTable->GetFVarPatchIndexBuffer(fvarChannel),
patchTable->GetFVarPatchParamBuffer(fvarChannel),
deviceContext
);
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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) {
if (instance) {
return instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable,
fvarChannel,
deviceContext);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc,
deviceContext);
if (instance) {
bool r = instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable,
fvarChannel,
deviceContext);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 {
return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
duBuffer->BindMTLBuffer(deviceContext), duDesc,
dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
numPatchCoords,
patchCoords->BindMTLBuffer(deviceContext),
patchTable->GetFVarPatchArrays(fvarChannel),
patchTable->GetFVarPatchIndexBuffer(fvarChannel),
patchTable->GetFVarPatchParamBuffer(fvarChannel),
deviceContext
);
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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) {
if (instance) {
return instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable,
fvarChannel,
deviceContext);
} else {
// Create an instance on demand (slow)
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc,
duuDesc, duvDesc, dvvDesc,
deviceContext);
if (instance) {
bool r = instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable,
fvarChannel,
deviceContext);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
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 {
return EvalPatches(srcBuffer->BindMTLBuffer(deviceContext), srcDesc,
dstBuffer->BindMTLBuffer(deviceContext), dstDesc,
duBuffer->BindMTLBuffer(deviceContext), duDesc,
dvBuffer->BindMTLBuffer(deviceContext), dvDesc,
duuBuffer->BindMTLBuffer(deviceContext), duuDesc,
duvBuffer->BindMTLBuffer(deviceContext), duvDesc,
dvvBuffer->BindMTLBuffer(deviceContext), dvvDesc,
numPatchCoords,
patchCoords->BindMTLBuffer(deviceContext),
patchTable->GetFVarPatchArrays(fvarChannel),
patchTable->GetFVarPatchIndexBuffer(fvarChannel),
patchTable->GetFVarPatchParamBuffer(fvarChannel),
fvarChannel,
deviceContext
);
}
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);
static void Synchronize(MTLContext* context);
private:
id<MTLLibrary> _computeLibrary;
id<MTLComputePipelineState> _evalStencils;
id<MTLComputePipelineState> _evalPatches;
id<MTLBuffer> _parameterBuffer;
int _workGroupSize;
};
} //end namespace Osd
} //end namespace OPENSUBDIV_VERSION
using namespace OPENSUBDIV_VERSION;
} //end namespace OpenSubdiv
#endif // OPENSUBDIV3_OSD_MTL_COMPUTE_EVALUATOR_H
mtlCommon.h
bufferDescriptor.h
OpenSubdiv
Definition limits.h:32
OpenSubdiv::OPENSUBDIV_VERSION
Definition limits.h:33
OpenSubdiv::OPENSUBDIV_VERSION::Far
Definition refinerSurfaceFactory.h:36
OpenSubdiv::OPENSUBDIV_VERSION::Osd
Definition bufferDescriptor.h:34
OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector
std::vector< PatchArray > PatchArrayVector
Definition types.h:132
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable
Container for arrays of parametric patches.
Definition patchTable.h:55
OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable
Stencil table class wrapping the template for compatibility.
Definition stencilTable.h:273
OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable
Limit stencil table class wrapping the template for compatibility.
Definition stencilTable.h:583
OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
Definition bufferDescriptor.h:61
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLContext
Definition mtlCommon.h:40
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::MTLStencilTable
MTLStencilTable(Far::LimitStencilTable const *stencilTable, MTLContext *context)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDuWeightsBuffer
id< MTLBuffer > GetDuWeightsBuffer() const
Definition mtlComputeEvaluator.h:69
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::~MTLStencilTable
~MTLStencilTable()
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDvvWeightsBuffer
id< MTLBuffer > GetDvvWeightsBuffer() const
Definition mtlComputeEvaluator.h:73
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::MTLStencilTable
MTLStencilTable(Far::StencilTable const *stencilTable, MTLContext *context)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDuuWeightsBuffer
id< MTLBuffer > GetDuuWeightsBuffer() const
Definition mtlComputeEvaluator.h:71
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDuvWeightsBuffer
id< MTLBuffer > GetDuvWeightsBuffer() const
Definition mtlComputeEvaluator.h:72
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetNumStencils
int GetNumStencils() const
Definition mtlComputeEvaluator.h:75
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetIndicesBuffer
id< MTLBuffer > GetIndicesBuffer() const
Definition mtlComputeEvaluator.h:67
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetSizesBuffer
id< MTLBuffer > GetSizesBuffer() const
Definition mtlComputeEvaluator.h:65
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetOffsetsBuffer
id< MTLBuffer > GetOffsetsBuffer() const
Definition mtlComputeEvaluator.h:66
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetWeightsBuffer
id< MTLBuffer > GetWeightsBuffer() const
Definition mtlComputeEvaluator.h:68
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::Create
static MTLStencilTable * Create(STENCIL_TABLE *stencilTable, DEVICE_CONTEXT context)
Definition mtlComputeEvaluator.h:54
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLStencilTable::GetDvWeightsBuffer
id< MTLBuffer > GetDvWeightsBuffer() const
Definition mtlComputeEvaluator.h:70
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils
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...
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLComputeEvaluator *instance, MTLContext *context)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:786
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLComputeEvaluator const *instance, MTLContext *context)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition mtlComputeEvaluator.h:312
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:1991
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::MTLComputeEvaluator
MTLComputeEvaluator()
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::~MTLComputeEvaluator
~MTLComputeEvaluator()
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches
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 ...
Definition mtlComputeEvaluator.h:705
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Instantiatable
bool Instantiatable
Definition mtlComputeEvaluator.h:94
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:1606
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLComputeEvaluator const *instance, MTLContext *context)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition mtlComputeEvaluator.h:220
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:1900
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:1672
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:1496
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, MTLContext *context) const
Generic stencil function.
Definition mtlComputeEvaluator.h:376
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches
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
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:2106
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Synchronize
static void Synchronize(MTLContext *context)
Wait for the dispatched kernel to finish.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLContext *context) const
Generic stencil function.
Definition mtlComputeEvaluator.h:430
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLComputeEvaluator *instance, MTLContext *context)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:889
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:1742
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying
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 ...
Definition mtlComputeEvaluator.h:1192
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLContext *context) const
Generic stencil function.
Definition mtlComputeEvaluator.h:504
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils
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...
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:1813
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches
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 ...
Definition mtlComputeEvaluator.h:966
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalStencils
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...
Definition mtlComputeEvaluator.h:149
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLComputeEvaluator const *instance, MTLContext *deviceContext)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:1325
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLContext *context) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition mtlComputeEvaluator.h:1104
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLContext *context) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition mtlComputeEvaluator.h:1025
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::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, MTLContext *deviceContext) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition mtlComputeEvaluator.h:1407
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatchesVarying
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 ...
Definition mtlComputeEvaluator.h:1257
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Create
static MTLComputeEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, MTLContext *context)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Create
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)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::Compile
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.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLComputeEvaluator::EvalPatches
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
types.h