25#ifndef OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H
26#define OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H
28#include "../version.h"
29#include "../osd/opencl.h"
32namespace OPENSUBDIV_VERSION {
48 template <
typename DEVICE_CONTEXT>
50 DEVICE_CONTEXT context) {
51 return Create(numElements, numVertices, context->GetContext());
59 void UpdateData(
const float *src,
int startVertex,
int numVertices, cl_command_queue clQueue,
60 cl_event* startEvents = NULL,
unsigned int numStartEvents = 0, cl_event* endEvent = NULL);
62 template<
typename DEVICE_CONTEXT>
63 void UpdateData(
const float *src,
int startVertex,
int numVertices,
64 DEVICE_CONTEXT context,
65 cl_event* startEvents = NULL,
unsigned int numStartEvents = 0, cl_event* endEvent = NULL) {
66 UpdateData(src, startVertex, numVertices, context->GetCommandQueue(), startEvents, numStartEvents, endEvent);
95using namespace OPENSUBDIV_VERSION;
Concrete vertex buffer class for OpenCL subdivision.
void UpdateData(const float *src, int startVertex, int numVertices, DEVICE_CONTEXT context, cl_event *startEvents=NULL, unsigned int numStartEvents=0, cl_event *endEvent=NULL)
~CLVertexBuffer()
Destructor.
CLVertexBuffer(int numElements, int numVertices, cl_context clContext)
Constructor.
void UpdateData(const float *src, int startVertex, int numVertices, cl_command_queue clQueue, cl_event *startEvents=NULL, unsigned int numStartEvents=0, cl_event *endEvent=NULL)
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
bool allocate(cl_context clContext)
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
static CLVertexBuffer * Create(int numElements, int numVertices, cl_context clContext)
Creator. Returns NULL if error.
static CLVertexBuffer * Create(int numElements, int numVertices, DEVICE_CONTEXT context)
cl_mem BindCLBuffer(cl_command_queue queue)
Returns the CL memory object.