| OpenSubdiv

Loading...
Searching...
No Matches
CLVertexBuffer Class Reference

Concrete vertex buffer class for OpenCL subdivision. More...

`#include <clVertexBuffer.h>`

## Public Member Functions
| ~CLVertexBuffer ()
| Destructor.
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)
template<typename DEVICE_CONTEXT>
void | UpdateData (const float *src, int startVertex, int numVertices, DEVICE_CONTEXT context, cl_event *startEvents=NULL, unsigned int numStartEvents=0, cl_event *endEvent=NULL)
int | GetNumElements () const
| Returns how many elements defined in this vertex buffer.
int | GetNumVertices () const
| Returns how many vertices allocated in this vertex buffer.
cl_mem | BindCLBuffer (cl_command_queue queue)
| Returns the CL memory object.

## Static Public Member Functions
static CLVertexBuffer * | Create (int numElements, int numVertices, cl_context clContext)
| Creator. Returns NULL if error.
template<typename DEVICE_CONTEXT>
static CLVertexBuffer * | Create (int numElements, int numVertices, DEVICE_CONTEXT context)

## Protected Member Functions
| CLVertexBuffer (int numElements, int numVertices, cl_context clContext)
| Constructor.
bool | allocate (cl_context clContext)

## Detailed Description

Concrete vertex buffer class for OpenCL subdivision.

CLVertexBuffer implements CLVertexBufferInterface. An instance of this buffer class can be passed to CLEvaluator

Definition at line 42 of file clVertexBuffer.h.

## Constructor & Destructor Documentation

## ◆ ~CLVertexBuffer()

~CLVertexBuffer | ( |  | ) |

Destructor.

## ◆ CLVertexBuffer()

CLVertexBuffer | ( | int | numElements,
|  | int | numVertices,
|  | cl_context | clContext )
| protected

Constructor.

## Member Function Documentation

## ◆ allocate()

bool allocate | ( | cl_context | clContext | ) |
| protected

Allocates CL memory for this buffer. Returns true if success.

## ◆ BindCLBuffer()

cl_mem BindCLBuffer | ( | cl_command_queue | queue | ) |

Returns the CL memory object.

## ◆ Create() [1/2]

CLVertexBuffer * Create | ( | int | numElements,
|  | int | numVertices,
|  | cl_context | clContext )
| static

Creator. Returns NULL if error.

## ◆ Create() [2/2]

template<typename DEVICE_CONTEXT>

CLVertexBuffer * Create | ( | int | numElements,
|  | int | numVertices,
|  | DEVICE_CONTEXT | context )
| inline static

Definition at line 49 of file clVertexBuffer.h.

## ◆ GetNumElements()

int GetNumElements | ( |  | ) | const

Returns how many elements defined in this vertex buffer.

## ◆ GetNumVertices()

int GetNumVertices | ( |  | ) | const

Returns how many vertices allocated in this vertex buffer.

## ◆ UpdateData() [1/2]

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 )

This method is meant to be used in client code in order to provide coarse vertices data to Osd.

## ◆ UpdateData() [2/2]

template<typename DEVICE_CONTEXT>

void UpdateData | ( | const float * | src,
|  | int | startVertex,
|  | int | numVertices,
|  | DEVICE_CONTEXT | context,
|  | cl_event * | startEvents = NULL,
|  | unsigned int | numStartEvents = 0,
|  | cl_event * | endEvent = NULL )
| inline

Definition at line 63 of file clVertexBuffer.h.

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

- opensubdiv/osd/clVertexBuffer.h