summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2011-03-30 09:02:21 +0200
committerMichel Dänzer <[email protected]>2011-03-30 09:31:21 +0200
commitb082e04619224b0affc46fb6953c0efd5685fc17 (patch)
treebb07c464ae383c99e48fbfc2229e63d8085b1bd7
parentee8d182426d4ecda7b9f5089d19d36f7de2a4dfe (diff)
Use proper source row stride when getting depth/stencil texels.
-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 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;
}
}
}