GL_APICALL void GL_APIENTRY glBufferSubData(
GLenum target,
GLintptr offset,
GLsizeiptr size,
const void * data
);
| Name | Description | |
|---|---|---|
| in | target | Target |
| in | offset | Offset (in bytes) to the partial region |
| in | size | Size of the partial region |
| in | data | Pointer to the vertex data |
Updates a partial vertex data region in the current vertex buffer object.
Set target equal to GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER.
Set offset to the offset of the partial region to update.
Set size to the size of the partial region.
Set data to a pointer to the data to update.
The partial region is transferred using the method configured by a previous call to glBufferData. You must call glBufferData to allocate a vertex buffer region before you call this function. A GL_INVALID_OPERATION error occurs when you call glBufferSubData without first calling glBufferData.
If you set (NN_GX_MEM_FCRAM | GL_NO_COPY_FCRAM_DMP) using glBufferData (the value specified in the target parameter), then the vertex buffer area will be in application memory. As a result, this function will only flush the cache for the partial region, and will not update the data therein. Update the data itself in the application.
Calls to this function are ignored when size is 0.
If you set (NN_GX_MEM_VRAMA{B} | GL_NO_COPY_FCRAM_DMP) using this function, then you must guarantee that the area specified in data will be retained until DMA transfer completes.
This function generates the following errors.
| GL_INVALID_VALUE | The offset or size argument is negative; the sum of offset and size exceeds the size of the original buffer; or data is NULL. |
|---|---|
GL_INVALID_VALUE | If you set (NN_GX_MEM_FCRAM | GL_NO_COPY_FCRAM_DMP) using glBufferData, and the sum of the original buffer address specified in glBufferData and offset is not specified in data |
| GL_INVALID_OPERATION | This function was called without any command-list objects bound. |
| GL_INVALID_OPERATION | A previous call to glBufferData set the transfer method to (NN_GX_MEM_FCRAM | GL_NO_COPY_FCRAM_DMP). |
| GL_INVALID_OPERATION | Object 0 is bound to the current target. |
| GL_INVALID_OPERATION | The glBufferSubData function was called without first calling glBufferData. |
glBufferData settings.
CONFIDENTIAL