summaryrefslogtreecommitdiffstats
path: root/src/gallium/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/include')
-rw-r--r--src/gallium/include/pipe/p_inlines.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index cf176c92099..a5c1e8270a3 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -63,6 +63,13 @@ pipe_buffer_map(struct pipe_screen *screen,
if(screen->buffer_map_range) {
unsigned offset = 0;
unsigned length = buf->size;
+
+ /* XXX: Actually we should be using/detecting DISCARD
+ * instead of assuming that WRITE implies discard */
+ if((usage & PIPE_BUFFER_USAGE_CPU_WRITE) &&
+ !(usage & PIPE_BUFFER_USAGE_DISCARD))
+ usage |= PIPE_BUFFER_USAGE_CPU_READ;
+
return screen->buffer_map_range(screen, buf, offset, length, usage);
}
else