diff options
author | Keith Whitwell <[email protected]> | 2001-01-13 05:48:25 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2001-01-13 05:48:25 +0000 |
commit | 321f67c4729adeebd7aa9ef9e22c95e709952851 (patch) | |
tree | 8661da8a994f3c554c4428afdd53642c0814854b /src/mesa/main | |
parent | a087c7421bef25747e1d692f62062393d849c501 (diff) |
Fix crash in book/stencil.
Allow drivers to perform the perspective divide themselves. Assembly
to do cliptesting without perspective divide for size-4 vectors.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/light.c | 18 | ||||
-rw-r--r-- | src/mesa/main/lines.c | 8 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 1eed79bc2a7..bee9f0d807b 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1,4 +1,4 @@ -/* $Id: light.c,v 1.33 2001/01/04 16:22:18 brianp Exp $ */ +/* $Id: light.c,v 1.34 2001/01/13 05:48:25 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -1050,14 +1050,12 @@ static void validate_shine_table( GLcontext *ctx, GLuint i, GLfloat shininess ) struct gl_shine_tab *list = ctx->_ShineTabList; struct gl_shine_tab *s; -/* fprintf(stderr, "validate_shine_table %d, shininess %f\n", i, shininess); */ - foreach(s, list) if ( s->shininess == shininess ) break; if (s == list) { - GLint i; + GLint j; GLfloat *m; foreach(s, list) @@ -1067,19 +1065,19 @@ static void validate_shine_table( GLcontext *ctx, GLuint i, GLfloat shininess ) m = s->tab; m[0] = 0.0; if (shininess == 0.0) { - for (i = 1 ; i <= SHINE_TABLE_SIZE ; i++) - m[i] = 1.0; + for (j = 1 ; j <= SHINE_TABLE_SIZE ; j++) + m[j] = 1.0; } else { - for (i = 1 ; i < SHINE_TABLE_SIZE ; i++) { - GLdouble t, x = i / (GLfloat) (SHINE_TABLE_SIZE - 1); + for (j = 1 ; j < SHINE_TABLE_SIZE ; j++) { + GLdouble t, x = j / (GLfloat) (SHINE_TABLE_SIZE - 1); if (x < 0.005) /* underflow check */ x = 0.005; t = pow(x, shininess); if (t > 1e-20) - m[i] = t; + m[j] = t; else - m[i] = 0.0; + m[j] = 0.0; } m[SHINE_TABLE_SIZE] = 1.0; } diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c index 730e3f572f9..8a9256c1789 100644 --- a/src/mesa/main/lines.c +++ b/src/mesa/main/lines.c @@ -1,4 +1,4 @@ -/* $Id: lines.c,v 1.25 2001/01/08 04:09:41 keithw Exp $ */ +/* $Id: lines.c,v 1.26 2001/01/13 05:48:25 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -79,12 +79,14 @@ _mesa_LineStipple( GLint factor, GLushort pattern ) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (ctx->Line.StippleFactor == CLAMP( factor, 1, 256 ) && + factor = CLAMP( factor, 1, 256 ); + + if (ctx->Line.StippleFactor == factor && ctx->Line.StipplePattern == pattern) return; FLUSH_VERTICES(ctx, _NEW_LINE); - ctx->Line.StippleFactor = CLAMP( factor, 1, 256 ); + ctx->Line.StippleFactor = factor; ctx->Line.StipplePattern = pattern; if (ctx->Driver.LineStipple) |