Home

glUnmapBuffer

glUnmapBuffer is an OpenGL function used to unmap a buffer object that was previously mapped with glMapBuffer or glMapBufferRange. The only parameter is the target, which identifies the buffer binding point (for example GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER). The exact set of valid targets depends on the OpenGL version and extensions in use.

The function returns a GLboolean. If the unmapping succeeds, glUnmapBuffer returns GL_TRUE and the data store

Error handling and states: GL_INVALID_OPERATION is generated if there is no buffer bound to the specified target,

Usage notes: glUnmapBuffer is typically called after the application has finished reading or writing to a mapped

contents
are
preserved
for
use
by
OpenGL.
If
the
unmapping
fails,
it
returns
GL_FALSE
and
the
contents
of
the
buffer
become
undefined;
in
this
case
the
application
should
not
rely
on
the
data
and
may
need
to
re-upload
or
reinitialize
the
buffer
contents.
if
the
bound
buffer
is
not
currently
mapped,
or
if
the
buffer
object
cannot
be
unmapped
in
the
current
context.
In
addition,
when
using
advanced
mapping
modes
such
as
persistent
mappings,
glUnmapBuffer
plays
a
role
in
finalizing
the
access
to
the
data
store
and
making
it
available
again
to
the
GL
pipeline.
buffer
region.
It
is
a
synchronization
point
that
indicates
the
CPU-side
modifications
are
complete
and
that
the
GPU
may
access
the
buffer
data
again.
If
a
mapping
was
done
with
special
flags
that
allow
persistent
access,
the
unmapping
step
may
have
nuanced
behavior
depending
on
the
context
and
extension
setup.
Related
functions
include
glMapBuffer
and
glMapBufferRange.