summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2011-03-30 09:02:21 +0200
committerMichel Dänzer <daenzer@vmware.com>2011-03-30 10:54:51 +0200
commit5bbaf1992c7715def090bbc30081fdd086998e7c (patch)
tree7611517a3377f355e342e0f12c4b9b3c9e8d95d9
parent71b06c63ce4a5f58ceb72725d8320bc735997241 (diff)
Use proper source row stride when getting depth/stencil texels.
(cherry picked from commit b082e04619224b0affc46fb6953c0efd5685fc17)
-rw-r--r--src/mesa/main/texgetimage.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index c94f88e16e6..800ee312175 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -156,6 +156,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;
@@ -169,7 +170,7 @@ get_tex_depth_stencil(struct gl_context *ctx, GLuint dimensions,
_mesa_swap4((GLuint *) dest, width);
}
- src += width * row + width * height * img;
+ src += rowstride;
}
}
}