aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-17 08:15:25 -0700
committerIan Romanick <[email protected]>2012-07-06 10:08:56 -0700
commited8fcc0c82a4b0d2480a003173cc6300db507c2f (patch)
treef93106ddcc84073344930dfe77f931a252ed8b68 /src
parented1da7e5038b344cea7a324b2bed6075af3d0028 (diff)
st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers
when mapping renderbuffers or texture images. NOTE: This is a candidate for the 8.0 branch. (cherry picked from commit 84c7c14697c82fe25586f8186b4f47d80a6f05f9)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c2
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index aeaf0c5d802..fefd93a4b3c 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -666,6 +666,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
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 88c5ad7c05f..a19120afc31 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -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) {