From b082e04619224b0affc46fb6953c0efd5685fc17 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Wed, 30 Mar 2011 09:02:21 +0200 Subject: [PATCH] Use proper source row stride when getting depth/stencil texels. --- src/mesa/main/texgetimage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 21d9140c550..db2cc840e5e 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -159,6 +159,7 @@ get_tex_depth_stencil(struct gl_context *ctx, GLuint dimensions, const GLint width = texImage->Width; const GLint height = texImage->Height; const GLint depth = texImage->Depth; + const GLint rowstride = texImage->RowStride; const GLuint *src = (const GLuint *) texImage->Data; GLint img, row; @@ -172,7 +173,7 @@ get_tex_depth_stencil(struct gl_context *ctx, GLuint dimensions, _mesa_swap4((GLuint *) dest, width); } - src += width * row + width * height * img; + src += rowstride; } } } -- 2.30.2