summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-04-18 11:33:42 -0600
committerBrian Paul <[email protected]>2008-04-18 11:46:00 -0600
commit39c06c4336ee44ad2c0ff12705a384dede050bee (patch)
tree66a3cfd6845145bb819c44d9a8eee7e10c87acd9
parente430d885e0d819172068805b1492cb6f10eb5d7f (diff)
gallium: get rid of unnecessary surface mapping
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 67f468c6892..5fb27857a7b 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -882,7 +882,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
struct st_renderbuffer *rbDraw = st_renderbuffer(ctx->DrawBuffer->_StencilBuffer);
struct pipe_surface *psRead = rbRead->surface;
struct pipe_surface *psDraw = rbDraw->surface;
- ubyte *readMap, *drawMap;
+ ubyte *drawMap;
ubyte *buffer;
int i;
@@ -892,14 +892,13 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
return;
}
- /* map the stencil buffers */
- readMap = pipe_surface_map(psRead);
- drawMap = pipe_surface_map(psDraw);
-
/* this will do stencil pixel transfer ops */
st_read_stencil_pixels(ctx, srcx, srcy, width, height, GL_UNSIGNED_BYTE,
&ctx->DefaultPacking, buffer);
+ /* map the stencil buffer */
+ drawMap = pipe_surface_map(psDraw);
+
/* draw */
/* XXX PixelZoom not handled yet */
for (i = 0; i < height; i++) {
@@ -937,8 +936,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
free(buffer);
- /* unmap the stencil buffers */
- pipe_surface_unmap(psRead);
+ /* unmap the stencil buffer */
pipe_surface_unmap(psDraw);
}