From: Brian Paul Date: Fri, 29 Feb 2008 18:09:45 +0000 (-0700) Subject: gallium: fix glCopyPixels(GL_DEPTH) when Z format conversion is needed X-Git-Tag: 062012170305~17580^2~390^2~2380 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b47eb4808aa47e2ab276ab60493e28774cef21a;p=profile%2Fivi%2Fmesa.git gallium: fix glCopyPixels(GL_DEPTH) when Z format conversion is needed --- diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 6c0d75c..de99882 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],