Blender V5.0
blender::opensubdiv::GPUComputeEvaluator Class Reference

#include <gpu_compute_evaluator.h>

Public Types

using Instantiatable = bool

Public Member Functions

 GPUComputeEvaluator ()
 Constructor.
 ~GPUComputeEvaluator ()
 Destructor. note that the GL context must be made current.
template<typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
bool EvalStencils (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable) const
 Generic stencil function.
template<typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
bool EvalStencils (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, OpenSubdiv::Osd::BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable) const
 Generic stencil function.
bool EvalStencils (gpu::VertBuf *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, gpu::VertBuf *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, gpu::VertBuf *duBuffer, OpenSubdiv::Osd::BufferDescriptor const &duDesc, gpu::VertBuf *dvBuffer, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, gpu::StorageBuf *sizesBuffer, gpu::StorageBuf *offsetsBuffer, gpu::StorageBuf *indicesBuffer, gpu::StorageBuf *weightsBuffer, gpu::StorageBuf *duWeightsBuffer, gpu::StorageBuf *dvWeightsBuffer, int start, int end) const
 Dispatch the GLSL compute kernel on GPU asynchronously returns false if the kernel hasn't been compiled yet.
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatches (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatches (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, OpenSubdiv::Osd::BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable)
 Generic limit eval function with derivatives. This function has a same signature as other device kernels have so that it can be called in the same way.
bool EvalPatches (gpu::VertBuf *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, gpu::VertBuf *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, gpu::VertBuf *duBuffer, OpenSubdiv::Osd::BufferDescriptor const &duDesc, gpu::VertBuf *dvBuffer, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, int numPatchCoords, gpu::VertBuf *patchCoordsBuffer, const OpenSubdiv::Osd::PatchArrayVector &patchArrays, gpu::StorageBuf *patchIndexBuffer, gpu::StorageBuf *patchParamsBuffer)
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatchesVarying (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatchesVarying (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, OpenSubdiv::Osd::BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatchesFaceVarying (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatchesFaceVarying (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, OpenSubdiv::Osd::BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.
bool Compile (OpenSubdiv::Osd::BufferDescriptor const &srcDesc, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, OpenSubdiv::Osd::BufferDescriptor const &duDesc=OpenSubdiv::Osd::BufferDescriptor(), OpenSubdiv::Osd::BufferDescriptor const &dvDesc=OpenSubdiv::Osd::BufferDescriptor())

Static Public Member Functions

static GPUComputeEvaluatorCreate (OpenSubdiv::Osd::BufferDescriptor const &srcDesc, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, OpenSubdiv::Osd::BufferDescriptor const &duDesc, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, OpenSubdiv::Osd::BufferDescriptor const &, OpenSubdiv::Osd::BufferDescriptor const &, OpenSubdiv::Osd::BufferDescriptor const &, void *deviceContext=nullptr)
static GPUComputeEvaluatorCreate (OpenSubdiv::Osd::BufferDescriptor const &srcDesc, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, OpenSubdiv::Osd::BufferDescriptor const &duDesc, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, void *=nullptr)
template<typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
static bool EvalStencils (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, GPUComputeEvaluator *instance, void *deviceContext=nullptr)
 Generic static stencil function. This function has a same signature as other device kernels have so that it can be called transparently from OsdMesh template interface.
template<typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
static bool EvalStencils (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, OpenSubdiv::Osd::BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, GPUComputeEvaluator *instance, void *deviceContext=nullptr)
 Generic static stencil function. This function has a same signature as other device kernels have so that it can be called transparently from OsdMesh template interface.
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatches (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GPUComputeEvaluator *instance, void *deviceContext=nullptr)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatches (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, OpenSubdiv::Osd::BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GPUComputeEvaluator *instance, void *deviceContext=nullptr)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatchesVarying (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GPUComputeEvaluator *instance, void *deviceContext=nullptr)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatchesVarying (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, OpenSubdiv::Osd::BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GPUComputeEvaluator *instance, void *deviceContext=nullptr)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatchesFaceVarying (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GPUComputeEvaluator *instance, void *deviceContext=nullptr)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.
template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatchesFaceVarying (SRC_BUFFER *srcBuffer, OpenSubdiv::Osd::BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, OpenSubdiv::Osd::BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, OpenSubdiv::Osd::BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, OpenSubdiv::Osd::BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GPUComputeEvaluator *instance, void *deviceContext=nullptr)
 Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.
static void Synchronize (void *deviceContext)
 Wait the dispatched kernel finishes.

Detailed Description

Definition at line 104 of file gpu_compute_evaluator.h.

Member Typedef Documentation

◆ Instantiatable

Constructor & Destructor Documentation

◆ GPUComputeEvaluator()

blender::opensubdiv::GPUComputeEvaluator::GPUComputeEvaluator ( )

◆ ~GPUComputeEvaluator()

blender::opensubdiv::GPUComputeEvaluator::~GPUComputeEvaluator ( )

Destructor. note that the GL context must be made current.

Definition at line 120 of file gpu_compute_evaluator.cc.

References GPU_storagebuf_free().

Member Function Documentation

◆ Compile()

bool blender::opensubdiv::GPUComputeEvaluator::Compile ( OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
OpenSubdiv::Osd::BufferDescriptor const & duDesc = OpenSubdiv::Osd::BufferDescriptor(),
OpenSubdiv::Osd::BufferDescriptor const & dvDesc = OpenSubdiv::Osd::BufferDescriptor() )

Other methods


Configure GLSL kernel. A valid GL context must be made current before calling this function. Returns false if it fails to compile the kernel.

Definition at line 128 of file gpu_compute_evaluator.cc.

Referenced by Create().

◆ Create() [1/2]

GPUComputeEvaluator * blender::opensubdiv::GPUComputeEvaluator::Create ( OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
OpenSubdiv::Osd::BufferDescriptor const & ,
OpenSubdiv::Osd::BufferDescriptor const & ,
OpenSubdiv::Osd::BufferDescriptor const & ,
void * deviceContext = nullptr )
inlinestatic

Blender doesn't use 2nd derivatives, but the OSD evaluator cache does expect this constructor to be present.

Definition at line 111 of file gpu_compute_evaluator.h.

References Create(), and GPUComputeEvaluator().

Referenced by Create(), EvalPatches(), EvalPatches(), EvalPatchesFaceVarying(), EvalPatchesFaceVarying(), EvalPatchesVarying(), EvalPatchesVarying(), EvalStencils(), and EvalStencils().

◆ Create() [2/2]

GPUComputeEvaluator * blender::opensubdiv::GPUComputeEvaluator::Create ( OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
void * = nullptr )
inlinestatic

Definition at line 123 of file gpu_compute_evaluator.h.

References Compile(), and GPUComputeEvaluator().

◆ EvalPatches() [1/5]

bool blender::opensubdiv::GPUComputeEvaluator::EvalPatches ( gpu::VertBuf * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
gpu::VertBuf * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
gpu::VertBuf * duBuffer,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
gpu::VertBuf * dvBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
int numPatchCoords,
gpu::VertBuf * patchCoordsBuffer,
const OpenSubdiv::Osd::PatchArrayVector & patchArrays,
gpu::StorageBuf * patchIndexBuffer,
gpu::StorageBuf * patchParamsBuffer )

◆ EvalPatches() [2/5]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatches ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
DST_BUFFER * duBuffer,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
DST_BUFFER * dvBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable )
inline

Generic limit eval function with derivatives. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
duBufferOutput buffer derivative wrt u Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
duDescvertex buffer descriptor for the duBuffer
dvBufferOutput buffer derivative wrt v Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dvDescvertex buffer descriptor for the dvBuffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated.
patchTableGLPatchTable or equivalent

Definition at line 699 of file gpu_compute_evaluator.h.

References EvalPatches().

◆ EvalPatches() [3/5]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatches ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
DST_BUFFER * duBuffer,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
DST_BUFFER * dvBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable,
GPUComputeEvaluator * instance,
void * deviceContext = nullptr )
inlinestatic

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
duBufferOutput buffer derivative wrt u Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
duDescvertex buffer descriptor for the duBuffer
dvBufferOutput buffer derivative wrt v Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dvDescvertex buffer descriptor for the dvBuffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO.
patchTableGLPatchTable or equivalent
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextnot used in the GLXFB evaluator

Definition at line 560 of file gpu_compute_evaluator.h.

References Create(), EvalPatches(), and GPUComputeEvaluator().

◆ EvalPatches() [4/5]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatches ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable )
inline

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO.
patchTableGLPatchTable or equivalent

Definition at line 637 of file gpu_compute_evaluator.h.

References EvalPatches().

◆ EvalPatches() [5/5]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatches ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable,
GPUComputeEvaluator * instance,
void * deviceContext = nullptr )
inlinestatic

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.


Limit evaluations with PatchTable


Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO.
patchTableGLPatchTable or equivalent
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextnot used in the GLXFB evaluator

Definition at line 482 of file gpu_compute_evaluator.h.

References Create(), EvalPatches(), and GPUComputeEvaluator().

Referenced by EvalPatches(), EvalPatches(), EvalPatches(), EvalPatches(), EvalPatchesFaceVarying(), EvalPatchesFaceVarying(), EvalPatchesVarying(), and EvalPatchesVarying().

◆ EvalPatchesFaceVarying() [1/4]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatchesFaceVarying ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
DST_BUFFER * duBuffer,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
DST_BUFFER * dvBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable,
int fvarChannel,
GPUComputeEvaluator * instance,
void * deviceContext = nullptr )
inlinestatic

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
duBufferOutput buffer derivative wrt u Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
duDescvertex buffer descriptor for the duBuffer
dvBufferOutput buffer derivative wrt v Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dvDescvertex buffer descriptor for the dvBuffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO.
patchTableGLPatchTable or equivalent
fvarChannelface-varying channel
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextnot used in the GLXFB evaluator

