GLComputeEvaluator Class Reference

#include <glComputeEvaluator.h>

Public Types

typedef bool Instantiatable
 

Public Member Functions

 GLComputeEvaluator ()
 Constructor. More...
 
 ~GLComputeEvaluator ()
 Destructor. note that the GL context must be made current. More...
 
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) const
 
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) const
 
bool EvalStencils (GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, GLuint duWeightsBuffer, GLuint dvWeightsBuffer, int start, int end) const
 
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) const
 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. More...
 
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) const
 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. More...
 
bool EvalPatches (GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, GLuint patchIndexBuffer, GLuint patchParamsBuffer) const
 
bool Compile (BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc)
 

Static Public Member Functions

static GLComputeEvaluatorCreate (BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, void *deviceContext=NULL)
 
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, GLComputeEvaluator const *instance, void *deviceContext=NULL)
 Generic static compute function. This function has a same signature as other device kernels have so that it can be called transparently from OsdMesh template interface. More...
 
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, GLComputeEvaluator const *instance, void *deviceContext=NULL)
 Generic static compute function. This function has a same signature as other device kernels have so that it can be called transparently from OsdMesh template interface. More...
 
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, GLComputeEvaluator const *instance, void *deviceContext=NULL)
 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. More...
 
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, GLComputeEvaluator const *instance, void *deviceContext=NULL)
 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. More...
 
static void Synchronize (void *deviceContext)
 Wait the dispatched kernel finishes. More...
 

Detailed Description

Definition at line 90 of file glComputeEvaluator.h.

Member Typedef Documentation

typedef bool Instantiatable

Definition at line 92 of file glComputeEvaluator.h.

Constructor & Destructor Documentation

Constructor.

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

Member Function Documentation

bool Compile ( BufferDescriptor const &  srcDesc,
BufferDescriptor const &  dstDesc,
BufferDescriptor const &  duDesc,
BufferDescriptor const &  dvDesc 
)

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.

static GLComputeEvaluator* Create ( BufferDescriptor const &  srcDesc,
BufferDescriptor const &  dstDesc,
BufferDescriptor const &  duDesc,
BufferDescriptor const &  dvDesc,
void *  deviceContext = NULL 
)
inlinestatic

Definition at line 93 of file glComputeEvaluator.h.

static bool EvalPatches ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
int  numPatchCoords,
PATCHCOORD_BUFFER *  patchCoords,
PATCH_TABLE *  patchTable,
GLComputeEvaluator const *  instance,
void *  deviceContext = NULL 
)
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 BindVBO() method returning a GL buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindVBO() method returning a GL 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 344 of file glComputeEvaluator.h.

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,
GLComputeEvaluator const *  instance,
void *  deviceContext = NULL 
)
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 BindVBO() method returning a GL buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindVBO() method returning a GL buffer object of destination data
dstDescvertex buffer descriptor for the output buffer
duBuffer
duDesc
dvBuffer
dvDesc
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 418 of file glComputeEvaluator.h.

bool EvalPatches ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
int  numPatchCoords,
PATCHCOORD_BUFFER *  patchCoords,
PATCH_TABLE *  patchTable 
) const
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 BindVBO() method returning a const float pointer for read
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindVBOBuffer() method returning a float pointer for write
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 480 of file glComputeEvaluator.h.

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 
) const
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 BindVBO() method returning a const float pointer for read
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindVBO() method returning a float pointer for write
dstDescvertex buffer descriptor for the output buffer
duBufferOutput U-derivatives buffer must have BindVBO() method returning a float pointer for write
duDescvertex buffer descriptor for the duBuffer
dvBufferOutput V-derivatives buffer must have BindVBO() method returning a float pointer for write
dvDescvertex buffer descriptor for the dvBuffer
numPatchCoordsnumber of patchCoords.
patchCoordsarray of locations to be evaluated.
patchTableGLPatchTable or equivalent

Definition at line 534 of file glComputeEvaluator.h.

bool EvalPatches ( GLuint  srcBuffer,
BufferDescriptor const &  srcDesc,
GLuint  dstBuffer,
BufferDescriptor const &  dstDesc,
GLuint  duBuffer,
BufferDescriptor const &  duDesc,
GLuint  dvBuffer,
BufferDescriptor const &  dvDesc,
int  numPatchCoords,
GLuint  patchCoordsBuffer,
const PatchArrayVector patchArrays,
GLuint  patchIndexBuffer,
GLuint  patchParamsBuffer 
) const
static bool EvalStencils ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
STENCIL_TABLE const *  stencilTable,
GLComputeEvaluator const *  instance,
void *  deviceContext = NULL 
)
inlinestatic

Generic static compute 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 BindVBO() method returning a GL buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindVBO() method returning a GL 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 145 of file glComputeEvaluator.h.

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,
GLComputeEvaluator const *  instance,
void *  deviceContext = NULL 
)
inlinestatic

Generic static compute 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 BindVBO() method returning a GL buffer object of source data
srcDescvertex buffer descriptor for the input buffer
dstBufferOutput primvar buffer must have BindVBO() method returning a GL buffer object of destination data
dstDescvertex buffer descriptor for the dstBuffer
duBufferOutput U-derivative buffer must have BindVBO() method returning a GL buffer object of destination data
duDescvertex buffer descriptor for the duBuffer
dvBufferOutput V-derivative buffer must have BindVBO() method returning a GL 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 213 of file glComputeEvaluator.h.

bool EvalStencils ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
STENCIL_TABLE const *  stencilTable 
) const
inline

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

Definition at line 248 of file glComputeEvaluator.h.

bool EvalStencils ( SRC_BUFFER *  srcBuffer,
BufferDescriptor const &  srcDesc,
DST_BUFFER *  dstBuffer,
BufferDescriptor const &  dstDesc,
DST_BUFFER *  duBuffer,
BufferDescriptor const &  duDesc,
DST_BUFFER *  dvBuffer,
BufferDescriptor const &  dvDesc,
STENCIL_TABLE const *  stencilTable 
) const
inline

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

Definition at line 269 of file glComputeEvaluator.h.

bool EvalStencils ( GLuint  srcBuffer,
BufferDescriptor const &  srcDesc,
GLuint  dstBuffer,
BufferDescriptor const &  dstDesc,
GLuint  duBuffer,
BufferDescriptor const &  duDesc,
GLuint  dvBuffer,
BufferDescriptor const &  dvDesc,
GLuint  sizesBuffer,
GLuint  offsetsBuffer,
GLuint  indicesBuffer,
GLuint  weightsBuffer,
GLuint  duWeightsBuffer,
GLuint  dvWeightsBuffer,
int  start,
int  end 
) const

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

static void Synchronize ( void *  deviceContext)
static

Wait the dispatched kernel finishes.


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