Home

GLMAPFLUSHEXPLICITBIT

GLMAPFLUSHEXPLICITBIT, also known as GL_MAP_FLUSH_EXPLICIT_BIT, is a bit flag used in OpenGL to control how data written through mapped buffer ranges is flushed to the graphics subsystem. It is part of the set of map access bits used with buffer mapping functions such as glMapBufferRange.

When this flag is included in the access mask passed to glMapBufferRange, the application takes responsibility

GL_MAP_FLUSH_EXPLICIT_BIT is commonly used in conjunction with other related flags, such as GL_MAP_PERSISTENT_BIT, to support persistent

The flag is defined within the OpenGL specification as part of the map buffer range extension (ARB_map_buffer_range).

for
explicitly
flushing
written
data.
In
practice,
this
means
that
writes
to
the
mapped
memory
are
not
automatically
made
visible
to
the
GL
by
the
driver;
instead,
the
programmer
must
call
glFlushMappedBufferRange
with
the
appropriate
offset
and
length
to
ensure
those
changes
are
visible
to
subsequent
GL
operations.
This
explicit
flushing
enables
finer-grained
synchronization
and
can
reduce
unwanted
stalls
in
certain
dynamic
or
streaming
workloads.
mapped
buffers.
In
persistent
mapping,
a
buffer
remains
mapped
for
an
extended
period,
and
explicit
flushing
provides
you
with
precise
control
over
when
data
becomes
visible
to
the
GPU,
avoiding
implicit
synchronization
that
could
otherwise
cause
performance
bottlenecks.
If
GL_MAP_FLUSH_EXPLICIT_BIT
is
not
used,
the
driver
may
flush
automatically
at
certain
events
(such
as
unmap),
depending
on
the
specific
implementation
and
other
flags
chosen.
It
is
typically
encountered
by
developers
implementing
high-performance,
dynamic
data
uploads
to
GPU
buffers,
such
as
streaming
vertex
data
or
dynamic
uniform
buffers,
where
predictable
synchronization
behavior
is
important.