Definition at line 1210 of file gpu_compute_evaluator.h.

References Create(), EvalPatchesFaceVarying(), and GPUComputeEvaluator().

◆ EvalPatchesFaceVarying() [2/4]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatchesFaceVarying ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
DST_BUFFER * duBuffer,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
DST_BUFFER * dvBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable,
int fvarChannel = 0 )
inline

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
duBufferOutput buffer derivative wrt u Must have get_vertex_buffer() returning a gpu::VertBuf object of destination data
duDescvertex buffer descriptor for the duBuffer
dvBufferOutput buffer derivative wrt v Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dvDescvertex buffer descriptor for the dvBuffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO.
patchTableGLPatchTable or equivalent
fvarChannelface-varying channel

Definition at line 1304 of file gpu_compute_evaluator.h.

References EvalPatches().

◆ EvalPatchesFaceVarying() [3/4]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatchesFaceVarying ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable,
int fvarChannel,
GPUComputeEvaluator * instance,
void * deviceContext = nullptr )
inlinestatic

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO.
patchTableGLPatchTable or equivalent
fvarChannelface-varying channel
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextnot used in the GLXFB evaluator

Definition at line 1062 of file gpu_compute_evaluator.h.

References Create(), EvalPatchesFaceVarying(), and GPUComputeEvaluator().

