On Son, 2002-12-29 at 12:04, Keith Whitwell wrote:
> Michel D�nzer wrote:
> > This patch avoids a segfault when running tuxracer with SW TCL, but I
> > suspect it's just a workaround, I hope someone more familiar with Mesa
> > sees and fixes the real problem. This didn't happen a while ago, it's
> > probably related to Ian's secondary color fixes?
>
> What you want is for control to pass to the loop used when VB->importable_data
> is nonzero. You could change the test condition,
How does this patch look? It does this, and fixes the fog stride as
well.
--
Earthling Michel D�nzer (MrCooper)/ Debian GNU/Linux (powerpc) developer
XFree86 and DRI project member / CS student, Free Software enthusiast
Index: extras/Mesa/src/tnl_dd/t_dd_vbtmp.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/extras/Mesa/src/tnl_dd/t_dd_vbtmp.h,v
retrieving revision 1.10
diff -p -u -r1.10 t_dd_vbtmp.h
--- extras/Mesa/src/tnl_dd/t_dd_vbtmp.h 25 Nov 2002 19:57:44 -0000 1.10
+++ extras/Mesa/src/tnl_dd/t_dd_vbtmp.h 12 Jan 2003 01:11:24 -0000
@@ -215,7 +215,7 @@ static void TAG(emit)( GLcontext *ctx,
}
}
- if (VB->importable_data) {
+ if (VB->importable_data || (DO_SPEC && !spec_stride) || (DO_FOG && !fog_stride)) {
/* May have nonstandard strides:
*/
if (start) {
@@ -234,7 +234,7 @@ static void TAG(emit)( GLcontext *ctx,
STRIDE_4UB(spec, start * spec_stride);
if (DO_FOG)
/*STRIDE_F(fog, start * fog_stride);*/
- fog = (GLfloat (*)[4])((GLfloat *)fog + start * fog_stride);
+ fog = (GLfloat (*)[4])((GLubyte *)fog + start * fog_stride);
}
for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) {
@@ -270,7 +270,7 @@ static void TAG(emit)( GLcontext *ctx,
if (DO_FOG) {
v->v.specular.alpha = fog[0][0] * 255.0;
/*STRIDE_F(fog, fog_stride);*/
- fog = (GLfloat (*)[4])((GLfloat *)fog + fog_stride);
+ fog = (GLfloat (*)[4])((GLubyte *)fog + fog_stride);
}
if (DO_TEX0) {
v->v.u0 = tc0[0][0];