glBufferSubData

glBufferSubData: man4/glBufferSubData.xml

glBufferSubData and glNamedBufferSubData redefine some or all of the data store for the specified buffer object. Data starting at byte offset offset and extending for size bytes is copied to the data store from the memory pointed to by data. offset and size must define a range lying entirely within the buffer object's data store.

When replacing the entire data store, consider using glBufferSubData rather than completely recreating the data store with glBufferData. This avoids the cost of reallocating the data store. Consider using multiple buffer objects to avoid stalling the rendering pipeline during data store updates. If any rendering in the pipeline makes reference to data in the buffer object being updated by glBufferSubData, especially from the specific region being updated, that rendering must drain from the pipeline before the data store can be updated. Clients must align data elements consistent with the requirements of the client platform, with an additional base-level requirement that an offset within a buffer to a datum comprising $N$ bytes be a multiple of $N$. The GL_ATOMIC_COUNTER_BUFFER target is available only if the GL version is 4.2 or greater. The GL_DISPATCH_INDIRECT_BUFFER and GL_SHADER_STORAGE_BUFFER targets are available only if the GL version is 4.3 or greater. The GL_QUERY_BUFFER target is available only if the GL version is 4.4 or greater.

@OpenGL_Version(OGLIntroducedIn.V1P5)
fn_glBufferSubData glBufferSubData;

See Also

glBindBuffer, glBufferData, glMapBuffer, glMapBufferRange, glUnmapBuffer

Meta