aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/glide
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-03-31 05:49:08 +0000
committerBrian Paul <[email protected]>2000-03-31 05:49:08 +0000
commit7909019a3eb4a597c6d064d6e0e4ef88515e6ea7 (patch)
tree4b3138473682a038f6ae4c1eb6f05ae26b3836cd /src/mesa/drivers/glide
parent3bbbfbf20223d753b3b82d4bf6e6769a04886b69 (diff)
fixed Voodoo1/2/ stride problem in fxDDReadPixels()
Diffstat (limited to 'src/mesa/drivers/glide')
-rw-r--r--src/mesa/drivers/glide/fxdd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index bd571d415c3..01e70951418 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -543,8 +543,12 @@ static GLboolean fxDDReadPixels( GLcontext *ctx, GLint x, GLint y,
&info)) {
const GLint winX = fxMesa->x_offset;
const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
+#ifdef XF86DRI
const GLint srcStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
- ? (fxMesa->screen_width) : (info.strideInBytes / 2);
+ ? (fxMesa->screen_width) : (info.strideInBytes / 2);
+#else
+ const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */
+#endif
const GLushort *src = (const GLushort *) info.lfbPtr
+ (winY - y) * srcStride + (winX + x);
GLubyte *dst = (GLubyte *) _mesa_image_address(packing, dstImage,