summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-02-25 14:59:46 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-02-25 14:59:46 +0000
commitbb7e2e846cc9eb963a6d6101849952a8e5d770f7 (patch)
tree85c0792001b51b2fce6e9ec41f6e3784a77e4ce8
parenteaba005f189d73995fc13920e523d66e814f8326 (diff)
fixed front/back buffer stride problem for XF86DRI
-rw-r--r--src/mesa/drivers/glide/fxdd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index 6fd6a1e69e..bc1e55a5ff 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -446,8 +446,13 @@ static GLboolean fxDDDrawBitMap(GLcontext *ctx, GLint px, GLint py,
{
const GLint winX = fxMesa->x_offset;
const GLint winY = fxMesa->y_offset + fxMesa->height - 1;
+ /* The dest stride depends on the hardware and whether we're drawing
+ * to the front or back buffer. This compile-time test seems to do
+ * the job for now.
+ */
#ifdef XF86DRI
- const GLint dstStride = fxMesa->screen_width;
+ const GLint dstStride = (fxMesa->glCtx->Color.DrawBuffer == GL_FRONT)
+ ? (fxMesa->screen_width) : (info.strideInBytes / 2);
#else
const GLint dstStride = info.strideInBytes / 2; /* stride in GLushorts */
#endif