summaryrefslogtreecommitdiff
path: root/src/gallium/include/pipe/p_inlines.h
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-06-30 15:07:10 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-06-30 15:33:53 +0100
commit4ffe2844a46bcd69c0f2c95f04da97e83899e831 (patch)
tree86e9bd1438206bf4f1e702f6fd9f018f578efaea /src/gallium/include/pipe/p_inlines.h
parent4e43126a5915b1233c89c61400c8270d23d48ea3 (diff)
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.
Diffstat (limited to 'src/gallium/include/pipe/p_inlines.h')
-rw-r--r--src/gallium/include/pipe/p_inlines.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index 1232c87968..cf176c9209 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -117,7 +117,9 @@ pipe_buffer_write(struct pipe_screen *screen,
assert(offset + size <= buf->size);
assert(size);
- map = pipe_buffer_map_range(screen, buf, offset, size, PIPE_BUFFER_USAGE_CPU_WRITE);
+ map = pipe_buffer_map_range(screen, buf, offset, size,
+ PIPE_BUFFER_USAGE_CPU_WRITE |
+ PIPE_BUFFER_USAGE_FLUSH_EXPLICIT);
assert(map);
if(map) {
memcpy(map + offset, data, size);