glCopyNamedBufferSubData

glCopyBufferSubData: man4/glCopyBufferSubData.xml

glCopyBufferSubData and glCopyNamedBufferSubData copy part of the data store attached to a source buffer object to the data store attached to a destination buffer object. The number of basic machine units indicated by size is copied from the source at offset readOffset to the destination at writeOffset. readOffset, writeOffset and size are in terms of basic machine units. For glCopyBufferSubData, readTarget and writeTarget specify the targets to which the source and destination buffer objects are bound, and must each be one of the buffer binding targets in the following table: Buffer Binding Target Purpose GL_ARRAY_BUFFER Vertex attributes GL_ATOMIC_COUNTER_BUFFER Atomic counter storage GL_COPY_READ_BUFFER Buffer copy source GL_COPY_WRITE_BUFFER Buffer copy destination GL_DISPATCH_INDIRECT_BUFFER Indirect compute dispatch commands GL_DRAW_INDIRECT_BUFFER Indirect command arguments GL_ELEMENT_ARRAY_BUFFER Vertex array indices GL_PIXEL_PACK_BUFFER Pixel read target GL_PIXEL_UNPACK_BUFFER Texture data source GL_QUERY_BUFFER Query result buffer GL_SHADER_STORAGE_BUFFER Read-write storage for shaders GL_TEXTURE_BUFFER Texture data buffer GL_TRANSFORM_FEEDBACK_BUFFER Transform feedback buffer GL_UNIFORM_BUFFER Uniform block storage Any of these targets may be used, but the targets GL_COPY_READ_BUFFER and GL_COPY_WRITE_BUFFER are provided specifically to allow copies between buffers without disturbing other GL state. readOffset, writeOffset and size must all be greater than or equal to zero. Furthermore, $readOffset+size$ must not exceeed the size of the source buffer object, and $writeOffset+size$ must not exceeed the size of the buffer bound to writeTarget. If the source and destination are the same buffer object, then the source and destination ranges must not overlap.

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.V4P5)
@OpenGL_Extension("GL_ARB_direct_state_access")
fn_glCopyNamedBufferSubData glCopyNamedBufferSubData;

See Also

glGenBuffers, glBindBuffer, glBufferData, glBufferSubData, glGetBufferSubData, glMapBuffer, glMapBufferRange

Meta