summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyril Brulebois <cyril.brulebois@enst-bretagne.fr>2007-02-23 00:48:40 +0100
committerJulien Cristau <jcristau@debian.org>2007-02-23 00:48:40 +0100
commit0aa8f1df3cf4c0318c3d1a84d323fd4663c721cc (patch)
treeac557aab7bfe675aa934766d8ed33b578ae545b2
parent6da132343758c4c02c3765ac59b2c4abdf00dbdb (diff)
* Non-maintainer upload.mesa-6.5.1-0.6
* Backport a fix from mesa 6.5.2 to mesa 6.5.1 which: - fixes braces around the ASSERT macro; - fixes a clipping problem, which leads to systematic segfaults of the X server (Closes: #405803).
-rw-r--r--debian/changelog10
-rw-r--r--src/mesa/tnl/t_vb_cliptmp.h16
2 files changed, 22 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index 6586376db9a..72750b0b537 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+mesa (6.5.1-0.6) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Backport a fix from mesa 6.5.2 to mesa 6.5.1 which:
+ - fixes braces around the ASSERT macro;
+ - fixes a clipping problem, which leads to systematic segfaults of the
+ X server (Closes: #405803).
+
+ -- Cyril Brulebois <cyril.brulebois@enst-bretagne.fr> Thu, 22 Feb 2007 21:08:56 +0100
+
mesa (6.5.1-0.5) unstable; urgency=low
* Non-maintainer upload.
diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h
index f3776e7eeb6..8dfa018aab7 100644
--- a/src/mesa/tnl/t_vb_cliptmp.h
+++ b/src/mesa/tnl/t_vb_cliptmp.h
@@ -125,6 +125,7 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask )
GLfloat t0 = 0;
GLfloat t1 = 0;
GLuint p;
+ const GLuint v0_orig = v0;
if (mask & 0x3f) {
LINE_CLIP( CLIP_RIGHT_BIT, -1, 0, 0, 1 );
@@ -153,12 +154,18 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask )
v0 = newvert;
newvert++;
}
- else
+ else {
ASSERT(t0 == 0.0);
+ }
if (VB->ClipMask[v1]) {
- INTERP_4F( t1, coord[newvert], coord[v1], coord[v0] );
- interp( ctx, t1, newvert, v1, v0, GL_FALSE );
+ /* Note: we need to use vertex v0_orig when computing the new
+ * interpolated/clipped vertex position, not the current v0 which
+ * may have got set when we clipped the other end of the line!
+ */
+
+ INTERP_4F( t1, coord[newvert], coord[v1], coord[v0_orig] );
+ interp( ctx, t1, newvert, v1, v0_orig, GL_FALSE );
if (ctx->Light.ShadeModel == GL_FLAT)
tnl->Driver.Render.CopyPV( ctx, newvert, v1 );
@@ -167,8 +174,9 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask )
newvert++;
}
- else
+ else {
ASSERT(t1 == 0.0);
+ }
tnl->Driver.Render.ClippedLine( ctx, v0, v1 );
}