Referenced by EvalPatchesFaceVarying(), and EvalPatchesFaceVarying().

◆ EvalPatchesFaceVarying() [4/4]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatchesFaceVarying ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable,
int fvarChannel = 0 )
inline

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO.
patchTableGLPatchTable or equivalent
fvarChannelface-varying channel

Definition at line 1135 of file gpu_compute_evaluator.h.

References EvalPatches().

◆ EvalPatchesVarying() [1/4]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatchesVarying ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
DST_BUFFER * duBuffer,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
DST_BUFFER * dvBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable )
inline

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
duBufferOutput buffer derivative wrt u Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
duDescvertex buffer descriptor for the duBuffer
dvBufferOutput buffer derivative wrt v Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dvDescvertex buffer descriptor for the dvBuffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO.
patchTableGLPatchTable or equivalent

Definition at line 996 of file gpu_compute_evaluator.h.

References EvalPatches().

◆ EvalPatchesVarying() [2/4]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatchesVarying ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
DST_BUFFER * duBuffer,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
DST_BUFFER * dvBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable,
GPUComputeEvaluator * instance,
void * deviceContext = nullptr )
inlinestatic

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
duBufferOutput buffer derivative wrt u Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
duDescvertex buffer descriptor for the duBuffer
dvBufferOutput buffer derivative wrt v Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dvDescvertex buffer descriptor for the dvBuffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO.
patchTableGLPatchTable or equivalent
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextnot used in the GLXFB evaluator

Definition at line 907 of file gpu_compute_evaluator.h.

References Create(), EvalPatchesVarying(), and GPUComputeEvaluator().

◆ EvalPatchesVarying() [3/4]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatchesVarying ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable )
inline

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO.
patchTableGLPatchTable or equivalent

Definition at line 835 of file gpu_compute_evaluator.h.

References EvalPatches().

◆ EvalPatchesVarying() [4/4]

template<typename SRC_BUFFER, typename DST_BUFFER, typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalPatchesVarying ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER * patchCoords,
PATCH_TABLE * patchTable,
GPUComputeEvaluator * instance,
void * deviceContext = nullptr )
inlinestatic

Generic limit eval function. This function has a same signature as other device kernels have so that it can be called in the same way.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated. must have BindVBO() method returning an array of PatchCoord struct in VBO.
patchTableGLPatchTable or equivalent
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextnot used in the GLXFB evaluator

Definition at line 777 of file gpu_compute_evaluator.h.

References Create(), EvalPatchesVarying(), and GPUComputeEvaluator().

Referenced by EvalPatchesVarying(), and EvalPatchesVarying().

◆ EvalStencils() [1/5]

