st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers
authorBrian Paul <brianp@vmware.com>
Tue, 17 Jan 2012 15:15:25 +0000 (08:15 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 18 Jan 2012 17:44:05 +0000 (10:44 -0700)
when mapping renderbuffers or texture images.

NOTE: This is a candidate for the 8.0 branch.

src/mesa/state_tracker/st_cb_fbo.c
src/mesa/state_tracker/st_cb_texture.c

index ec40a2b70c1be3f653b85f92fa6f21b996521365..911e321a5123cdca6574100776887761ab251b8c 100644 (file)
@@ -688,6 +688,8 @@ st_MapRenderbuffer(struct gl_context *ctx,
       usage |= PIPE_TRANSFER_READ;
    if (mode & GL_MAP_WRITE_BIT)
       usage |= PIPE_TRANSFER_WRITE;
+   if (mode & GL_MAP_INVALIDATE_RANGE_BIT)
+      usage |= PIPE_TRANSFER_DISCARD_RANGE;
 
    /* Note: y=0=bottom of buffer while y2=0=top of buffer.
     * 'invert' will be true for window-system buffers and false for
index ad4f23c7eb8de43ca7511c7fea9528b697641574..5cd9a4c94ee3c4436d09c4a10f61b5afd295fcf5 100644 (file)
@@ -189,6 +189,8 @@ st_MapTextureImage(struct gl_context *ctx,
       pipeMode |= PIPE_TRANSFER_READ;
    if (mode & GL_MAP_WRITE_BIT)
       pipeMode |= PIPE_TRANSFER_WRITE;
+   if (mode & GL_MAP_INVALIDATE_RANGE_BIT)
+      pipeMode |= PIPE_TRANSFER_DISCARD_RANGE;
 
    map = st_texture_image_map(st, stImage, slice, pipeMode, x, y, w, h);
    if (map) {