gallium: fix glCopyPixels(GL_DEPTH) when Z format conversion is needed
This commit is contained in:
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user