bool blender::opensubdiv::GPUComputeEvaluator::EvalStencils ( gpu::VertBuf * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
gpu::VertBuf * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
gpu::VertBuf * duBuffer,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
gpu::VertBuf * dvBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
gpu::StorageBuf * sizesBuffer,
gpu::StorageBuf * offsetsBuffer,
gpu::StorageBuf * indicesBuffer,
gpu::StorageBuf * weightsBuffer,
gpu::StorageBuf * duWeightsBuffer,
gpu::StorageBuf * dvWeightsBuffer,
int start,
int end ) const

Dispatch the GLSL compute kernel on GPU asynchronously returns false if the kernel hasn't been compiled yet.

Parameters
srcBufferGL buffer of input primvar source data
srcDescvertex buffer descriptor for the srcBuffer
dstBufferGL buffer of output primvar destination data
dstDescvertex buffer descriptor for the dstBuffer
duBufferGL buffer of output derivative wrt u
duDescvertex buffer descriptor for the duBuffer
dvBufferGL buffer of output derivative wrt v
dvDescvertex buffer descriptor for the dvBuffer
sizesBufferGL buffer of the sizes in the stencil table
offsetsBufferGL buffer of the offsets in the stencil table
indicesBufferGL buffer of the indices in the stencil table
weightsBufferGL buffer of the weights in the stencil table
duWeightsBufferGL buffer of the du weights in the stencil table
dvWeightsBufferGL buffer of the dv weights in the stencil table
startstart index of stencil table
endend index of stencil table

◆ EvalStencils() [2/5]

template<typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalStencils ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
DST_BUFFER * duBuffer,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
DST_BUFFER * dvBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
STENCIL_TABLE const * stencilTable ) const
inline

Generic stencil function.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the dstBuffer
duBufferOutput buffer derivative wrt u Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
duDescvertex buffer descriptor for the duBuffer
dvBufferOutput buffer derivative wrt v Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dvDescvertex buffer descriptor for the dvBuffer
stencilTablestencil table to be applied. The table must have SSBO interfaces.

Definition at line 360 of file gpu_compute_evaluator.h.

References EvalStencils().

◆ EvalStencils() [3/5]

template<typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalStencils ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
DST_BUFFER * duBuffer,
OpenSubdiv::Osd::BufferDescriptor const & duDesc,
DST_BUFFER * dvBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dvDesc,
STENCIL_TABLE const * stencilTable,
GPUComputeEvaluator * instance,
void * deviceContext = nullptr )
inlinestatic

Generic static stencil function. This function has a same signature as other device kernels have so that it can be called transparently from OsdMesh template interface.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the dstBuffer
duBufferOutput buffer derivative wrt u Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
duDescvertex buffer descriptor for the duBuffer
dvBufferOutput buffer derivative wrt v Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dvDescvertex buffer descriptor for the dvBuffer
stencilTablestencil table to be applied. The table must have SSBO interfaces.
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextnot used in the GLSL kernel

Definition at line 244 of file gpu_compute_evaluator.h.

References Create(), EvalStencils(), and GPUComputeEvaluator().

◆ EvalStencils() [4/5]

template<typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalStencils ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
STENCIL_TABLE const * stencilTable ) const
inline

Generic stencil function.

Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
stencilTablestencil table to be applied. The table must have SSBO interfaces.

Definition at line 306 of file gpu_compute_evaluator.h.

References EvalStencils().

◆ EvalStencils() [5/5]

template<typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
bool blender::opensubdiv::GPUComputeEvaluator::EvalStencils ( SRC_BUFFER * srcBuffer,
OpenSubdiv::Osd::BufferDescriptor const & srcDesc,
DST_BUFFER * dstBuffer,
OpenSubdiv::Osd::BufferDescriptor const & dstDesc,
STENCIL_TABLE const * stencilTable,
GPUComputeEvaluator * instance,
void * deviceContext = nullptr )
inlinestatic

Generic static stencil function. This function has a same signature as other device kernels have so that it can be called transparently from OsdMesh template interface.


Stencil evaluations with StencilTable


Parameters
srcBufferInput primvar buffer. Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer Must have get_vertex_buffer() returning a gpu::VertBuf buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
stencilTablestencil table to be applied. The table must have SSBO interfaces.
instancecached compiled instance. Clients are supposed to pre-compile an instance of this class and provide to this function. If it's null the kernel still compute by instantiating on-demand kernel although it may cause a performance problem.
deviceContextnot used in the GLSL kernel

Definition at line 177 of file gpu_compute_evaluator.h.

References Create(), EvalStencils(), and GPUComputeEvaluator().

Referenced by EvalStencils(), EvalStencils(), EvalStencils(), and EvalStencils().

◆ Synchronize()

void blender::opensubdiv::GPUComputeEvaluator::Synchronize ( void * deviceContext)
static

Wait the dispatched kernel finishes.

Definition at line 146 of file gpu_compute_evaluator.cc.

References GPU_finish().


The documentation for this class was generated from the following files: