summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-02-29 11:09:45 -0700
committerBrian Paul <[email protected]>2008-02-29 11:10:20 -0700
commit0b47eb4808aa47e2ab276ab60493e28774cef21a (patch)
treecfce6680802ae682afa812aa67d5546a47dbda3e /src/mesa/state_tracker
parenta41b77f4fedc7d956d8cb44547d812b5449f8641 (diff)
gallium: fix glCopyPixels(GL_DEPTH) when Z format conversion is needed
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 6c0d75cc550..de99882ab78 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -1299,7 +1299,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
psRead,
srcx, srcy, width, height);
}
- else {
+ else if (type == GL_COLOR) {
/* alternate path using get/put_tile() */
GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
@@ -1308,6 +1308,13 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
free(buf);
}
+ else {
+ /* GL_DEPTH */
+ GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint));
+ pipe_get_tile_z(pipe, psRead, srcx, srcy, width, height, buf);
+ pipe_put_tile_z(pipe, psTex, 0, 0, width, height, buf);
+ free(buf);
+ }
/* draw textured quad */
draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2],