Home

GLMAPREADBIT

GLMAPREADBIT is a term sometimes used in documentation or language bindings to refer to the OpenGL constant that indicates read access when mapping buffer or memory regions. The canonical name in the OpenGL API is GL_MAP_READ_BIT. It is defined as a bit flag that can be used in the access mask passed to functions such as glMapBufferRange and glMapNamedBufferRange.

As a member of the GL_MAP_* family of bits, GL_MAP_READ_BIT (GLMAPREADBIT in some bindings) specifies that the

Usage context entails mapping a region of a buffer or memory object for host-side access. By using

GLMAPREADBIT is effectively an alias for GL_MAP_READ_BIT in many bindings, serving the same role in enabling

mapped
region
should
be
readable
by
the
client.
It
is
commonly
combined
with
other
flags
to
customize
access;
for
example,
GL_MAP_READ_BIT
|
GL_MAP_WRITE_BIT
would
request
a
mapped
range
that
can
be
read
and
written.
Other
related
flags
in
the
same
family
include
GL_MAP_WRITE_BIT,
GL_MAP_INVALIDATE_RANGE_BIT,
GL_MAP_INVALIDATE_BUFFER_BIT,
and
GL_MAP_UNSYNCHRONIZED_BIT,
among
others.
GL_MAP_READ_BIT,
an
application
declares
its
intention
to
read
data
from
the
mapped
pointer.
If
synchronization
is
required,
additional
bits
may
be
used,
and
the
programmer
should
consider
proper
synchronization
to
avoid
data
hazards
between
CPU
and
GPU
operations.
read
access
during
mapping
calls.
It
is
part
of
the
broader
API
feature
set
introduced
with
buffer
mapping
extensions,
and
it
remains
a
standard
mechanism
for
controlled
host
access
to
GPU
resources.