Home

glFlushMappedBufferRange

glFlushMappedBufferRange is an OpenGL API function used to flush a previously mapped range of a buffer object's data store back to the graphics pipeline. It ensures that writes performed by the client into a mapped buffer are made visible to the GL driver and to subsequent GL operations. The function is part of the buffer-mapping feature set introduced by the ARB_map_buffer_range extension and is commonly used with glMapBufferRange and persistent mappings.

Syntax: void glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);

Parameters:

- target: the binding target of the buffer object whose data store is mapped (for example GL_ARRAY_BUFFER

- offset: the starting byte offset into the buffer’s data store for the range to flush.

- length: the size, in bytes, of the range to flush.

Behavior: The function flushes the specified range of the mapped memory so future GL operations see the

Usage notes: Use glFlushMappedBufferRange when writing to a buffer via a mapped pointer obtained from glMapBufferRange

or
GL_ELEMENT_ARRAY_BUFFER).
The
active
binding
determines
which
buffer
is
affected.
latest
client-side
writes.
If
the
range
is
not
currently
mapped
or
outside
the
mapped
region,
an
error
(GL_INVALID_OPERATION)
may
be
generated.
When
a
mapping
is
coherent
or
not
persistent,
the
flush
may
be
a
no-op.
with
write
access,
especially
when
using
persistent
mappings.
It
is
often
paired
with
glUnmapBuffer
when
done,
or
used
to
flush
only
sub-ranges
to
minimize
overhead.
See
also
glMapBufferRange,
glMapBuffer,
glUnmapBuffer
and
GL_ARB_map_buffer_range.