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"
32 namespace 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);
61 template<
typename DEVICE_CONTEXT>
62 void UpdateData(
const float *src,
int startVertex,
int numVertices,
63 DEVICE_CONTEXT context) {
64 UpdateData(src, startVertex, numVertices, context->GetCommandQueue());
78 CLVertexBuffer(
int numElements,
int numVertices, cl_context clContext);
93 using namespace OPENSUBDIV_VERSION;
97 #endif // OPENSUBDIV3_OSD_CL_VERTEX_BUFFER_H
bool allocate(cl_context clContext)
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
~CLVertexBuffer()
Destructor.
Concrete vertex buffer class for OpenCL subvision.
cl_mem BindCLBuffer(cl_command_queue queue)
Returns the CL memory object.
CLVertexBuffer(int numElements, int numVertices, cl_context clContext)
Constructor.
void UpdateData(const float *src, int startVertex, int numVertices, DEVICE_CONTEXT context)
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
void UpdateData(const float *src, int startVertex, int numVertices, cl_command_queue clQueue)
static CLVertexBuffer * Create(int numElements, int numVertices, DEVICE_CONTEXT context)
static CLVertexBuffer * Create(int numElements, int numVertices, cl_context clContext)
Creator. Returns NULL if error.