table of contents
GLMAPBUFFERRANGE(3G) | OpenGL Manual | GLMAPBUFFERRANGE(3G) |
NAME¶
glMapBufferRange - map a section of a buffer object's data store
C SPECIFICATION¶
void *glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
PARAMETERS¶
target
offset
length
access
DESCRIPTION¶
glMapBufferRange maps all or part of the data store of a buffer object into the client's address space. target specifies the target to which the buffer is bound and must be one of GL_ARRAY_BUFFER, GL_ATOMIC_COUNTER_BUFFER, GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, GL_DRAW_INDIRECT_BUFFER, GL_DISPATCH_INDIRECT_BUFFER, GL_ELEMENT_ARRAY_BUFFER, GL_PIXEL_PACK_BUFFER, GL_PIXEL_UNPACK_BUFFER, GL_TEXTURE_BUFFER, GL_TRANSFORM_FEEDBACK_BUFFER, GL_UNIFORM_BUFFER or GL_SHADER_STORAGE_BUFFER. offset and length indicate the range of data in the buffer object htat is to be mapped, in terms of basic machine units. access is a bitfield containing flags which describe the requested mapping. These flags are described below.
If no error occurs, a pointer to the beginning of the mapped range is returned once all pending operations on that buffer have completed, and may be used to modify and/or query the corresponding range of the buffer, according to the following flag bits set in access:
Furthermore, the following optional flag bits in access may be used to modify the mapping:
If an error occurs, glMapBufferRange returns a NULL pointer. If no error occurs, the returned pointer will reflect an alignment of at least GL_MIN_MAP_BUFFER_ALIGNMENT basic machine units. The value of GL_MIN_MAP_BUFFER_ALIGNMENT can be retrieved by calling glGet() with pname set to GL_MIN_MAP_BUFFER_ALIGNMENT and must be a power of two that is at least 64. Subtracting offset from this returned pointed will always produce a multiple of GL_MIN_MAP_BUFFER_ALINMENT.
NOTES¶
Alignment of the returned pointer is guaranteed only if the version of the GL version is 4.2 or greater. Also, the GL_ATOMIC_COUNTER_BUFFER target is accepted only if the GL version is 4.2 or greater.
The GL_DISPATCH_INDIRECT_BUFFER and GL_SHADER_STORAGE_BUFFER targets are accepted only if the GL version is 4.3 or greater.
ERRORS¶
GL_INVALID_VALUE is generated if either of offset or length is negative, or if offset + length is greater than the value of GL_BUFFER_SIZE.
GL_INVALID_VALUE is generated if access has any bits set other than those defined above.
GL_INVALID_OPERATION is generated for any of the following conditions:
GL_OUT_OF_MEMORY is generated if glMapBufferRange fails because memory for the mapping could not be obtained.
SEE ALSO¶
glMapBuffer(), glFlushMappedBufferRange(), glBindBuffer()
COPYRIGHT¶
Copyright © 2010-2012 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
AUTHORS¶
opengl.org
05/02/2014 | opengl.org |