From 84c7c14697c82fe25586f8186b4f47d80a6f05f9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Jan 2012 08:15:25 -0700 Subject: [PATCH] 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. --- src/mesa/state_tracker/st_cb_fbo.c | 2 ++ src/mesa/state_tracker/st_cb_texture.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index ec40a2b70c1..911e321a512 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -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 diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index ad4f23c7eb8..5cd9a4c94ee 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) { -- 2.30.2