gallium: New PIPE_BUFFER_USAGE_FLUSH_EXPLICIT flag for buffer_flush_mapped_range.
authorJosé Fonseca <jfonseca@vmware.com>
Tue, 30 Jun 2009 14:07:10 +0000 (15:07 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 30 Jun 2009 14:33:53 +0000 (15:33 +0100)
commit4ffe2844a46bcd69c0f2c95f04da97e83899e831
tree86e9bd1438206bf4f1e702f6fd9f018f578efaea
parent4e43126a5915b1233c89c61400c8270d23d48ea3
gallium: New PIPE_BUFFER_USAGE_FLUSH_EXPLICIT flag for buffer_flush_mapped_range.

When a buffer was mapped for write and no explicit flush range was provided
the existing semantics were that the whole buffer would be flushed, mostly
for backwards compatability with non map-buffer-range aware code.

However if the buffer was mapped/unmapped with nothing really written --
something that often happens with the vbo -- we were unnecessarily assuming
that the whole buffer was written.

The new PIPE_BUFFER_USAGE_FLUSH_EXPLICIT flag (based from ARB_map_buffer_range
's GL_MAP_FLUSH_EXPLICIT_BIT flag) allows to clearly distinguish the
legacy usage from the nothing written usage.
src/gallium/include/pipe/p_defines.h
src/gallium/include/pipe/p_inlines.h
src/gallium/include/pipe/p_screen.h