st/mesa: Set PIPE_TRANSFER_DISCARD for GL_MAP_INVALIDATE_RANGE/BUFFFER_BIT
authorMathias Fröhlich <Mathias.Froehlich@web.de>
Sat, 30 Oct 2010 13:38:39 +0000 (15:38 +0200)
committerBrian Paul <brianp@vmware.com>
Fri, 26 Nov 2010 21:03:42 +0000 (14:03 -0700)
Signed-off-by: Brian Paul <brianp@vmware.com>
Note: this is a candidate for the 7.9 branch.

src/mesa/state_tracker/st_cb_bufferobjects.c

index 73c9c2de7a189f96c2f2c82677bea0fd2180ab73..8b60f9040d00fe09e6f6e7662acf26cec2b5f9e7 100644 (file)
@@ -279,6 +279,12 @@ st_bufferobj_map_range(struct gl_context *ctx, GLenum target,
 
    if (access & GL_MAP_FLUSH_EXPLICIT_BIT)
       flags |= PIPE_TRANSFER_FLUSH_EXPLICIT;
+
+   if (access & GL_MAP_INVALIDATE_RANGE_BIT)
+      flags |= PIPE_TRANSFER_DISCARD;
+
+   if (access & GL_MAP_INVALIDATE_BUFFER_BIT)
+      flags |= PIPE_TRANSFER_DISCARD;
    
    if (access & GL_MAP_UNSYNCHRONIZED_BIT)
       flags |= PIPE_TRANSFER_UNSYNCHRONIZED;