Home

GLMAPUNSYNCHRONIZEDBIT

GL_MAP_UNSYNCHRONIZED_BIT is a bit flag used with OpenGL buffer mapping functions such as glMapBufferRange and glMapNamedBufferRange. It indicates that the mapping should proceed without the driver delaying to synchronize with existing or pending GL operations on the same buffer. This can reduce latency in scenarios where the application will manage synchronization itself or where the mapped region is known not to be accessed by GL concurrently.

The flag is defined as a specific bit in the access mask, commonly represented as the numeric

Use and cautions: When GL_MAP_UNSYNCHRONIZED_BIT is specified, the GL driver may not wait for ongoing operations

Common use cases include streaming or ring-buffer patterns and other performance-sensitive code paths where the application

See also: GL_MAP_READ_BIT, GL_MAP_WRITE_BIT, GL_MAP_INVALIDATE_RANGE_BIT, GL_MAP_INVALIDATE_BUFFER_BIT, GL_MAP_FLUSH_EXPLICIT_BIT, glFlushMappedBufferRange, glMapBufferRange.

value
0x0020.
It
is
typically
combined
with
other
access
flags
such
as
GL_MAP_READ_BIT
or
GL_MAP_WRITE_BIT
to
request
a
reading
or
writing
map
for
a
given
buffer
range.
The
exact
combination
depends
on
whether
the
application
intends
to
read
from
or
write
to
the
mapped
memory.
on
the
buffer
to
complete
before
returning
the
mapping.
This
avoids
synchronization
delays
but
introduces
potential
data
hazards
if
the
buffer
region
is
also
in
use
by
the
GL
pipeline.
Therefore,
the
application
bears
responsibility
for
ensuring
correctness,
for
example
by
avoiding
concurrent
writes
and
reads
in
overlapping
regions
or
by
issuing
appropriate
synchronization
commands
such
as
glFlushMappedBufferRange
or
memory
barriers
when
necessary.
guarantees
proper
sequencing.
In
modern
setups
with
persistent
mappings
and
coherent
memory,
the
need
for
unsynchronized
mappings
is
reduced.